@nice-move/eslint-config-base 0.5.76 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.cjs +1 -1
- package/lib/base.cjs +42 -33
- package/lib/bundler.cjs +2 -14
- package/lib/import.cjs +1 -2
- package/lib/jsx-parser.cjs +1 -0
- package/lib/mini.cjs +0 -1
- package/lib/node.cjs +21 -20
- package/lib/utils.cjs +2 -0
- package/package.json +10 -10
package/index.cjs
CHANGED
|
@@ -4,7 +4,6 @@ const {
|
|
|
4
4
|
configHas,
|
|
5
5
|
matches: { sourceAndPackages },
|
|
6
6
|
} = require('./lib/utils.cjs');
|
|
7
|
-
|
|
8
7
|
const { readJson, getPkg } = require('settingz');
|
|
9
8
|
|
|
10
9
|
function ignoreList() {
|
|
@@ -17,6 +16,7 @@ function BestShot() {
|
|
|
17
16
|
const { git = [], eslint = git } = readJson(
|
|
18
17
|
'@best-shot/cli/config/ignore.json',
|
|
19
18
|
);
|
|
19
|
+
|
|
20
20
|
return eslint;
|
|
21
21
|
}
|
|
22
22
|
|
package/lib/base.cjs
CHANGED
|
@@ -1,29 +1,36 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
module.exports = {
|
|
4
|
+
env: {
|
|
5
|
+
browser: true,
|
|
6
|
+
commonjs: false,
|
|
7
|
+
es2017: true,
|
|
8
|
+
es2020: true,
|
|
9
|
+
es2021: true,
|
|
10
|
+
node: false,
|
|
11
|
+
},
|
|
12
|
+
extends: ['plugin:sonarjs/recommended'],
|
|
13
|
+
overrides: [
|
|
14
|
+
{
|
|
15
|
+
files: ['*.jsx', '*.tsx'],
|
|
16
|
+
parserOptions: {
|
|
17
|
+
ecmaFeatures: {
|
|
18
|
+
jsx: true,
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
],
|
|
4
23
|
parserOptions: {
|
|
5
|
-
ecmaVersion: 'latest',
|
|
6
|
-
sourceType: 'module',
|
|
7
24
|
ecmaFeatures: {
|
|
8
|
-
impliedStrict: true,
|
|
9
25
|
globalReturn: false,
|
|
26
|
+
impliedStrict: true,
|
|
10
27
|
jsx: false,
|
|
11
28
|
},
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
browser: true,
|
|
15
|
-
es2021: true,
|
|
16
|
-
es2020: true,
|
|
17
|
-
es2017: true,
|
|
18
|
-
commonjs: false,
|
|
19
|
-
node: false,
|
|
29
|
+
ecmaVersion: 'latest',
|
|
30
|
+
sourceType: 'module',
|
|
20
31
|
},
|
|
21
32
|
plugins: ['eslint-comments'],
|
|
22
|
-
extends: ['plugin:sonarjs/recommended'],
|
|
23
33
|
rules: {
|
|
24
|
-
'sonarjs/cognitive-complexity': 0,
|
|
25
|
-
'sonarjs/no-duplicate-string': 0,
|
|
26
|
-
'sonarjs/no-identical-functions': 0,
|
|
27
34
|
'array-callback-return': [
|
|
28
35
|
'error',
|
|
29
36
|
{
|
|
@@ -31,8 +38,6 @@ module.exports = {
|
|
|
31
38
|
checkForEach: true,
|
|
32
39
|
},
|
|
33
40
|
],
|
|
34
|
-
'no-useless-rename': 0,
|
|
35
|
-
'object-shorthand': 0,
|
|
36
41
|
'arrow-body-style': 0,
|
|
37
42
|
camelcase: 0,
|
|
38
43
|
'class-methods-use-this': 'warn',
|
|
@@ -40,13 +45,12 @@ module.exports = {
|
|
|
40
45
|
'eslint-comments/no-unused-disable': 'warn',
|
|
41
46
|
'eslint-comments/no-unused-enable': 'warn',
|
|
42
47
|
'global-require': 0,
|
|
43
|
-
'no-unreachable-loop': 0,
|
|
44
48
|
'grouped-accessor-pairs': 0,
|
|
45
|
-
'no-constructor-return': 0,
|
|
46
49
|
'lines-between-class-members': 0,
|
|
47
50
|
'max-classes-per-file': 0,
|
|
51
|
+
'no-await-in-loop': 0,
|
|
48
52
|
'no-console': 0,
|
|
49
|
-
'
|
|
53
|
+
'no-constructor-return': 0,
|
|
50
54
|
'no-empty': [
|
|
51
55
|
'error',
|
|
52
56
|
{
|
|
@@ -62,10 +66,11 @@ module.exports = {
|
|
|
62
66
|
'no-nested-ternary': 0,
|
|
63
67
|
'no-param-reassign': [
|
|
64
68
|
'warn',
|
|
65
|
-
{
|
|
69
|
+
{
|
|
70
|
+
ignorePropertyModificationsFor: [],
|
|
71
|
+
props: true,
|
|
72
|
+
},
|
|
66
73
|
],
|
|
67
|
-
'no-await-in-loop': 0,
|
|
68
|
-
'no-unused-expressions': ['error', { allowTaggedTemplates: true }],
|
|
69
74
|
'no-restricted-syntax': [
|
|
70
75
|
'error',
|
|
71
76
|
{
|
|
@@ -79,9 +84,17 @@ module.exports = {
|
|
|
79
84
|
selector: 'LabeledStatement',
|
|
80
85
|
},
|
|
81
86
|
],
|
|
87
|
+
'no-plusplus': 0,
|
|
82
88
|
'no-template-curly-in-string': 0,
|
|
83
89
|
'no-undef-init': 0,
|
|
84
90
|
'no-underscore-dangle': 0,
|
|
91
|
+
'no-unreachable-loop': 0,
|
|
92
|
+
'no-unused-expressions': [
|
|
93
|
+
'error',
|
|
94
|
+
{
|
|
95
|
+
allowTaggedTemplates: true,
|
|
96
|
+
},
|
|
97
|
+
],
|
|
85
98
|
'no-unused-vars': [
|
|
86
99
|
'error',
|
|
87
100
|
{
|
|
@@ -90,18 +103,14 @@ module.exports = {
|
|
|
90
103
|
varsIgnorePattern: '^_+$',
|
|
91
104
|
},
|
|
92
105
|
],
|
|
106
|
+
'no-useless-rename': 0,
|
|
107
|
+
'object-shorthand': 0,
|
|
93
108
|
'prefer-arrow-callback': 'warn',
|
|
109
|
+
'prefer-exponentiation-operator': 0,
|
|
94
110
|
'prefer-template': 'warn',
|
|
111
|
+
'sonarjs/cognitive-complexity': 0,
|
|
112
|
+
'sonarjs/no-duplicate-string': 0,
|
|
113
|
+
'sonarjs/no-identical-functions': 0,
|
|
95
114
|
'spaced-comment': 0,
|
|
96
115
|
},
|
|
97
|
-
overrides: [
|
|
98
|
-
{
|
|
99
|
-
files: ['*.jsx', '*.tsx'],
|
|
100
|
-
parserOptions: {
|
|
101
|
-
ecmaFeatures: {
|
|
102
|
-
jsx: true,
|
|
103
|
-
},
|
|
104
|
-
},
|
|
105
|
-
},
|
|
106
|
-
],
|
|
107
116
|
};
|
package/lib/bundler.cjs
CHANGED
|
@@ -3,19 +3,7 @@
|
|
|
3
3
|
const {
|
|
4
4
|
matches: { source, sourceAndPackages },
|
|
5
5
|
} = require('./utils.cjs');
|
|
6
|
-
|
|
7
|
-
const { reaching, isReachable } = require('settingz');
|
|
8
|
-
|
|
9
|
-
function BestShot() {
|
|
10
|
-
return isReachable('@best-shot/preset-env/package.json')
|
|
11
|
-
? [
|
|
12
|
-
{
|
|
13
|
-
files: sourceAndPackages,
|
|
14
|
-
...reaching('@best-shot/preset-env/eslint.cjs'),
|
|
15
|
-
},
|
|
16
|
-
]
|
|
17
|
-
: [];
|
|
18
|
-
}
|
|
6
|
+
const { isReachable } = require('settingz');
|
|
19
7
|
|
|
20
8
|
function webpack() {
|
|
21
9
|
return isReachable('webpack/package.json')
|
|
@@ -54,5 +42,5 @@ function webpack() {
|
|
|
54
42
|
}
|
|
55
43
|
|
|
56
44
|
module.exports = {
|
|
57
|
-
overrides:
|
|
45
|
+
overrides: webpack(),
|
|
58
46
|
};
|
package/lib/import.cjs
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const { join } = require('path');
|
|
4
|
-
|
|
5
4
|
const { pkgHas, configHas } = require('./utils.cjs');
|
|
6
5
|
|
|
7
6
|
const Vscode = pkgHas(
|
|
@@ -29,7 +28,7 @@ module.exports = {
|
|
|
29
28
|
'**/.*rc.{m,c,}{t,j}s',
|
|
30
29
|
'**/*.config.{m,c,}{t,j}s',
|
|
31
30
|
'**/config.{m,c,}{t,j}s',
|
|
32
|
-
'
|
|
31
|
+
'**/.best-shot/**',
|
|
33
32
|
],
|
|
34
33
|
},
|
|
35
34
|
],
|
package/lib/jsx-parser.cjs
CHANGED
package/lib/mini.cjs
CHANGED
package/lib/node.cjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
module.exports = {
|
|
4
|
-
plugins: ['
|
|
4
|
+
plugins: ['n'],
|
|
5
5
|
rules: {
|
|
6
|
-
'
|
|
7
|
-
'
|
|
8
|
-
'
|
|
6
|
+
'n/shebang': 'error',
|
|
7
|
+
'n/no-process-env': 'error',
|
|
8
|
+
'n/no-path-concat': 'error',
|
|
9
9
|
},
|
|
10
10
|
overrides: [
|
|
11
11
|
{
|
|
@@ -16,24 +16,25 @@ module.exports = {
|
|
|
16
16
|
commonjs: true,
|
|
17
17
|
},
|
|
18
18
|
rules: {
|
|
19
|
-
'
|
|
20
|
-
'
|
|
21
|
-
'
|
|
22
|
-
'
|
|
23
|
-
'
|
|
24
|
-
'
|
|
25
|
-
'
|
|
26
|
-
'
|
|
27
|
-
'
|
|
28
|
-
'
|
|
29
|
-
'
|
|
19
|
+
'n/no-deprecated-api': 'error',
|
|
20
|
+
'n/no-process-env': 'off',
|
|
21
|
+
'n/no-process-exit': 'warn',
|
|
22
|
+
'n/no-unsupported-features/es-builtins': 'error',
|
|
23
|
+
'n/no-unsupported-features/es-syntax': 'error',
|
|
24
|
+
'n/no-unsupported-features/node-builtins': 'error',
|
|
25
|
+
'n/prefer-global/buffer': 'warn',
|
|
26
|
+
'n/prefer-global/console': 'warn',
|
|
27
|
+
'n/prefer-global/process': 'warn',
|
|
28
|
+
'n/prefer-global/url-search-params': 'warn',
|
|
29
|
+
'n/prefer-global/url': 'warn',
|
|
30
|
+
'n/process-exit-as-throw': 'error',
|
|
30
31
|
},
|
|
31
32
|
},
|
|
32
33
|
{
|
|
33
34
|
files: '*.*',
|
|
34
35
|
excludedFiles: ['**/*.md/*', '*.cjs', '*.md'],
|
|
35
36
|
rules: {
|
|
36
|
-
'
|
|
37
|
+
'n/file-extension-in-import': 'error',
|
|
37
38
|
},
|
|
38
39
|
settings: {
|
|
39
40
|
node: {
|
|
@@ -60,7 +61,7 @@ module.exports = {
|
|
|
60
61
|
},
|
|
61
62
|
},
|
|
62
63
|
rules: {
|
|
63
|
-
'
|
|
64
|
+
'n/no-unsupported-features/es-syntax': [
|
|
64
65
|
'error',
|
|
65
66
|
{ ignores: ['modules', 'dynamicImport'] },
|
|
66
67
|
],
|
|
@@ -76,9 +77,9 @@ module.exports = {
|
|
|
76
77
|
},
|
|
77
78
|
rules: {
|
|
78
79
|
strict: ['error', 'global'],
|
|
79
|
-
'
|
|
80
|
-
'
|
|
81
|
-
'
|
|
80
|
+
'n/no-exports-assign': 'error',
|
|
81
|
+
'n/no-new-require': 'error',
|
|
82
|
+
'n/no-unsupported-features/es-syntax': [
|
|
82
83
|
'error',
|
|
83
84
|
{ ignores: ['dynamicImport'] },
|
|
84
85
|
],
|
package/lib/utils.cjs
CHANGED
|
@@ -7,6 +7,7 @@ function pkgHas(checker, getResult) {
|
|
|
7
7
|
const pkg = getPkg();
|
|
8
8
|
|
|
9
9
|
const io = checker(pkg);
|
|
10
|
+
|
|
10
11
|
if (io) {
|
|
11
12
|
return getResult(io, pkg);
|
|
12
13
|
}
|
|
@@ -17,6 +18,7 @@ function configHas(checker, getResult) {
|
|
|
17
18
|
const pkg = getPkg('nice-move');
|
|
18
19
|
|
|
19
20
|
const io = checker(pkg);
|
|
21
|
+
|
|
20
22
|
if (io) {
|
|
21
23
|
return getResult(io, pkg);
|
|
22
24
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nice-move/eslint-config-base",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"description": "A `eslint` config for best practice",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": {
|
|
@@ -34,23 +34,23 @@
|
|
|
34
34
|
},
|
|
35
35
|
"main": "index.cjs",
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@typescript-eslint/eslint-plugin": "^5.
|
|
38
|
-
"@typescript-eslint/parser": "^5.
|
|
37
|
+
"@typescript-eslint/eslint-plugin": "^5.9.0",
|
|
38
|
+
"@typescript-eslint/parser": "^5.9.0",
|
|
39
39
|
"eslint-config-airbnb-base": "^15.0.0",
|
|
40
40
|
"eslint-config-prettier": "^8.3.0",
|
|
41
41
|
"eslint-plugin-eslint-comments": "^3.2.0",
|
|
42
42
|
"eslint-plugin-html": "^6.2.0",
|
|
43
|
-
"eslint-plugin-import": "^2.25.
|
|
43
|
+
"eslint-plugin-import": "^2.25.4",
|
|
44
44
|
"eslint-plugin-markdown": "^2.2.1",
|
|
45
|
-
"eslint-plugin-
|
|
46
|
-
"eslint-plugin-promise": "^
|
|
45
|
+
"eslint-plugin-n": "^14.0.0",
|
|
46
|
+
"eslint-plugin-promise": "^6.0.0",
|
|
47
47
|
"eslint-plugin-sonarjs": "^0.11.0",
|
|
48
|
-
"eslint-plugin-unicorn": "^
|
|
49
|
-
"espree": "9.
|
|
50
|
-
"settingz": "^0.1.
|
|
48
|
+
"eslint-plugin-unicorn": "^40.0.0",
|
|
49
|
+
"espree": "^9.3.0",
|
|
50
|
+
"settingz": "^0.1.4"
|
|
51
51
|
},
|
|
52
52
|
"peerDependencies": {
|
|
53
|
-
"eslint": "^
|
|
53
|
+
"eslint": "^8.6.0"
|
|
54
54
|
},
|
|
55
55
|
"engines": {
|
|
56
56
|
"node": "^12.22.0 || ^14.17.0 || >=16.13.0"
|