-
Notifications
You must be signed in to change notification settings - Fork 2
/
eslint.config.mjs
122 lines (120 loc) · 4 KB
/
eslint.config.mjs
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
112
113
114
115
116
117
118
119
120
121
122
import globals from "globals";
import eslintPluginStylistic from "@stylistic/eslint-plugin";
import eslintPluginImport from "eslint-plugin-import";
import eslintPluginJs from "@eslint/js";
import eslintPluginPackageJson from "eslint-plugin-package-json/configs/recommended";
const config = [
eslintPluginImport.flatConfigs.recommended,
eslintPluginJs.configs.recommended,
{
"files": ["**/*.js"],
"languageOptions": {
"ecmaVersion": "latest",
"globals": {
...globals.browser,
...globals.node,
"config": true,
"Log": true,
"MM": true,
"Module": true,
"moment": true,
"document": true,
"windows": true,
"configMerge": true
}
},
"plugins": {
...eslintPluginStylistic.configs["all-flat"].plugins
},
"rules": {
...eslintPluginStylistic.configs["all-flat"].rules,
"@stylistic/array-element-newline": ["error", "consistent"],
"@stylistic/arrow-parens": ["error", "always"],
"@stylistic/brace-style": "off",
"@stylistic/comma-dangle": ["error", "never"],
"@stylistic/dot-location": ["error", "property"],
"@stylistic/function-call-argument-newline": ["error", "consistent"],
"@stylistic/function-paren-newline": ["error", "consistent"],
"@stylistic/implicit-arrow-linebreak": ["error", "beside"],
"@stylistic/indent": ["error", 2],
"@stylistic/max-statements-per-line": ["error", {"max": 2}],
"@stylistic/multiline-comment-style": "off",
"@stylistic/multiline-ternary": ["error", "always-multiline"],
"@stylistic/newline-per-chained-call": ["error", {"ignoreChainWithDepth": 4}],
"@stylistic/no-extra-parens": "off",
"@stylistic/no-tabs": "off",
"@stylistic/object-curly-spacing": ["error", "always"],
"@stylistic/object-property-newline": ["error", {"allowAllPropertiesOnSameLine": true}],
"@stylistic/operator-linebreak": ["error", "before"],
"@stylistic/padded-blocks": "off",
"@stylistic/quote-props": ["error", "as-needed"],
"@stylistic/quotes": ["error", "double"],
"@stylistic/semi": ["error", "always"],
"@stylistic/space-before-function-paren": ["error", "always"],
"@stylistic/spaced-comment": "off",
"eqeqeq": "error",
"id-length": "off",
"import/order": "error",
"import/extensions": [
"error",
{
"json": "always" // ignore json require (display EXT version and rev date)
}
],
"import/newline-after-import": "error",
"import/no-unresolved": "error",
"init-declarations": "off",
"max-lines-per-function": ["warn", 400],
"max-statements": "off",
"no-global-assign": "off",
"no-inline-comments": "off",
"no-magic-numbers": "off",
"no-param-reassign": "error",
"no-plusplus": "off",
"no-prototype-builtins": "off",
"no-ternary": "off",
"no-throw-literal": "error",
"no-undefined": "off",
"no-unused-vars": "error",
"no-useless-return": "error",
"no-warning-comments": "off",
"object-shorthand": ["error", "methods"],
"one-var": "off",
"prefer-destructuring": "off",
"prefer-template": "error",
"sort-keys": "off"
}
},
{
"files": ["eslint.config.mjs"],
"languageOptions": {
"ecmaVersion": "latest",
"globals": {
...globals.node
},
"sourceType": "module"
},
"plugins": {
...eslintPluginStylistic.configs["all-flat"].plugins
},
"rules": {
...eslintPluginStylistic.configs["all-flat"].rules,
"@stylistic/indent": ["error", 2],
"@stylistic/array-element-newline": "off",
"@stylistic/function-call-argument-newline": "off",
"import/no-unresolved": "off"
}
},
{
"files": ["package.json"],
...eslintPluginPackageJson,
"rules": {
...eslintPluginPackageJson.rules,
"package-json/valid-name": "off"
}
},
{
"ignores": ["MMM-*.js", "node_helper.js"]
}
];
export default config;