-
-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy patheslint.config.js
More file actions
108 lines (90 loc) · 3.53 KB
/
eslint.config.js
File metadata and controls
108 lines (90 loc) · 3.53 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
import eslint from '@eslint/js';
import tseslint from 'typescript-eslint';
import stylistic from '@stylistic/eslint-plugin';
import importPlugin from 'eslint-plugin-import';
import simpleImportSort from 'eslint-plugin-simple-import-sort';
import unusedImports from 'eslint-plugin-unused-imports';
import unicorn from 'eslint-plugin-unicorn';
export default tseslint.config(
// Ignore patterns
{
ignores: ['**/lib/**', 'node_modules/**', 'dist/**', 'target/**', 'test-results/**', 'playwright/.cache', 'playwright-report/**']
},
// Base ESLint recommended config
eslint.configs.recommended,
// TypeScript ESLint recommended configs
...tseslint.configs.recommended,
// Unicorn recommended config
unicorn.configs['flat/recommended'],
// Main configuration
{
files: ['**/*.ts', '**/*.tsx'],
languageOptions: {
parser: tseslint.parser,
parserOptions: {
ecmaVersion: 6,
sourceType: 'module',
project: [
'./tsconfig.eslint.json',
],
},
},
plugins: {
'@typescript-eslint': tseslint.plugin,
'@stylistic': stylistic,
'import': importPlugin,
'simple-import-sort': simpleImportSort,
'unused-imports': unusedImports,
},
rules: {
'simple-import-sort/imports': 'error',
'simple-import-sort/exports': 'error',
'sort-imports': 'off',
'import/order': 'off',
'unused-imports/no-unused-imports': 'error',
'no-multiple-empty-lines': ['warn', {
'max': 1,
}],
'@typescript-eslint/explicit-module-boundary-types': 'off',
// Formatting rules using @stylistic plugin
'@stylistic/indent': ['error', 4, {
'MemberExpression': 'off',
'SwitchCase': 1,
}],
'@stylistic/quotes': ['error', 'single', {
'allowTemplateLiterals': 'always',
'avoidEscape': true,
}],
'@typescript-eslint/no-explicit-any': 'off', // todo: review
'@typescript-eslint/no-unused-vars': ['warn', {
'args': 'none',
'vars': 'all',
'varsIgnorePattern': '^.*_$',
}],
'unicorn/empty-brace-spaces': 'off',
'unicorn/filename-case': [ 'error', {
'cases': {
'kebabCase': true, // packages
'pascalCase': true, // classes
'camelCase': true, // functions
'snakeCase': true, // test scenarios
},
"ignore": ["multi-actor"],
}],
'unicorn/no-array-for-each': 'off',
'unicorn/no-array-reduce': 'off',
'unicorn/no-array-callback-reference': 'off',
'unicorn/no-static-only-class': 'off',
'unicorn/numeric-separators-style': 'off',
'unicorn/prefer-module': 'off', // fixme disable when we can provide support for ESM
'unicorn/prefer-node-protocol': 'off', // fixme requires Node 14.13 or newer, disable until we no longer have to support Node 12
'unicorn/prefer-spread': 'off',
'unicorn/prevent-abbreviations': [ 'error', {
'allowList': {
'conf': true,
'wdio': true,
}
}]
}
}
);