-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.cjs
82 lines (75 loc) · 2.1 KB
/
.eslintrc.cjs
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
module.exports = {
root: true,
env: {
browser: true,
es2021: true,
node: true,
jquery: true,
},
extends: ['airbnb'],
plugins: ['prettier', 'unicorn'],
parser: '@babel/eslint-parser',
parserOptions: {
ecmaVersion: 'latest',
sourceTyp: 'module',
},
rules: {
// Only allow debugger in development mode
'no-debugger': process.argv.includes('--production') ? 'error' : 'off',
// Only allow `console.log` in development mode
'no-console': process.argv.includes('--production')
? ['error', { allow: ['warn', 'error'] }]
: 'off',
// https://eslint.org/docs/rules/multiline-comment-style
'multiline-comment-style': 'off',
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/master/docs/rules/no-null.md
'unicorn/no-null': 'off',
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/master/docs/rules/filename-case.md
'unicorn/filename-case': [
'error',
{
cases: {
camelCase: true,
pascalCase: true,
kebabCase: true,
},
},
],
/**
* using only single quotes
* @see https://eslint.org/docs/latest/rules/quotes
*/
quotes: [
'error',
'single',
{
avoidEscape: true,
},
],
'jsx-quotes': 'off',
'no-restricted-syntax': 'off',
'no-param-reassign': 'off',
'no-plusplus': 'off',
'no-use-before-define': 'off',
'no-else-return': 'off',
'no-lonely-if': 'off',
'default-case': 'off',
'no-unused-vars': 'warn',
'comma-dangle': 'warn',
'operator-linebreak': 'off',
'no-multi-assign': 'off',
'prefer-const': 'off',
'implicit-arrow-linebreak': 'off',
// https://eslint.org/docs/latest/rules/max-len
'max-len': ['warn', 150],
// Conflict with unicorn/prefer-spread
'array-func/prefer-array-from': 'off',
'import/order': 'off',
'import/first': 'off',
'import/prefer-default-export': 'off',
'import/extensions': 'off',
'import/no-unresolved': 'off',
'import/no-self-import': 'off',
'import/no-extraneous-dependencies': 'off',
},
};