const path = require('path'); const src = path.resolve(__dirname, 'src'); module.exports = { parser: '@typescript-eslint/parser', parserOptions: { sourceType: 'module', }, plugins: ['@conarti/feature-sliced', 'import'], root: true, env: { browser: true, es2020: true, }, settings: { 'import/resolver': { typescript: { alwaysTryTypes: true, project: './tsconfig.json', }, }, }, ignorePatterns: ['.eslintrc.cjs', 'vite.config.ts', 'vitest.config.ts', 'dist/'], rules: { // FSD layer boundaries (from @conarti/eslint-plugin-feature-sliced) '@conarti/feature-sliced/layers-slices': ['error', { ignoreInFilesPatterns: ['**/*.test.ts', '**/*.test.tsx', '**/*.spec.ts', '**/*.spec.tsx', '**/test/**'], }], // FSD layer boundaries (from import/no-restricted-paths) 'import/no-restricted-paths': [ 'error', { zones: [ { from: `${src}/entities`, target: `${src}/shared` }, { from: `${src}/features`, target: `${src}/shared` }, { from: `${src}/widgets`, target: `${src}/shared` }, { from: `${src}/pages`, target: `${src}/shared` }, { from: `${src}/app`, target: `${src}/shared` }, { from: `${src}/features`, target: `${src}/entities` }, { from: `${src}/widgets`, target: `${src}/entities` }, { from: `${src}/pages`, target: `${src}/entities` }, { from: `${src}/app`, target: `${src}/entities` }, { from: `${src}/widgets`, target: `${src}/features` }, { from: `${src}/pages`, target: `${src}/features` }, { from: `${src}/app`, target: `${src}/features` }, { from: `${src}/pages`, target: `${src}/widgets` }, { from: `${src}/app`, target: `${src}/widgets` }, { from: `${src}/app`, target: `${src}/pages` }, ], }, ], }, };