-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.eslintrc.cjs
More file actions
54 lines (54 loc) · 1.66 KB
/
.eslintrc.cjs
File metadata and controls
54 lines (54 loc) · 1.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
module.exports = {
root: true,
env: {
browser: true,
node: true,
es2020: true,
},
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 2020,
sourceType: 'module',
ecmaFeatures: { jsx: true },
},
plugins: ['react', 'react-hooks', '@typescript-eslint'],
extends: [
'eslint:recommended',
'plugin:react/recommended',
'plugin:react-hooks/recommended',
'plugin:@typescript-eslint/recommended',
'prettier',
],
settings: {
react: { version: 'detect' },
},
rules: {
// Relaxed for gradual adoption
'@typescript-eslint/no-var-requires': 'off',
'@typescript-eslint/no-unused-vars': ['warn', { argsIgnorePattern: '^_' }],
'@typescript-eslint/no-explicit-any': 'off',
'react/prop-types': 'off', // Using TypeScript instead
'react/react-in-jsx-scope': 'off', // React 18 JSX transform
'no-unused-vars': 'off', // Handled by @typescript-eslint
'no-useless-escape': 'warn',
'no-empty': 'warn',
'@typescript-eslint/no-this-alias': 'warn',
'react/no-unescaped-entities': 'warn',
},
overrides: [
{
// Core migration boundary: renderer files should import from @core/operations, not database directly.
// Using 'warn' during migration — once all legacy sites are migrated, switch to 'error'.
files: ['src/renderer/**/*.{ts,tsx,js,jsx}'],
rules: {
'no-restricted-imports': ['warn', {
patterns: [{
group: ['**/database', '**/database/**'],
message: 'Import from @core/operations instead. See docs/MIGRATION.md',
}],
}],
},
},
],
ignorePatterns: ['out/', 'node_modules/', 'dll/'],
};