module.exports = { meta: { type: 'problem', docs: { description: 'Ban index.ts files in API - use explicit imports instead', category: 'Best Practices', recommended: true, }, fixable: null, schema: [], messages: { indexFile: 'Index files are banned in apps/api. Use explicit imports. Example: Instead of "import { foo } from "./", use "import { foo } from "./foo".', }, }, create(context) { const filename = context.getFilename(); const isIndexFile = /(^|\/|\\)index\.ts$/.test(filename); // Allow root index.ts const allowedPaths = [ 'apps/api/index.ts', 'apps/api/src/index.ts', ]; if (isIndexFile && !allowedPaths.some(path => filename.endsWith(path))) { context.report({ node: null, loc: { line: 1, column: 0 }, messageId: 'indexFile', }); } return {}; }, };