-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.cjs
111 lines (111 loc) · 3 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
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
108
109
110
111
module.exports = {
env: {
node: true,
},
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:jsonc/base',
'plugin:jsonc/recommended-with-json',
'standard',
],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 2020,
},
plugins: ['import', '@typescript-eslint', 'sort-keys-fix'],
rules: {
indent: [
'error',
2,
],
'linebreak-style': [
'error',
'unix',
],
semi: [
'error',
'never',
],
'space-before-function-paren': 'off',
quotes: ['error', 'single', { avoidEscape: true }],
'no-multi-spaces': 'error',
'no-trailing-spaces': 'error',
'comma-dangle': ['error', 'always-multiline'],
'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
'max-len': [process.env.NODE_ENV === 'production' ? 'warn' : 'off', {
code: 120,
ignoreTrailingComments: true,
ignoreUrls: true,
ignoreStrings: true,
ignoreTemplateLiterals: true,
ignoreRegExpLiterals: true,
}],
'@typescript-eslint/space-before-function-paren': ['error', {
anonymous: 'never',
named: 'never',
asyncArrow: 'always',
}],
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/indent': ['error', 2],
'@typescript-eslint/func-call-spacing': ['error', 'never'],
'@typescript-eslint/no-var-requires': 'off',
// Avoids false errors like “'NodeListOf' is not defined”.
'no-undef': 'off',
// Turns off some non-TypeScript rules in favor of their specific TypeScript rules to avoid false negatives:
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': 'error',
// Ensures ESLint understands that `defineEmits<{ ... }>()` does _not_ fail this rule.
'func-call-spacing': 'off',
/**
* JSON rules
*/
'jsonc/indent': ['error', 2, {}],
'jsonc/key-name-casing': ['error',
{
camelCase: false,
PascalCase: false,
SCREAMING_SNAKE_CASE: false,
'kebab-case': false,
snake_case: true,
ignores: [],
},
],
'jsonc/sort-keys': ['error',
'asc',
{
caseSensitive: true,
natural: true,
minKeys: 2,
},
],
'jsonc/key-spacing': ['error',
{
beforeColon: false,
afterColon: true,
mode: 'strict',
},
],
},
overrides: [
{
files: ['stylelint-plugin/rules/use-proper-token/token-map.js'],
rules: {
'sort-keys': ['error', 'asc', { natural: true, minKeys: 2, caseSensitive: false }],
'sort-keys-fix/sort-keys-fix': 'error',
},
},
{
files: ['*.json'],
parser: 'jsonc-eslint-parser',
},
// Ignore the sort order for the breakpoint tokens so they can be ordered from smallest to largest
{
files: ['tokens/source/breakpoint/**/*.json'],
rules: {
'jsonc/sort-keys': 'off',
},
},
],
}