-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy patheslint.config.cjs
More file actions
96 lines (93 loc) · 2.54 KB
/
eslint.config.cjs
File metadata and controls
96 lines (93 loc) · 2.54 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
const js = require('@eslint/js')
const tsParser = require('@typescript-eslint/parser')
const tsPlugin = require('@typescript-eslint/eslint-plugin')
const importPlugin = require('eslint-plugin-import')
const unicorn = require('eslint-plugin-unicorn')
const prettierConfig = require('eslint-config-prettier')
const prettierPlugin = require('eslint-plugin-prettier')
module.exports = [
{
ignores: ['node_modules/**', '**/dist/**']
},
// Base JS config
{
...js.configs.recommended,
plugins: {
unicorn,
import: importPlugin,
prettier: prettierPlugin
},
languageOptions: {
ecmaVersion: 2020,
sourceType: 'module'
},
rules: {
...prettierConfig.rules,
'prettier/prettier': [
'error',
{
bracketSpacing: true,
semi: false,
singleQuote: true,
trailingComma: 'none'
}
],
quotes: ['error', 'single', { avoidEscape: true }],
camelcase: ['error', { properties: 'never' }],
semi: ['error', 'never'],
eqeqeq: ['error', 'always'],
'prefer-const': 'error',
'no-multiple-empty-lines': [2, { max: 1, maxEOF: 1 }],
'array-bracket-spacing': ['error', 'never'],
'brace-style': ['error', '1tbs', { allowSingleLine: true }],
'comma-spacing': ['error', { before: false, after: true }],
'no-lonely-if': 'error',
'dot-notation': 'error',
'no-else-return': 'error',
'no-tabs': 'error',
'no-trailing-spaces': [
'error',
{ skipBlankLines: false, ignoreComments: false }
],
'no-var': 'error',
'unicode-bom': ['error', 'never'],
curly: ['error', 'all'],
'object-curly-spacing': ['error', 'always'],
'keyword-spacing': ['error'],
'require-atomic-updates': 0,
'linebreak-style': ['error', 'unix'],
'import/extensions': ['error', 'ignorePackages'],
'no-restricted-syntax': [
'error',
'IfStatement > ExpressionStatement > AssignmentExpression'
]
}
},
// TypeScript files
{
files: ['**/*.ts'],
plugins: {
'@typescript-eslint': tsPlugin
},
languageOptions: {
parser: tsParser
},
rules: {
'@typescript-eslint/no-unused-vars': [
'error',
{ argsIgnorePattern: '^_' }
],
'@typescript-eslint/consistent-type-imports': 'error',
'no-unused-vars': 'off',
'no-undef': 'off',
'no-redeclare': 'off'
}
},
// TypeScript test files
{
files: ['**/*.test.ts'],
rules: {
'dot-notation': 'off'
}
}
]