-
Notifications
You must be signed in to change notification settings - Fork 47
Expand file tree
/
Copy patheslint.config.js
More file actions
99 lines (98 loc) · 2.34 KB
/
eslint.config.js
File metadata and controls
99 lines (98 loc) · 2.34 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
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
import importPlugin from 'eslint-plugin-import';
import sonarjsPlugin from 'eslint-plugin-sonarjs';
import prettierConfig from 'eslint-config-prettier/flat';
import globals from 'globals';
import js from '@eslint/js';
export default [
js.configs.recommended,
importPlugin.flatConfigs.recommended,
sonarjsPlugin.configs.recommended,
prettierConfig,
{
// default config
files: ['src/**/*', 'test/**/*'],
languageOptions: {
globals: {
...globals['shared-node-browser'],
},
ecmaVersion: 2022,
sourceType: 'module',
},
rules: {
'default-param-last': 'off',
'new-cap': 'off',
'no-console': 'error',
'no-unused-vars': ['error', { ignoreRestSiblings: true }],
'no-underscore-dangle': [
'error',
{
allow: [
'_args',
'_data',
'_ethersType',
'_eventName',
'_execs',
'_hex',
'_name',
'_options',
'_signTypedData',
'_subscribe',
'_chainId',
'_contracts',
'_bridgedContracts',
'_chainConfDefaults',
'_bridgedConf',
],
},
],
'no-template-curly-in-string': 'off',
'max-classes-per-file': 'off',
'max-len': 'off',
'import/prefer-default-export': 'off',
'import/extensions': ['error', 'ignorePackages'],
'sonarjs/cognitive-complexity': ['warn', 15],
'sonarjs/no-duplicate-string': 'off',
'sonarjs/no-nested-functions': 'warn', // todo refactor to enforce error on this rule
'sonarjs/todo-tag': 'warn',
},
},
{
// cli specific files using nodejs globals
files: ['src/cli/**/*'],
languageOptions: {
globals: {
...globals.node,
},
},
},
{
files: ['src/cli/utils/cli-helper.js', 'src/lib/IExecConfig.js'],
rules: {
'no-console': 'off',
},
},
{
// test specific files using jest globals
files: ['test/**/*'],
languageOptions: {
globals: {
...globals.jest,
...globals.node,
},
},
rules: {
'no-console': 'off',
'no-await-in-loop': 'off',
},
},
{
files: ['*.cjs'],
languageOptions: {
globals: {
...globals.node,
},
ecmaVersion: 2022,
sourceType: 'script',
},
},
];