-
Notifications
You must be signed in to change notification settings - Fork 691
/
Copy patheslint.config.mjs
52 lines (50 loc) · 1.6 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
import globals from 'globals';
import eslintPluginEslint from '@eslint/js';
import eslintPluginStylistic from '@stylistic/eslint-plugin-js';
import eslintPluginHtml from 'eslint-plugin-html';
const config = [
{
files: ['**/*.js'],
languageOptions: {
globals: {
...globals.browser,
...globals.node,
define: 'readonly',
L: 'writable'
}
},
plugins: {
...eslintPluginStylistic.configs['all-flat'].plugins
},
rules: {
...eslintPluginEslint.configs['recommended'].rules,
...eslintPluginStylistic.configs['all-flat'].rules,
'@stylistic/js/brace-style': ['error', '1tbs'],
'@stylistic/js/comma-dangle': ['error', 'only-multiline'],
'@stylistic/js/dot-location': ['error', 'property'],
'@stylistic/js/function-call-argument-newline': ['error', 'consistent'],
'@stylistic/js/indent': ['error', 'tab'],
'@stylistic/js/multiline-comment-style': 'off',
'@stylistic/js/no-tabs': 'off',
'@stylistic/js/object-curly-spacing': ['error', 'always'],
'@stylistic/js/padded-blocks': 'off',
'@stylistic/js/quotes': ['error', 'single'],
'@stylistic/js/quote-props': ['error', 'consistent-as-needed'],
'@stylistic/js/semi': ['error', 'always'],
'@stylistic/js/space-before-function-paren': ['error', 'never'],
'@stylistic/js/array-element-newline': ["error", "consistent"],
'no-lonely-if': 'error',
'no-unused-expressions': ['error', { allowTernary: true }]
}
},
{
files: ['**/*.html'],
plugins: {
eslintPluginHtml,
},
settings: {
'html/report-bad-indent': 2,
},
}
];
export default config;