-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjavascript.js
109 lines (106 loc) · 2.82 KB
/
javascript.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
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
module.exports = {
extends: [
'eslint:recommended',
],
ignorePatterns: [
'node_modules/',
'dist/',
'work/',
'coverage/',
'**/*.bak/',
],
parserOptions: {
ecmaVersion: 2020,
},
plugins: [
'prefer-arrow',
'jsdoc',
'simple-import-sort',
],
rules: {
eqeqeq: 'error',
'no-unused-vars': 'error',
'no-undef': 'error',
'no-constant-condition': 'error',
'no-else-return': 'error',
quotes: ['error', 'single', { avoidEscape: true }],
'prefer-arrow-callback': 'error',
strict: 'off',
'no-trailing-spaces': 'error',
'no-tabs': 'error',
'arrow-parens': 'error',
'no-var': 'error',
'prefer-const': 'error',
'prefer-spread': 'error',
semi: ['error', 'always'],
'comma-dangle': ['error', 'always-multiline'],
'comma-spacing': 'error',
'object-curly-spacing': ['error', 'always'],
'array-bracket-spacing': 'error',
'dot-notation': 'error',
'dot-location': ['error', 'property'],
'no-multi-str': 'error',
'no-multi-spaces': ['error', {
ignoreEOLComments: true,
exceptions: {
VariableDeclarator: true,
ImportDeclaration: true,
},
}],
'require-await': 'error',
'no-sequences': 'error',
'wrap-iife': ['error', 'any'],
'no-restricted-imports': [
'error',
{
paths: [
{
name: 'lodash',
message:
"Please use `import [package] from 'lodash/[package]'` instead.",
},
],
patterns: ['!lodash/*'],
},
],
// This rule is similar to `prefer-arrow-callback`, but also enforces
// the general use of () => { ... } over `function` declarations
'prefer-arrow/prefer-arrow-functions': 'error',
'jsdoc/no-bad-blocks': ['error', { preventAllMultiAsteriskBlocks: true }],
'jsdoc/check-alignment': 'error',
'jsdoc/check-line-alignment': 'error',
'jsdoc/check-syntax': 'error',
'jsdoc/multiline-blocks': 'error',
'jsdoc/require-hyphen-before-param-description': ['error', 'never'],
'jsdoc/tag-lines': [
'error',
'any',
{
startLines: 1,
},
],
indent: ['error', 2, {
SwitchCase: 1,
}],
'simple-import-sort/exports': 'error',
'simple-import-sort/imports': [
'error',
{
groups: [
// React related packages come first.
['^react', '^@?\\w'],
// Internal packages.
['^(@|components)(/.*|$)'],
// Side effect imports.
['^\\u0000'],
// Parent imports. Put `..` last.
['^\\.\\.(?!/?$)', '^\\.\\./?$'],
// Other relative imports. Put same-folder imports and `.` last.
['^\\./(?=.*/)(?!/?$)', '^\\.(?!/?$)', '^\\./?$'],
// Style imports.
['^.+\\.?(css)$'],
],
},
],
},
};