-
-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy patheslint.config.js
More file actions
62 lines (60 loc) · 1.58 KB
/
eslint.config.js
File metadata and controls
62 lines (60 loc) · 1.58 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
import sonarjs from 'eslint-plugin-sonarjs';
import tsPlugin from '@typescript-eslint/eslint-plugin';
import tsParser from '@typescript-eslint/parser';
const eslintConfig = [
{
ignores: [
'dist/**',
'node_modules/**',
'*.d.ts',
'**/*.d.ts',
'.yalc/**',
'yalc.lock',
'examples/**',
'vite.config.ts',
],
},
{
files: ['**/*.{ts,tsx}'],
languageOptions: {
parser: tsParser,
parserOptions: {
ecmaFeatures: { modules: true },
project: './tsconfig.json',
},
},
plugins: {
'@typescript-eslint': tsPlugin,
sonarjs,
},
rules: {
// Enforce curly braces for all control statements
curly: ['error', 'all'],
'@typescript-eslint/no-explicit-any': 'warn',
'@typescript-eslint/explicit-function-return-type': [
'warn',
{ allowExpressions: true },
],
'@typescript-eslint/no-unused-vars': [
'error',
{
argsIgnorePattern: '^_',
varsIgnorePattern: '^_',
caughtErrorsIgnorePattern: '^_',
},
],
'no-unneeded-ternary': ['error', { defaultAssignment: false }],
'no-nested-ternary': 'error',
'no-constant-binary-expression': 'error',
complexity: ['warn', { max: 100 }],
'max-lines-per-function': [
'warn',
{ max: 1000, skipBlankLines: true, skipComments: true, IIFEs: true },
],
'no-unused-vars': 'off',
'sonarjs/no-duplicate-string': 'warn',
'sonarjs/no-identical-functions': 'warn',
},
},
];
export default eslintConfig;