-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbase.js
84 lines (83 loc) · 2.37 KB
/
base.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
const config = {
extends: ['airbnb-base'],
env: {
browser: true,
jest: true,
},
plugins: ['eslint-plugin-import', 'prefer-optional-chaining'],
ignorePatterns: ['!/.*', '/node_modules/.*'],
reportUnusedDisableDirectives: true,
rules: {
'complexity': ['error', { max: 10 }],
'function-paren-newline': 'off',
'import/extensions': 'off',
'import/no-extraneous-dependencies': 'off',
'import/no-unresolved': 'off',
'import/no-useless-path-segments': 'off',
'import/order': [
'error',
{
// Check https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/order.md#options
// for an explaination of these groups
'groups': ['builtin', 'external', 'parent', 'sibling', 'index', 'type'],
'newlines-between': 'always',
'alphabetize': {
order: 'asc',
},
},
],
'import/first': 'off',
'import/prefer-default-export': 'off',
'lines-between-class-members': 'off',
'max-params': ['warn', 4],
'no-void': [
'error',
{
// Compat with @typescript-eslint/no-floating-promises
allowAsStatement: true,
},
],
'no-shadow': ['error'],
'no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
'no-redeclare': ['error'],
'no-debugger': 'warn',
'no-else-return': 'off',
'no-restricted-imports': [
'error',
{
patterns: [
{
group: ['../*'],
message:
'Use absolute paths for importing files from parent directories.',
},
],
},
],
'no-restricted-modules': [
'error',
{
// Seems it’s impossible to set up a message for a pattern
patterns: ['../*'],
},
],
'semi': ['error', 'never'],
'prefer-optional-chaining/prefer-optional-chaining': ['error'],
},
overrides: [
// Empty override to enable linting on other file extensions by default
// See https://github.com/eslint/rfcs/blob/main/designs/2019-additional-lint-targets/
{ files: '*.cjs' },
{
files: '*.mjs',
rules: {
// Allow using relative paths in .mjs files, since they are
// often used natively in the browser where absolute paths will
// not work.
'no-restricted-imports': 'off',
'no-restricted-modules': 'off',
},
},
],
}
module.exports = config