-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy patheslint.config.mjs
More file actions
73 lines (72 loc) · 2.65 KB
/
eslint.config.mjs
File metadata and controls
73 lines (72 loc) · 2.65 KB
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
import { defineConfig } from 'eslint/config';
import stylisticJs from '@stylistic/eslint-plugin-js';
import globals from 'globals';
import javascript from '@eslint/js';
export default defineConfig([
{
files: ['**/*.{js,mjs,cjs}'],
languageOptions: {
globals: {
...globals.browser,
'process': 'readonly',
'__dirname': 'readonly',
},
},
},
{
files: ['**/*.{js,mjs,cjs}'],
plugins: {
'js': javascript,
'@stylistic/js': stylisticJs,
},
extends: ['js/recommended'],
rules: {
'@stylistic/js/array-bracket-spacing': ['error', 'never'],
'@stylistic/js/block-spacing': 'error',
'@stylistic/js/brace-style': ['error', '1tbs', {
'allowSingleLine': true,
}],
'@stylistic/js/comma-dangle': ['error', 'always-multiline'],
'@stylistic/js/comma-spacing': ['error', {
'before': false,
'after': true,
}],
'@stylistic/js/eol-last': ['error', 'always'],
'@stylistic/js/function-call-spacing': ['error', 'never'],
'@stylistic/js/indent': ['error', 4],
'@stylistic/js/lines-around-comment': ['error', {
'beforeBlockComment': true,
'beforeLineComment': true,
'allowBlockStart': true,
}],
'@stylistic/js/lines-between-class-members': ['error', 'always'],
'@stylistic/js/no-confusing-arrow': 'error',
'@stylistic/js/no-extra-semi': 'error',
'@stylistic/js/no-floating-decimal': 'error',
'@stylistic/js/no-trailing-spaces': ['error', {
'ignoreComments': true,
}],
'@stylistic/js/quotes': ['error', 'single'],
'@stylistic/js/semi': ['error', 'always'],
'@stylistic/js/semi-spacing': 'error',
'@stylistic/js/space-before-blocks': 'error',
'@stylistic/js/space-before-function-paren': ['error', 'never'],
'camelcase': ['error', {
'ignoreDestructuring': true,
}],
'curly': 'error',
'eqeqeq': ['error', 'always'],
'id-length': ['error', {
'min': 3,
}],
'no-lonely-if': 'error',
'no-underscore-dangle': 'error',
'no-var': 'error',
'prefer-const': 'error',
'prefer-object-has-own': 'error',
'prefer-template': 'error',
'radix': 'error',
'yoda': ['error', 'never'],
},
},
]);