-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.cjs
64 lines (64 loc) · 2.33 KB
/
.eslintrc.cjs
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
/** @type {import('eslint').Linter.Config} */
module.exports = {
root: true,
extends: [
'eslint:recommended',
'plugin:unicorn/all',
'plugin:import/recommended',
'plugin:eslint-plugin/all',
'prettier',
],
env: {
es6: true,
node: true,
},
rules: {
curly: 'error',
eqeqeq: 'error',
'eslint-plugin/require-meta-docs-url': [
'error',
{
pattern:
'https://github.com/matzkoh/eslint-plugin-generate-test-id/tree/HEAD/docs/rules/{{name}}.md',
},
],
'import/newline-after-import': 'error',
'import/no-cycle': 'error',
'import/no-extraneous-dependencies': 'error',
'import/no-useless-path-segments': 'error',
'import/order': [
'error',
{
groups: ['builtin', 'external', 'internal', 'parent', 'sibling', 'index', 'object'],
'newlines-between': 'always',
pathGroupsExcludedImportTypes: ['builtin'],
alphabetize: { order: 'asc', orderImportKind: 'asc', caseInsensitive: true },
},
],
'no-constant-condition': ['error', { checkLoops: false }],
'no-empty': ['error', { allowEmptyCatch: true }],
'no-unused-vars': [
process.env.CI ? 'error' : 'warn',
{ argsIgnorePattern: '^_', varsIgnorePattern: '^_', ignoreRestSiblings: true },
],
'padding-line-between-statements': [
'error',
{ blankLine: 'always', prev: '*', next: '*' },
{ blankLine: 'any', prev: 'expression', next: 'expression' },
{ blankLine: 'always', prev: 'multiline-expression', next: 'expression' },
{ blankLine: 'any', prev: '*', next: 'expression' },
{ blankLine: 'any', prev: 'singleline-const', next: 'const' },
{ blankLine: 'any', prev: 'singleline-let', next: 'let' },
{ blankLine: 'any', prev: 'singleline-var', next: 'var' },
{ blankLine: 'any', prev: 'import', next: 'import' },
{ blankLine: 'any', prev: 'export', next: 'export' },
{ blankLine: 'any', prev: 'cjs-import', next: 'cjs-import' },
{ blankLine: 'any', prev: 'cjs-export', next: 'cjs-export' },
{ blankLine: 'any', prev: 'case', next: ['case', 'default'] },
],
'sort-imports': ['error', { ignoreDeclarationSort: true }],
'unicorn/explicit-length-check': 'off',
'unicorn/no-keyword-prefix': ['error', { checkProperties: false }],
'unicorn/prevent-abbreviations': 'off',
},
}