@nice-move/eslint-config-base 0.5.68 → 0.5.72
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/lib/base.cjs +22 -16
- package/lib/import.cjs +6 -15
- package/lib/mini.cjs +15 -3
- package/lib/node.cjs +17 -13
- package/package.json +7 -7
package/lib/base.cjs
CHANGED
|
@@ -13,15 +13,17 @@ module.exports = {
|
|
|
13
13
|
env: {
|
|
14
14
|
browser: true,
|
|
15
15
|
es2021: true,
|
|
16
|
+
es2020: true,
|
|
17
|
+
es2017: true,
|
|
16
18
|
commonjs: false,
|
|
17
19
|
node: false,
|
|
18
20
|
},
|
|
19
21
|
plugins: ['eslint-comments'],
|
|
20
22
|
extends: ['plugin:sonarjs/recommended'],
|
|
21
23
|
rules: {
|
|
22
|
-
'sonarjs/cognitive-complexity':
|
|
23
|
-
'sonarjs/no-duplicate-string':
|
|
24
|
-
'sonarjs/no-identical-functions':
|
|
24
|
+
'sonarjs/cognitive-complexity': 0,
|
|
25
|
+
'sonarjs/no-duplicate-string': 0,
|
|
26
|
+
'sonarjs/no-identical-functions': 0,
|
|
25
27
|
'array-callback-return': [
|
|
26
28
|
'error',
|
|
27
29
|
{
|
|
@@ -29,18 +31,22 @@ module.exports = {
|
|
|
29
31
|
checkForEach: true,
|
|
30
32
|
},
|
|
31
33
|
],
|
|
32
|
-
'no-useless-rename':
|
|
33
|
-
'object-shorthand':
|
|
34
|
-
'arrow-body-style':
|
|
35
|
-
camelcase:
|
|
34
|
+
'no-useless-rename': 0,
|
|
35
|
+
'object-shorthand': 0,
|
|
36
|
+
'arrow-body-style': 0,
|
|
37
|
+
camelcase: 0,
|
|
36
38
|
'class-methods-use-this': 'warn',
|
|
37
39
|
'consistent-return': 'warn',
|
|
38
40
|
'eslint-comments/no-unused-disable': 'warn',
|
|
39
41
|
'eslint-comments/no-unused-enable': 'warn',
|
|
40
|
-
'global-require':
|
|
41
|
-
'
|
|
42
|
-
'
|
|
43
|
-
'no-
|
|
42
|
+
'global-require': 0,
|
|
43
|
+
'no-unreachable-loop': 0,
|
|
44
|
+
'grouped-accessor-pairs': 0,
|
|
45
|
+
'no-constructor-return': 0,
|
|
46
|
+
'lines-between-class-members': 0,
|
|
47
|
+
'max-classes-per-file': 0,
|
|
48
|
+
'no-console': 0,
|
|
49
|
+
'prefer-exponentiation-operator': 0,
|
|
44
50
|
'no-empty': [
|
|
45
51
|
'error',
|
|
46
52
|
{
|
|
@@ -53,7 +59,7 @@ module.exports = {
|
|
|
53
59
|
disallowTemplateShorthand: true,
|
|
54
60
|
},
|
|
55
61
|
],
|
|
56
|
-
'no-nested-ternary':
|
|
62
|
+
'no-nested-ternary': 0,
|
|
57
63
|
'no-param-reassign': [
|
|
58
64
|
'warn',
|
|
59
65
|
{ props: true, ignorePropertyModificationsFor: [] },
|
|
@@ -72,9 +78,9 @@ module.exports = {
|
|
|
72
78
|
selector: 'LabeledStatement',
|
|
73
79
|
},
|
|
74
80
|
],
|
|
75
|
-
'no-template-curly-in-string':
|
|
76
|
-
'no-undef-init':
|
|
77
|
-
'no-underscore-dangle':
|
|
81
|
+
'no-template-curly-in-string': 0,
|
|
82
|
+
'no-undef-init': 0,
|
|
83
|
+
'no-underscore-dangle': 0,
|
|
78
84
|
'no-unused-vars': [
|
|
79
85
|
'error',
|
|
80
86
|
{
|
|
@@ -85,7 +91,7 @@ module.exports = {
|
|
|
85
91
|
],
|
|
86
92
|
'prefer-arrow-callback': 'warn',
|
|
87
93
|
'prefer-template': 'warn',
|
|
88
|
-
'spaced-comment':
|
|
94
|
+
'spaced-comment': 0,
|
|
89
95
|
},
|
|
90
96
|
overrides: [
|
|
91
97
|
{
|
package/lib/import.cjs
CHANGED
|
@@ -2,8 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
const { join } = require('path');
|
|
4
4
|
|
|
5
|
-
const { isReachable } = require('settingz');
|
|
6
|
-
|
|
7
5
|
const { pkgHas, configHas } = require('./utils.cjs');
|
|
8
6
|
|
|
9
7
|
const Vscode = pkgHas(
|
|
@@ -35,22 +33,15 @@ module.exports = {
|
|
|
35
33
|
],
|
|
36
34
|
},
|
|
37
35
|
],
|
|
38
|
-
'import/newline-after-import':
|
|
39
|
-
'import/no-dynamic-require':
|
|
40
|
-
'import/order':
|
|
41
|
-
'import/prefer-default-export':
|
|
36
|
+
'import/newline-after-import': 0,
|
|
37
|
+
'import/no-dynamic-require': 0,
|
|
38
|
+
'import/order': 0,
|
|
39
|
+
'import/prefer-default-export': 0,
|
|
40
|
+
'import/no-relative-packages': 0,
|
|
42
41
|
},
|
|
43
42
|
settings: {
|
|
44
43
|
...Vscode,
|
|
45
|
-
'import/extensions': [
|
|
46
|
-
'.tsx',
|
|
47
|
-
'.ts',
|
|
48
|
-
...(isReachable('vue-eslint-parser/package.json') ? ['.vue'] : []),
|
|
49
|
-
'.jsx',
|
|
50
|
-
'.js',
|
|
51
|
-
'.mjs',
|
|
52
|
-
'.cjs',
|
|
53
|
-
],
|
|
44
|
+
'import/extensions': ['.tsx', '.ts', '.vue', '.jsx', '.js', '.mjs', '.cjs'],
|
|
54
45
|
'import/parsers': {
|
|
55
46
|
'@typescript-eslint/parser': ['.ts', '.tsx'],
|
|
56
47
|
'vue-eslint-parser': ['.vue'],
|
package/lib/mini.cjs
CHANGED
|
@@ -95,16 +95,28 @@ function generate({ miniprogramRoot, pluginRoot, cloudfunctionRoot }) {
|
|
|
95
95
|
files: excludedFiles,
|
|
96
96
|
env: {
|
|
97
97
|
browser: false,
|
|
98
|
+
es2021: false,
|
|
99
|
+
es2020: false,
|
|
100
|
+
es2017: false,
|
|
101
|
+
es6: false,
|
|
102
|
+
},
|
|
103
|
+
parserOptions: {
|
|
104
|
+
ecmaVersion: 5,
|
|
105
|
+
sourceType: 'script',
|
|
98
106
|
},
|
|
99
107
|
globals: {
|
|
100
108
|
require: 'readonly',
|
|
101
109
|
module: 'readonly',
|
|
102
110
|
},
|
|
103
111
|
rules: {
|
|
104
|
-
'no-
|
|
112
|
+
'import/no-commonjs': 0,
|
|
113
|
+
'no-var': 0,
|
|
105
114
|
'object-shorthand': ['error', 'never'],
|
|
106
|
-
'
|
|
107
|
-
'
|
|
115
|
+
'prefer-spread': 0,
|
|
116
|
+
'prefer-template': 0,
|
|
117
|
+
'unicorn/prefer-includes': 0,
|
|
118
|
+
'unicorn/prefer-export-from': 0,
|
|
119
|
+
'unicorn/prefer-module': 0,
|
|
108
120
|
},
|
|
109
121
|
},
|
|
110
122
|
].filter(Boolean);
|
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/*'],
|
|
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/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.72",
|
|
4
4
|
"description": "A `eslint` config for best practice",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": {
|
|
@@ -34,19 +34,19 @@
|
|
|
34
34
|
},
|
|
35
35
|
"main": "index.cjs",
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@typescript-eslint/eslint-plugin": "^5.
|
|
38
|
-
"@typescript-eslint/parser": "^5.
|
|
39
|
-
"eslint-config-airbnb-base": "^
|
|
37
|
+
"@typescript-eslint/eslint-plugin": "^5.4.0",
|
|
38
|
+
"@typescript-eslint/parser": "^5.4.0",
|
|
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.3",
|
|
44
44
|
"eslint-plugin-markdown": "^2.2.1",
|
|
45
45
|
"eslint-plugin-node": "^11.1.0",
|
|
46
46
|
"eslint-plugin-promise": "^5.1.1",
|
|
47
47
|
"eslint-plugin-sonarjs": "^0.10.0",
|
|
48
|
-
"eslint-plugin-unicorn": "^
|
|
49
|
-
"espree": "9.
|
|
48
|
+
"eslint-plugin-unicorn": "^39.0.0",
|
|
49
|
+
"espree": "9.1.0",
|
|
50
50
|
"settingz": "^0.1.0"
|
|
51
51
|
},
|
|
52
52
|
"peerDependencies": {
|