-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy patheslint.config.mjs
65 lines (65 loc) · 2.5 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
import globals from 'globals'
import js from '@eslint/js'
import stylisticJs from '@stylistic/eslint-plugin-js'
export default [
js.configs.recommended,
stylisticJs.configs['all-flat'],
{
// files: ['assets/scripts/**/*.js'],
plugins: {
'@stylistic/js': stylisticJs
},
languageOptions: {
globals: {
...globals.browser
}
},
rules: {
'no-var': ['error'],
'no-unused-vars': ['warn', { argsIgnorePattern: '^_' }],
'no-console': ['warn', { allow: ['error', 'warn'] }],
'arrow-body-style': ['warn'],
'@stylistic/js/indent': ['error', 'tab', { SwitchCase: 1 }],
'@stylistic/js/no-mixed-spaces-and-tabs': ['error', 'smart-tabs'],
'@stylistic/js/linebreak-style': ['error', 'unix'],
'@stylistic/js/max-len': ['error', { code: 100, tabWidth: 2, ignoreUrls: true }],
'@stylistic/js/quotes': ['warn', 'single', { avoidEscape: true }],
'@stylistic/js/semi': ['error', 'never'],
'@stylistic/js/no-multi-spaces': ['error'],
'@stylistic/js/keyword-spacing': ['warn', { overrides: { catch: { after: false } } }],
'@stylistic/js/brace-style': ['error'],
'@stylistic/js/space-before-function-paren': ['warn', 'never'],
'@stylistic/js/function-paren-newline': ['warn', 'consistent'],
'@stylistic/js/space-before-blocks': ['warn', 'always'],
'@stylistic/js/block-spacing': ['warn', 'always'],
'@stylistic/js/key-spacing': ['warn'],
'@stylistic/js/object-curly-spacing': ['warn', 'always'],
'@stylistic/js/space-infix-ops': ['warn'],
'@stylistic/js/space-in-parens': ['warn'],
'@stylistic/js/arrow-parens': ['warn', 'as-needed'],
'@stylistic/js/arrow-spacing': ['warn'],
'@stylistic/js/padded-blocks': ['warn', 'never'],
'@stylistic/js/spaced-comment': ['warn', 'always', { markers: ['//'] }],
'@stylistic/js/multiline-comment-style': ['warn', 'separate-lines'],
'@stylistic/js/function-call-argument-newline': ['warn', 'consistent'],
'@stylistic/js/quote-props': ['warn', 'as-needed'],
'@stylistic/js/object-property-newline': ['warn', { allowAllPropertiesOnSameLine: true }],
'@stylistic/js/array-element-newline': ['warn', 'consistent'],
'@stylistic/js/dot-location': ['warn', 'property'],
'@stylistic/js/multiline-ternary': ['warn', 'always-multiline'],
'@stylistic/js/no-extra-parens': ['warn', 'all', { nestedBinaryExpressions: false }],
'@stylistic/js/operator-linebreak': ['warn', 'after']
}
},
{
files: ['*.config.js'],
languageOptions: {
globals: {
...globals.node
}
}
},
{
ignores: ['public/scripts/compiled/']
}
]