@nice-move/eslint-config-base 0.5.70 → 0.5.74
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 +13 -10
- package/lib/mini.cjs +2 -0
- package/lib/node.cjs +17 -13
- package/lib/unicorn.cjs +0 -1
- package/package.json +7 -7
package/index.cjs
CHANGED
|
@@ -5,17 +5,19 @@ const {
|
|
|
5
5
|
matches: { sourceAndPackages },
|
|
6
6
|
} = require('./lib/utils.cjs');
|
|
7
7
|
|
|
8
|
+
const { readJson, getPkg } = require('settingz');
|
|
9
|
+
|
|
10
|
+
function ignoreList() {
|
|
11
|
+
const { ignore: { all = [], eslint = [] } = {} } = getPkg('nice-move');
|
|
12
|
+
|
|
13
|
+
return [...all, ...eslint];
|
|
14
|
+
}
|
|
15
|
+
|
|
8
16
|
function BestShot() {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
// eslint-disable-next-line import/no-unresolved
|
|
14
|
-
} = require('@best-shot/cli/config/ignore.json');
|
|
15
|
-
return eslint;
|
|
16
|
-
} catch {
|
|
17
|
-
return [];
|
|
18
|
-
}
|
|
17
|
+
const { git = [], eslint = git } = readJson(
|
|
18
|
+
'@best-shot/cli/config/ignore.json',
|
|
19
|
+
);
|
|
20
|
+
return eslint;
|
|
19
21
|
}
|
|
20
22
|
|
|
21
23
|
module.exports = {
|
|
@@ -59,5 +61,6 @@ module.exports = {
|
|
|
59
61
|
'**/miniprogram_npm/**',
|
|
60
62
|
'node_modules/',
|
|
61
63
|
...BestShot(),
|
|
64
|
+
...ignoreList(),
|
|
62
65
|
],
|
|
63
66
|
};
|
package/lib/mini.cjs
CHANGED
|
@@ -102,6 +102,7 @@ function generate({ miniprogramRoot, pluginRoot, cloudfunctionRoot }) {
|
|
|
102
102
|
},
|
|
103
103
|
parserOptions: {
|
|
104
104
|
ecmaVersion: 5,
|
|
105
|
+
sourceType: 'script',
|
|
105
106
|
},
|
|
106
107
|
globals: {
|
|
107
108
|
require: 'readonly',
|
|
@@ -114,6 +115,7 @@ function generate({ miniprogramRoot, pluginRoot, cloudfunctionRoot }) {
|
|
|
114
115
|
'prefer-spread': 0,
|
|
115
116
|
'prefer-template': 0,
|
|
116
117
|
'unicorn/prefer-includes': 0,
|
|
118
|
+
'unicorn/prefer-export-from': 0,
|
|
117
119
|
'unicorn/prefer-module': 0,
|
|
118
120
|
},
|
|
119
121
|
},
|
package/lib/node.cjs
CHANGED
|
@@ -29,6 +29,18 @@ module.exports = {
|
|
|
29
29
|
'node/process-exit-as-throw': 'error',
|
|
30
30
|
},
|
|
31
31
|
},
|
|
32
|
+
{
|
|
33
|
+
files: '*.*',
|
|
34
|
+
excludedFiles: ['**/*.md/*', '*.cjs', '*.md'],
|
|
35
|
+
rules: {
|
|
36
|
+
'node/file-extension-in-import': 'error',
|
|
37
|
+
},
|
|
38
|
+
settings: {
|
|
39
|
+
node: {
|
|
40
|
+
tryExtensions: ['.vue', '.tsx', '.jsx', '.ts', '.js'],
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
},
|
|
32
44
|
{
|
|
33
45
|
// for node.js
|
|
34
46
|
files: '*.mjs',
|
|
@@ -44,7 +56,7 @@ module.exports = {
|
|
|
44
56
|
},
|
|
45
57
|
settings: {
|
|
46
58
|
node: {
|
|
47
|
-
tryExtensions: ['.mjs', '.cjs', '.js'],
|
|
59
|
+
tryExtensions: ['.mjs', '.cjs', '.js', '.ts'],
|
|
48
60
|
},
|
|
49
61
|
},
|
|
50
62
|
rules: {
|
|
@@ -66,18 +78,10 @@ module.exports = {
|
|
|
66
78
|
strict: ['error', 'global'],
|
|
67
79
|
'node/no-exports-assign': 'error',
|
|
68
80
|
'node/no-new-require': 'error',
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
excludedFiles: ['**/*.md/*', '*.mjs', '*.cjs', '*.md'],
|
|
74
|
-
rules: {
|
|
75
|
-
'node/file-extension-in-import': 'error',
|
|
76
|
-
},
|
|
77
|
-
settings: {
|
|
78
|
-
node: {
|
|
79
|
-
tryExtensions: ['.vue', '.tsx', '.jsx', '.ts', '.js'],
|
|
80
|
-
},
|
|
81
|
+
'node/no-unsupported-features/es-syntax': [
|
|
82
|
+
'error',
|
|
83
|
+
{ ignores: ['dynamicImport'] },
|
|
84
|
+
],
|
|
81
85
|
},
|
|
82
86
|
},
|
|
83
87
|
],
|
package/lib/unicorn.cjs
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nice-move/eslint-config-base",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.74",
|
|
4
4
|
"description": "A `eslint` config for best practice",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": {
|
|
@@ -34,8 +34,8 @@
|
|
|
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.5.0",
|
|
38
|
+
"@typescript-eslint/parser": "^5.5.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",
|
|
@@ -43,11 +43,11 @@
|
|
|
43
43
|
"eslint-plugin-import": "^2.25.3",
|
|
44
44
|
"eslint-plugin-markdown": "^2.2.1",
|
|
45
45
|
"eslint-plugin-node": "^11.1.0",
|
|
46
|
-
"eslint-plugin-promise": "^5.
|
|
47
|
-
"eslint-plugin-sonarjs": "^0.
|
|
46
|
+
"eslint-plugin-promise": "^5.2.0",
|
|
47
|
+
"eslint-plugin-sonarjs": "^0.11.0",
|
|
48
48
|
"eslint-plugin-unicorn": "^39.0.0",
|
|
49
|
-
"espree": "9.
|
|
50
|
-
"settingz": "^0.1.
|
|
49
|
+
"espree": "9.2.0",
|
|
50
|
+
"settingz": "^0.1.2"
|
|
51
51
|
},
|
|
52
52
|
"peerDependencies": {
|
|
53
53
|
"eslint": "^7.32.0"
|