-
Notifications
You must be signed in to change notification settings - Fork 0
/
eslint.config.js
52 lines (51 loc) · 1.95 KB
/
eslint.config.js
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 js from '@eslint/js';
export default [
js.configs.recommended,
{
files: ['**/*.js'],
ignores: [
'eslint.config.js',
'rollup.config.js'
],
languageOptions: {
ecmaVersion: 2022,
sourceType: 'module',
globals: {
...globals.node,
...globals.browser
}
},
rules: {
'arrow-parens': ['error', 'as-needed'],
'arrow-spacing': ['error', { 'before': true, 'after': true }],
'comma-dangle': ['warn', 'never'],
'comma-spacing': ['error', { 'before': false, 'after': true }],
'curly': ['error', 'multi-line'],
'eqeqeq': ['error', 'always'],
'indent': ['error', 'tab', { 'SwitchCase': 1, 'ignoredNodes': ['TemplateLiteral *'] }],
'key-spacing': ['error', { 'beforeColon': false, 'afterColon': true }],
'keyword-spacing': ['error', { 'before': true, 'after': true }],
'linebreak-style': ['error', 'unix'],
'lines-between-class-members': ['error', 'always', { 'exceptAfterSingleLine': true }],
'new-parens': 'error',
'no-inner-declarations': 'off',
'no-return-await': 'error',
'object-curly-spacing': ['error', 'always'],
'object-shorthand': ['error', 'always'],
'one-var': ['error', { 'initialized': 'never' }],
'padded-blocks': ['error', 'never'],
'prefer-arrow-callback': 'error',
'prefer-const': ['error', { 'destructuring': 'any' }],
'quotes': ['error', 'single'],
'semi-spacing': ['error', { 'before': false, 'after': true }],
'semi': ['error', 'always'],
'sort-imports': ['warn', { 'ignoreDeclarationSort': true }],
'space-before-blocks': ['error', 'always'],
'space-before-function-paren': ['error', { 'anonymous': 'always', 'named': 'never', 'asyncArrow': 'always' }],
'space-in-parens': ['error', 'never'],
'space-infix-ops': 'error',
'space-unary-ops': ['error', { 'words': true, 'nonwords': false }]
}
}
];