-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy patheslint.config.js
More file actions
76 lines (71 loc) · 2.01 KB
/
Copy patheslint.config.js
File metadata and controls
76 lines (71 loc) · 2.01 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
const tseslint = require('@typescript-eslint/eslint-plugin');
const tsParser = require('@typescript-eslint/parser');
const simpleImportSort = require('eslint-plugin-simple-import-sort');
module.exports = [
// Global ignores (replaces .eslintignore)
{
ignores: [
'dist/**',
'node_modules/**',
'test-results/**',
'playwright-report/**',
'**/.DS_Store',
'**/coverage/**',
'**/*.min.js',
'**/*.map',
'.vscode/**',
'.git/**',
'.husky/**',
'**/*.d.ts',
],
},
// Configuration for TypeScript files
{
files: ['**/*.ts', '**/*.tsx', '**/*.js', '**/*.jsx'],
languageOptions: {
parser: tsParser,
parserOptions: {
ecmaVersion: 12,
sourceType: 'module',
},
globals: {
// Node.js globals
process: 'readonly',
Buffer: 'readonly',
__dirname: 'readonly',
__filename: 'readonly',
global: 'readonly',
console: 'readonly',
// Browser globals
window: 'readonly',
document: 'readonly',
},
},
plugins: {
'@typescript-eslint': tseslint,
'simple-import-sort': simpleImportSort,
},
rules: {
// ESLint recommended rules
'no-unused-vars': 'off', // Turn off base rule as it can report incorrect errors
// Custom rules from your old config
'no-async-promise-executor': 'off',
'no-control-regex': 'off',
'no-empty-pattern': 'off',
'simple-import-sort/imports': 'error',
'simple-import-sort/exports': 'error',
// TypeScript rules
'@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-explicit-any': 'error',
},
},
// Relaxed rules for test files
{
files: ['tests/**/*.ts', 'tests/**/*.tsx'],
rules: {
'@typescript-eslint/no-explicit-any': 'off',
},
},
];