moex-vibe/apps/frontend/.eslintrc.cjs
Sergey Krylov 055bc23097
Some checks failed
CI / ci (pull_request) Failing after 2m45s
CI / ci (push) Failing after 2m41s
refactor(frontend): migrate auth/portfolio pages to FSD, add layer boundaries
- Convert LoginPage, RegisterPage, ProfilePage to FSD structure (index.ts + ui/)
- Convert PortfoliosListPage, PortfolioDetailPage to FSD structure
- Replace relative imports with @/ aliases in portfolio pages
- Add ESLint import/no-restricted-paths for FSD layer boundaries
- Refactor useSession test to mock context instead of import from app/
- Mark frontend-fsd-screener tasks as complete
2026-06-20 21:42:33 +03:00

68 lines
2.4 KiB
JavaScript

const path = require('path');
const src = path.resolve(__dirname, 'src');
module.exports = {
parser: '@typescript-eslint/parser',
parserOptions: {
sourceType: 'module',
ecmaFeatures: { jsx: true },
},
plugins: ['@typescript-eslint/eslint-plugin', 'react', 'react-hooks', 'import'],
extends: [
'plugin:@typescript-eslint/recommended',
'plugin:react/recommended',
'plugin:react-hooks/recommended',
],
root: true,
env: {
browser: true,
es2020: true,
},
settings: {
react: { version: 'detect' },
'import/resolver': {
typescript: {
alwaysTryTypes: true,
project: './tsconfig.json',
},
},
},
ignorePatterns: ['.eslintrc.cjs', 'vite.config.ts', 'vitest.config.ts', 'dist/'],
rules: {
'@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
'@typescript-eslint/no-explicit-any': 'off',
'react/react-in-jsx-scope': 'off',
// FSD layer boundaries
// NOTE: `from` = what's being imported, `target` = the file doing the import
'import/no-restricted-paths': [
'error',
{
zones: [
// shared/ cannot import from entities/, features/, widgets/, pages/, app/
{ 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` },
// entities/ cannot import from features/, widgets/, pages/, app/
{ from: `${src}/features`, target: `${src}/entities` },
{ from: `${src}/widgets`, target: `${src}/entities` },
{ from: `${src}/pages`, target: `${src}/entities` },
{ from: `${src}/app`, target: `${src}/entities` },
// features/ cannot import from widgets/, pages/, app/
{ from: `${src}/widgets`, target: `${src}/features` },
{ from: `${src}/pages`, target: `${src}/features` },
{ from: `${src}/app`, target: `${src}/features` },
// widgets/ cannot import from pages/, app/
{ from: `${src}/pages`, target: `${src}/widgets` },
{ from: `${src}/app`, target: `${src}/widgets` },
// pages/ cannot import from app/
{ from: `${src}/app`, target: `${src}/pages` },
],
},
],
},
};