@umijs/lint 4.0.5 → 4.0.8
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/dist/config/eslint/index.d.ts +0 -0
- package/dist/config/eslint/index.js +56 -64
- package/dist/config/eslint/legacy.d.ts +0 -0
- package/dist/config/eslint/legacy.js +45 -53
- package/dist/config/eslint/rules/fabric.d.ts +4 -4
- package/dist/config/eslint/rules/fabric.js +101 -88
- package/dist/config/eslint/rules/recommended.d.ts +4 -4
- package/dist/config/eslint/rules/recommended.js +113 -108
- package/dist/config/eslint/setup.d.ts +0 -0
- package/dist/config/eslint/setup.js +2 -3
- package/dist/config/stylelint/index.d.ts +0 -0
- package/dist/config/stylelint/index.js +49 -32
- package/dist/index.d.ts +0 -0
- package/dist/index.js +68 -27
- package/dist/linter/base.d.ts +0 -0
- package/dist/linter/base.js +56 -54
- package/dist/linter/eslint.d.ts +0 -0
- package/dist/linter/eslint.js +42 -22
- package/dist/linter/index.d.ts +0 -0
- package/dist/linter/index.js +34 -9
- package/dist/linter/stylelint.d.ts +0 -0
- package/dist/linter/stylelint.js +45 -25
- package/dist/types.d.ts +1 -0
- package/dist/types.js +17 -2
- package/package.json +4 -4
|
File without changes
|
|
@@ -1,70 +1,62 @@
|
|
|
1
|
-
|
|
2
|
-
var
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __copyProps = (to, from, except, desc) => {
|
|
8
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
9
|
+
for (let key of __getOwnPropNames(from))
|
|
10
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
11
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
12
|
+
}
|
|
13
|
+
return to;
|
|
24
14
|
};
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
15
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
|
|
16
|
+
|
|
17
|
+
// index.ts
|
|
18
|
+
var import_recommended = __toESM(require("./rules/recommended"));
|
|
19
|
+
var import_setup = require("./setup");
|
|
28
20
|
module.exports = {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
21
|
+
parser: require.resolve("@babel/eslint-parser"),
|
|
22
|
+
plugins: ["react", "react-hooks"],
|
|
23
|
+
settings: {
|
|
24
|
+
react: {
|
|
25
|
+
version: "detect"
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
env: {
|
|
29
|
+
browser: true,
|
|
30
|
+
node: true,
|
|
31
|
+
es2022: true,
|
|
32
|
+
jest: true
|
|
33
|
+
},
|
|
34
|
+
rules: import_recommended.default,
|
|
35
|
+
overrides: [
|
|
36
|
+
{
|
|
37
|
+
parser: require.resolve("@typescript-eslint/parser"),
|
|
38
|
+
plugins: ["@typescript-eslint/eslint-plugin"],
|
|
39
|
+
files: ["**/*.{ts,tsx}"],
|
|
40
|
+
rules: import_recommended.typescript
|
|
35
41
|
},
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
42
|
+
{
|
|
43
|
+
settings: {
|
|
44
|
+
jest: {
|
|
45
|
+
version: 26
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
files: ["**/*.{test,spec,unit,e2e}.{ts,tsx,js,jsx}"],
|
|
49
|
+
plugins: ["jest"],
|
|
50
|
+
rules: import_recommended.jest
|
|
51
|
+
}
|
|
52
|
+
],
|
|
53
|
+
parserOptions: {
|
|
54
|
+
ecmaFeatures: {
|
|
55
|
+
jsx: true
|
|
41
56
|
},
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
{
|
|
45
|
-
parser: require.resolve('@typescript-eslint/parser'),
|
|
46
|
-
plugins: ['@typescript-eslint/eslint-plugin'],
|
|
47
|
-
files: ['**/*.{ts,tsx}'],
|
|
48
|
-
rules: recommended_1.typescript,
|
|
49
|
-
},
|
|
50
|
-
{
|
|
51
|
-
settings: {
|
|
52
|
-
jest: {
|
|
53
|
-
version: 26,
|
|
54
|
-
},
|
|
55
|
-
},
|
|
56
|
-
files: ['**/*.{test,spec,unit,e2e}.{ts,tsx,js,jsx}'],
|
|
57
|
-
plugins: ['jest'],
|
|
58
|
-
rules: recommended_1.jest,
|
|
59
|
-
},
|
|
60
|
-
],
|
|
61
|
-
parserOptions: {
|
|
62
|
-
ecmaFeatures: {
|
|
63
|
-
jsx: true,
|
|
64
|
-
},
|
|
65
|
-
babelOptions: {
|
|
66
|
-
presets: [require.resolve('@umijs/babel-preset-umi')],
|
|
67
|
-
},
|
|
68
|
-
requireConfigFile: false,
|
|
57
|
+
babelOptions: {
|
|
58
|
+
presets: [require.resolve("@umijs/babel-preset-umi")]
|
|
69
59
|
},
|
|
60
|
+
requireConfigFile: false
|
|
61
|
+
}
|
|
70
62
|
};
|
|
File without changes
|
|
@@ -1,58 +1,50 @@
|
|
|
1
|
-
|
|
2
|
-
var
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __copyProps = (to, from, except, desc) => {
|
|
8
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
9
|
+
for (let key of __getOwnPropNames(from))
|
|
10
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
11
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
12
|
+
}
|
|
13
|
+
return to;
|
|
24
14
|
};
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
15
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
|
|
16
|
+
|
|
17
|
+
// legacy.ts
|
|
18
|
+
var import_fabric = __toESM(require("./rules/fabric"));
|
|
19
|
+
var import_setup = require("./setup");
|
|
28
20
|
module.exports = {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
21
|
+
extends: ["prettier", "plugin:react/recommended"],
|
|
22
|
+
parser: require.resolve("@babel/eslint-parser"),
|
|
23
|
+
plugins: ["react", "react-hooks"],
|
|
24
|
+
env: {
|
|
25
|
+
browser: true,
|
|
26
|
+
node: true,
|
|
27
|
+
es6: true,
|
|
28
|
+
mocha: true,
|
|
29
|
+
jest: true,
|
|
30
|
+
jasmine: true
|
|
31
|
+
},
|
|
32
|
+
rules: import_fabric.default,
|
|
33
|
+
overrides: [
|
|
34
|
+
{
|
|
35
|
+
files: ["**/*.{ts,tsx}"],
|
|
36
|
+
parser: require.resolve("@typescript-eslint/parser"),
|
|
37
|
+
rules: import_fabric.typescript,
|
|
38
|
+
extends: ["prettier", "plugin:@typescript-eslint/recommended"]
|
|
39
|
+
}
|
|
40
|
+
],
|
|
41
|
+
parserOptions: {
|
|
42
|
+
ecmaFeatures: {
|
|
43
|
+
jsx: true
|
|
39
44
|
},
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
{
|
|
43
|
-
files: ['**/*.{ts,tsx}'],
|
|
44
|
-
parser: require.resolve('@typescript-eslint/parser'),
|
|
45
|
-
rules: fabric_1.typescript,
|
|
46
|
-
extends: ['prettier', 'plugin:@typescript-eslint/recommended'],
|
|
47
|
-
},
|
|
48
|
-
],
|
|
49
|
-
parserOptions: {
|
|
50
|
-
ecmaFeatures: {
|
|
51
|
-
jsx: true,
|
|
52
|
-
},
|
|
53
|
-
babelOptions: {
|
|
54
|
-
presets: [require.resolve('@umijs/babel-preset-umi')],
|
|
55
|
-
},
|
|
56
|
-
requireConfigFile: false,
|
|
45
|
+
babelOptions: {
|
|
46
|
+
presets: [require.resolve("@umijs/babel-preset-umi")]
|
|
57
47
|
},
|
|
48
|
+
requireConfigFile: false
|
|
49
|
+
}
|
|
58
50
|
};
|
|
@@ -67,10 +67,6 @@ export declare const typescript: {
|
|
|
67
67
|
'@typescript-eslint/unbound-method': number;
|
|
68
68
|
'@typescript-eslint/unified-signatures': number;
|
|
69
69
|
};
|
|
70
|
-
/**
|
|
71
|
-
* legay enabled/disabled rules from @umijs/fabric
|
|
72
|
-
* @see https://github.com/umijs/fabric/blob/master/src/eslint.ts#L54
|
|
73
|
-
*/
|
|
74
70
|
declare const _default: {
|
|
75
71
|
'no-param-reassign': number;
|
|
76
72
|
'no-prototype-builtins': number;
|
|
@@ -83,4 +79,8 @@ declare const _default: {
|
|
|
83
79
|
'react-hooks/exhaustive-deps': number;
|
|
84
80
|
'react-hooks/rules-of-hooks': number;
|
|
85
81
|
};
|
|
82
|
+
/**
|
|
83
|
+
* legay enabled/disabled rules from @umijs/fabric
|
|
84
|
+
* @see https://github.com/umijs/fabric/blob/master/src/eslint.ts#L54
|
|
85
|
+
*/
|
|
86
86
|
export default _default;
|
|
@@ -1,90 +1,103 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
exports.typescript = {
|
|
9
|
-
// eslint built-in rules
|
|
10
|
-
'no-dupe-class-members': 0,
|
|
11
|
-
'no-redeclare': 0,
|
|
12
|
-
'no-undef': 0,
|
|
13
|
-
'no-unused-vars': 0,
|
|
14
|
-
// @typescript-eslint rules
|
|
15
|
-
'@typescript-eslint/adjacent-overload-signatures': 0,
|
|
16
|
-
'@typescript-eslint/array-type': 2,
|
|
17
|
-
'@typescript-eslint/await-thenable': 0,
|
|
18
|
-
'@typescript-eslint/ban-ts-comment': 0,
|
|
19
|
-
'@typescript-eslint/ban-types': 1,
|
|
20
|
-
'@typescript-eslint/consistent-indexed-object-style': 1,
|
|
21
|
-
'@typescript-eslint/consistent-type-imports': 1,
|
|
22
|
-
'@typescript-eslint/dot-notation': 1,
|
|
23
|
-
'@typescript-eslint/method-signature-style': 2,
|
|
24
|
-
'@typescript-eslint/no-array-constructor': 0,
|
|
25
|
-
'@typescript-eslint/no-confusing-non-null-assertion': 2,
|
|
26
|
-
'@typescript-eslint/no-dupe-class-members': 2,
|
|
27
|
-
'@typescript-eslint/no-empty-function': 0,
|
|
28
|
-
'@typescript-eslint/no-empty-interface': 1,
|
|
29
|
-
'@typescript-eslint/no-explicit-any': 0,
|
|
30
|
-
'@typescript-eslint/no-extra-non-null-assertion': 0,
|
|
31
|
-
'@typescript-eslint/no-floating-promises': 0,
|
|
32
|
-
'@typescript-eslint/no-implied-eval': 0,
|
|
33
|
-
'@typescript-eslint/no-inferrable-types': 0,
|
|
34
|
-
'@typescript-eslint/no-invalid-this': 1,
|
|
35
|
-
'@typescript-eslint/no-loop-func': 2,
|
|
36
|
-
'@typescript-eslint/no-loss-of-precision': 0,
|
|
37
|
-
'@typescript-eslint/no-misused-promises': 0,
|
|
38
|
-
'@typescript-eslint/no-namespace': 1,
|
|
39
|
-
'@typescript-eslint/no-non-null-assertion': 0,
|
|
40
|
-
'@typescript-eslint/no-parameter-properties': 2,
|
|
41
|
-
'@typescript-eslint/no-redeclare': 2,
|
|
42
|
-
'@typescript-eslint/no-shadow': 2,
|
|
43
|
-
'@typescript-eslint/no-throw-literal': 2,
|
|
44
|
-
'@typescript-eslint/no-unnecessary-type-assertion': 0,
|
|
45
|
-
'@typescript-eslint/no-unnecessary-type-constraint': 0,
|
|
46
|
-
'@typescript-eslint/no-unsafe-assignment': 0,
|
|
47
|
-
'@typescript-eslint/no-unsafe-call': 0,
|
|
48
|
-
'@typescript-eslint/no-unsafe-member-access': 0,
|
|
49
|
-
'@typescript-eslint/no-unsafe-return': 0,
|
|
50
|
-
'@typescript-eslint/no-unused-expressions': 2,
|
|
51
|
-
'@typescript-eslint/no-unused-vars': [
|
|
52
|
-
'error',
|
|
53
|
-
{ vars: 'all', args: 'after-used', ignoreRestSiblings: true },
|
|
54
|
-
],
|
|
55
|
-
'@typescript-eslint/no-use-before-define': [
|
|
56
|
-
'error',
|
|
57
|
-
{ functions: false, classes: true, variables: true, typedefs: true },
|
|
58
|
-
],
|
|
59
|
-
'@typescript-eslint/no-useless-constructor': 2,
|
|
60
|
-
'@typescript-eslint/no-var-requires': 0,
|
|
61
|
-
'@typescript-eslint/prefer-as-const': 0,
|
|
62
|
-
'@typescript-eslint/prefer-namespace-keyword': 0,
|
|
63
|
-
'@typescript-eslint/require-await': 0,
|
|
64
|
-
'@typescript-eslint/restrict-plus-operands': 0,
|
|
65
|
-
'@typescript-eslint/restrict-template-expressions': 0,
|
|
66
|
-
'@typescript-eslint/switch-exhaustiveness-check': 2,
|
|
67
|
-
'@typescript-eslint/type-annotation-spacing': 2,
|
|
68
|
-
'@typescript-eslint/typedef': 2,
|
|
69
|
-
'@typescript-eslint/unbound-method': 0,
|
|
70
|
-
'@typescript-eslint/unified-signatures': 2,
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
71
8
|
};
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
'no-prototype-builtins': 0,
|
|
80
|
-
// eslint-plugin-react rules
|
|
81
|
-
'react/display-name': 0,
|
|
82
|
-
'react/jsx-key': 1,
|
|
83
|
-
'react/no-array-index-key': 1,
|
|
84
|
-
'react/prop-types': 0,
|
|
85
|
-
'react/react-in-jsx-scope': 0,
|
|
86
|
-
'react/self-closing-comp': 1,
|
|
87
|
-
// eslint-pluginr-react-hooks rules
|
|
88
|
-
'react-hooks/exhaustive-deps': 1,
|
|
89
|
-
'react-hooks/rules-of-hooks': 2,
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
90
16
|
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// fabric.ts
|
|
20
|
+
var fabric_exports = {};
|
|
21
|
+
__export(fabric_exports, {
|
|
22
|
+
default: () => fabric_default,
|
|
23
|
+
typescript: () => typescript
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(fabric_exports);
|
|
26
|
+
var typescript = {
|
|
27
|
+
"no-dupe-class-members": 0,
|
|
28
|
+
"no-redeclare": 0,
|
|
29
|
+
"no-undef": 0,
|
|
30
|
+
"no-unused-vars": 0,
|
|
31
|
+
"@typescript-eslint/adjacent-overload-signatures": 0,
|
|
32
|
+
"@typescript-eslint/array-type": 2,
|
|
33
|
+
"@typescript-eslint/await-thenable": 0,
|
|
34
|
+
"@typescript-eslint/ban-ts-comment": 0,
|
|
35
|
+
"@typescript-eslint/ban-types": 1,
|
|
36
|
+
"@typescript-eslint/consistent-indexed-object-style": 1,
|
|
37
|
+
"@typescript-eslint/consistent-type-imports": 1,
|
|
38
|
+
"@typescript-eslint/dot-notation": 1,
|
|
39
|
+
"@typescript-eslint/method-signature-style": 2,
|
|
40
|
+
"@typescript-eslint/no-array-constructor": 0,
|
|
41
|
+
"@typescript-eslint/no-confusing-non-null-assertion": 2,
|
|
42
|
+
"@typescript-eslint/no-dupe-class-members": 2,
|
|
43
|
+
"@typescript-eslint/no-empty-function": 0,
|
|
44
|
+
"@typescript-eslint/no-empty-interface": 1,
|
|
45
|
+
"@typescript-eslint/no-explicit-any": 0,
|
|
46
|
+
"@typescript-eslint/no-extra-non-null-assertion": 0,
|
|
47
|
+
"@typescript-eslint/no-floating-promises": 0,
|
|
48
|
+
"@typescript-eslint/no-implied-eval": 0,
|
|
49
|
+
"@typescript-eslint/no-inferrable-types": 0,
|
|
50
|
+
"@typescript-eslint/no-invalid-this": 1,
|
|
51
|
+
"@typescript-eslint/no-loop-func": 2,
|
|
52
|
+
"@typescript-eslint/no-loss-of-precision": 0,
|
|
53
|
+
"@typescript-eslint/no-misused-promises": 0,
|
|
54
|
+
"@typescript-eslint/no-namespace": 1,
|
|
55
|
+
"@typescript-eslint/no-non-null-assertion": 0,
|
|
56
|
+
"@typescript-eslint/no-parameter-properties": 2,
|
|
57
|
+
"@typescript-eslint/no-redeclare": 2,
|
|
58
|
+
"@typescript-eslint/no-shadow": 2,
|
|
59
|
+
"@typescript-eslint/no-throw-literal": 2,
|
|
60
|
+
"@typescript-eslint/no-unnecessary-type-assertion": 0,
|
|
61
|
+
"@typescript-eslint/no-unnecessary-type-constraint": 0,
|
|
62
|
+
"@typescript-eslint/no-unsafe-assignment": 0,
|
|
63
|
+
"@typescript-eslint/no-unsafe-call": 0,
|
|
64
|
+
"@typescript-eslint/no-unsafe-member-access": 0,
|
|
65
|
+
"@typescript-eslint/no-unsafe-return": 0,
|
|
66
|
+
"@typescript-eslint/no-unused-expressions": 2,
|
|
67
|
+
"@typescript-eslint/no-unused-vars": [
|
|
68
|
+
"error",
|
|
69
|
+
{ vars: "all", args: "after-used", ignoreRestSiblings: true }
|
|
70
|
+
],
|
|
71
|
+
"@typescript-eslint/no-use-before-define": [
|
|
72
|
+
"error",
|
|
73
|
+
{ functions: false, classes: true, variables: true, typedefs: true }
|
|
74
|
+
],
|
|
75
|
+
"@typescript-eslint/no-useless-constructor": 2,
|
|
76
|
+
"@typescript-eslint/no-var-requires": 0,
|
|
77
|
+
"@typescript-eslint/prefer-as-const": 0,
|
|
78
|
+
"@typescript-eslint/prefer-namespace-keyword": 0,
|
|
79
|
+
"@typescript-eslint/require-await": 0,
|
|
80
|
+
"@typescript-eslint/restrict-plus-operands": 0,
|
|
81
|
+
"@typescript-eslint/restrict-template-expressions": 0,
|
|
82
|
+
"@typescript-eslint/switch-exhaustiveness-check": 2,
|
|
83
|
+
"@typescript-eslint/type-annotation-spacing": 2,
|
|
84
|
+
"@typescript-eslint/typedef": 2,
|
|
85
|
+
"@typescript-eslint/unbound-method": 0,
|
|
86
|
+
"@typescript-eslint/unified-signatures": 2
|
|
87
|
+
};
|
|
88
|
+
var fabric_default = {
|
|
89
|
+
"no-param-reassign": 2,
|
|
90
|
+
"no-prototype-builtins": 0,
|
|
91
|
+
"react/display-name": 0,
|
|
92
|
+
"react/jsx-key": 1,
|
|
93
|
+
"react/no-array-index-key": 1,
|
|
94
|
+
"react/prop-types": 0,
|
|
95
|
+
"react/react-in-jsx-scope": 0,
|
|
96
|
+
"react/self-closing-comp": 1,
|
|
97
|
+
"react-hooks/exhaustive-deps": 1,
|
|
98
|
+
"react-hooks/rules-of-hooks": 2
|
|
99
|
+
};
|
|
100
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
101
|
+
0 && (module.exports = {
|
|
102
|
+
typescript
|
|
103
|
+
});
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* recommended enabled/disabled rules for umi project
|
|
3
|
-
* @note base on recommended rule set from loaded eslint plugins
|
|
4
|
-
*/
|
|
5
1
|
declare const _default: {
|
|
6
2
|
'array-callback-return': number;
|
|
7
3
|
eqeqeq: number;
|
|
@@ -53,6 +49,10 @@ declare const _default: {
|
|
|
53
49
|
'react/require-render-return': number;
|
|
54
50
|
'react-hooks/rules-of-hooks': number;
|
|
55
51
|
};
|
|
52
|
+
/**
|
|
53
|
+
* recommended enabled/disabled rules for umi project
|
|
54
|
+
* @note base on recommended rule set from loaded eslint plugins
|
|
55
|
+
*/
|
|
56
56
|
export default _default;
|
|
57
57
|
/**
|
|
58
58
|
* config-plugin-jest rules
|
|
@@ -1,111 +1,116 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
exports.default = {
|
|
9
|
-
// eslint built-in rules
|
|
10
|
-
// 不需要返回就用 forEach
|
|
11
|
-
'array-callback-return': 2,
|
|
12
|
-
// eqeq 可能导致潜在的类型转换问题
|
|
13
|
-
eqeqeq: 2,
|
|
14
|
-
'for-direction': 2,
|
|
15
|
-
// 不加 hasOwnProperty 判断会多出原型链的内容
|
|
16
|
-
'guard-for-in': 2,
|
|
17
|
-
'no-async-promise-executor': 2,
|
|
18
|
-
'no-case-declarations': 2,
|
|
19
|
-
'no-debugger': 2,
|
|
20
|
-
'no-delete-var': 2,
|
|
21
|
-
'no-dupe-else-if': 2,
|
|
22
|
-
'no-duplicate-case': 2,
|
|
23
|
-
// eval()可能导致潜在的安全问题
|
|
24
|
-
'no-eval': 2,
|
|
25
|
-
'no-ex-assign': 2,
|
|
26
|
-
'no-global-assign': 2,
|
|
27
|
-
'no-invalid-regexp': 2,
|
|
28
|
-
// 没必要改 native 变量
|
|
29
|
-
'no-native-reassign': 2,
|
|
30
|
-
// 修改对象时,会影响原对象;但是有些场景就是有目的
|
|
31
|
-
'no-param-reassign': 2,
|
|
32
|
-
// return 值无意义,可能会理解为 resolve
|
|
33
|
-
'no-promise-executor-return': 2,
|
|
34
|
-
'no-self-assign': 2,
|
|
35
|
-
'no-self-compare': 2,
|
|
36
|
-
'no-shadow-restricted-names': 2,
|
|
37
|
-
'no-sparse-arrays': 2,
|
|
38
|
-
'no-unsafe-finally': 2,
|
|
39
|
-
'no-unused-labels': 2,
|
|
40
|
-
'no-useless-catch': 2,
|
|
41
|
-
'no-useless-escape': 2,
|
|
42
|
-
'no-var': 2,
|
|
43
|
-
'no-with': 2,
|
|
44
|
-
'require-yield': 2,
|
|
45
|
-
'use-isnan': 2,
|
|
46
|
-
// config-plugin-react rules
|
|
47
|
-
// button 自带 submit 属性
|
|
48
|
-
'react/button-has-type': 2,
|
|
49
|
-
'react/jsx-key': 2,
|
|
50
|
-
'react/jsx-no-comment-textnodes': 2,
|
|
51
|
-
'react/jsx-no-duplicate-props': 2,
|
|
52
|
-
'react/jsx-no-target-blank': 2,
|
|
53
|
-
'react/jsx-no-undef': 2,
|
|
54
|
-
'react/jsx-uses-react': 2,
|
|
55
|
-
'react/jsx-uses-vars': 2,
|
|
56
|
-
'react/no-children-prop': 2,
|
|
57
|
-
'react/no-danger-with-children': 2,
|
|
58
|
-
'react/no-deprecated': 2,
|
|
59
|
-
'react/no-direct-mutation-state': 2,
|
|
60
|
-
'react/no-find-dom-node': 2,
|
|
61
|
-
'react/no-is-mounted': 2,
|
|
62
|
-
'react/no-string-refs': 2,
|
|
63
|
-
'react/no-render-return-value': 2,
|
|
64
|
-
'react/no-unescaped-entities': 2,
|
|
65
|
-
'react/no-unknown-property': 2,
|
|
66
|
-
'react/require-render-return': 2,
|
|
67
|
-
// config-plugin-react-hooks rules
|
|
68
|
-
'react-hooks/rules-of-hooks': 2,
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
69
8
|
};
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
'jest/no-focused-tests': 2,
|
|
78
|
-
'jest/no-identical-title': 2,
|
|
79
|
-
'jest/no-interpolation-in-snapshots': 2,
|
|
80
|
-
'jest/no-jasmine-globals': 2,
|
|
81
|
-
'jest/no-jest-import': 2,
|
|
82
|
-
'jest/no-mocks-import': 2,
|
|
83
|
-
'jest/no-standalone-expect': 2,
|
|
84
|
-
'jest/valid-describe-callback': 2,
|
|
85
|
-
'jest/valid-expect-in-promise': 2,
|
|
86
|
-
'jest/valid-expect': 2,
|
|
87
|
-
'jest/valid-title': 2,
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
88
16
|
};
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// recommended.ts
|
|
20
|
+
var recommended_exports = {};
|
|
21
|
+
__export(recommended_exports, {
|
|
22
|
+
default: () => recommended_default,
|
|
23
|
+
jest: () => jest,
|
|
24
|
+
typescript: () => typescript
|
|
25
|
+
});
|
|
26
|
+
module.exports = __toCommonJS(recommended_exports);
|
|
27
|
+
var recommended_default = {
|
|
28
|
+
"array-callback-return": 2,
|
|
29
|
+
eqeqeq: 2,
|
|
30
|
+
"for-direction": 2,
|
|
31
|
+
"guard-for-in": 2,
|
|
32
|
+
"no-async-promise-executor": 2,
|
|
33
|
+
"no-case-declarations": 2,
|
|
34
|
+
"no-debugger": 2,
|
|
35
|
+
"no-delete-var": 2,
|
|
36
|
+
"no-dupe-else-if": 2,
|
|
37
|
+
"no-duplicate-case": 2,
|
|
38
|
+
"no-eval": 2,
|
|
39
|
+
"no-ex-assign": 2,
|
|
40
|
+
"no-global-assign": 2,
|
|
41
|
+
"no-invalid-regexp": 2,
|
|
42
|
+
"no-native-reassign": 2,
|
|
43
|
+
"no-param-reassign": 2,
|
|
44
|
+
"no-promise-executor-return": 2,
|
|
45
|
+
"no-self-assign": 2,
|
|
46
|
+
"no-self-compare": 2,
|
|
47
|
+
"no-shadow-restricted-names": 2,
|
|
48
|
+
"no-sparse-arrays": 2,
|
|
49
|
+
"no-unsafe-finally": 2,
|
|
50
|
+
"no-unused-labels": 2,
|
|
51
|
+
"no-useless-catch": 2,
|
|
52
|
+
"no-useless-escape": 2,
|
|
53
|
+
"no-var": 2,
|
|
54
|
+
"no-with": 2,
|
|
55
|
+
"require-yield": 2,
|
|
56
|
+
"use-isnan": 2,
|
|
57
|
+
"react/button-has-type": 2,
|
|
58
|
+
"react/jsx-key": 2,
|
|
59
|
+
"react/jsx-no-comment-textnodes": 2,
|
|
60
|
+
"react/jsx-no-duplicate-props": 2,
|
|
61
|
+
"react/jsx-no-target-blank": 2,
|
|
62
|
+
"react/jsx-no-undef": 2,
|
|
63
|
+
"react/jsx-uses-react": 2,
|
|
64
|
+
"react/jsx-uses-vars": 2,
|
|
65
|
+
"react/no-children-prop": 2,
|
|
66
|
+
"react/no-danger-with-children": 2,
|
|
67
|
+
"react/no-deprecated": 2,
|
|
68
|
+
"react/no-direct-mutation-state": 2,
|
|
69
|
+
"react/no-find-dom-node": 2,
|
|
70
|
+
"react/no-is-mounted": 2,
|
|
71
|
+
"react/no-string-refs": 2,
|
|
72
|
+
"react/no-render-return-value": 2,
|
|
73
|
+
"react/no-unescaped-entities": 2,
|
|
74
|
+
"react/no-unknown-property": 2,
|
|
75
|
+
"react/require-render-return": 2,
|
|
76
|
+
"react-hooks/rules-of-hooks": 2
|
|
111
77
|
};
|
|
78
|
+
var jest = {
|
|
79
|
+
"jest/no-conditional-expect": 2,
|
|
80
|
+
"jest/no-deprecated-functions": 2,
|
|
81
|
+
"jest/no-export": 2,
|
|
82
|
+
"jest/no-focused-tests": 2,
|
|
83
|
+
"jest/no-identical-title": 2,
|
|
84
|
+
"jest/no-interpolation-in-snapshots": 2,
|
|
85
|
+
"jest/no-jasmine-globals": 2,
|
|
86
|
+
"jest/no-jest-import": 2,
|
|
87
|
+
"jest/no-mocks-import": 2,
|
|
88
|
+
"jest/no-standalone-expect": 2,
|
|
89
|
+
"jest/valid-describe-callback": 2,
|
|
90
|
+
"jest/valid-expect-in-promise": 2,
|
|
91
|
+
"jest/valid-expect": 2,
|
|
92
|
+
"jest/valid-title": 2
|
|
93
|
+
};
|
|
94
|
+
var typescript = {
|
|
95
|
+
"@typescript-eslint/ban-types": 2,
|
|
96
|
+
"@typescript-eslint/no-confusing-non-null-assertion": 2,
|
|
97
|
+
"@typescript-eslint/no-dupe-class-members": 2,
|
|
98
|
+
"@typescript-eslint/no-empty-interface": 2,
|
|
99
|
+
"@typescript-eslint/no-invalid-this": 2,
|
|
100
|
+
"@typescript-eslint/no-loop-func": 2,
|
|
101
|
+
"@typescript-eslint/no-misused-new": 2,
|
|
102
|
+
"@typescript-eslint/no-namespace": 2,
|
|
103
|
+
"@typescript-eslint/no-non-null-asserted-optional-chain": 2,
|
|
104
|
+
"@typescript-eslint/no-redeclare": 2,
|
|
105
|
+
"@typescript-eslint/no-this-alias": 2,
|
|
106
|
+
"@typescript-eslint/no-unused-expressions": 2,
|
|
107
|
+
"@typescript-eslint/no-unused-vars": 2,
|
|
108
|
+
"@typescript-eslint/no-use-before-define": 2,
|
|
109
|
+
"@typescript-eslint/no-useless-constructor": 2,
|
|
110
|
+
"@typescript-eslint/triple-slash-reference": 2
|
|
111
|
+
};
|
|
112
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
113
|
+
0 && (module.exports = {
|
|
114
|
+
jest,
|
|
115
|
+
typescript
|
|
116
|
+
});
|
|
File without changes
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
require('../../../compiled/@rushstack/eslint-patch/lib/modern-module-resolution.js');
|
|
1
|
+
// setup.ts
|
|
2
|
+
require("../../../compiled/@rushstack/eslint-patch/lib/modern-module-resolution.js");
|
|
File without changes
|
|
@@ -1,34 +1,51 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __copyProps = (to, from, except, desc) => {
|
|
8
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
9
|
+
for (let key of __getOwnPropNames(from))
|
|
10
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
11
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
12
|
+
}
|
|
13
|
+
return to;
|
|
14
|
+
};
|
|
15
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
|
|
16
|
+
|
|
17
|
+
// index.ts
|
|
6
18
|
module.exports = {
|
|
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
|
-
|
|
19
|
+
extends: [
|
|
20
|
+
require.resolve("stylelint-config-standard"),
|
|
21
|
+
require.resolve("../../../compiled/stylelint-config-prettier"),
|
|
22
|
+
require.resolve("../../../compiled/stylelint-config-css-modules")
|
|
23
|
+
],
|
|
24
|
+
plugins: [
|
|
25
|
+
require.resolve("../../../compiled/stylelint-declaration-block-no-ignored-properties")
|
|
26
|
+
],
|
|
27
|
+
rules: {
|
|
28
|
+
"no-descending-specificity": null,
|
|
29
|
+
"function-url-quotes": "always",
|
|
30
|
+
"selector-attribute-quotes": "always",
|
|
31
|
+
"font-family-no-missing-generic-family-keyword": null,
|
|
32
|
+
"plugin/declaration-block-no-ignored-properties": true,
|
|
33
|
+
"unit-no-unknown": [true, { ignoreUnits: ["rpx"] }],
|
|
34
|
+
"selector-type-no-unknown": null,
|
|
35
|
+
"value-keyword-case": ["lower", { ignoreProperties: ["composes"] }],
|
|
36
|
+
"selector-class-pattern": [
|
|
37
|
+
"^([a-z][a-z0-9]*(-[a-z0-9]+)*|[a-z][a-zA-Z0-9]+)$",
|
|
38
|
+
{
|
|
39
|
+
message: "Expected class selector to be kebab-case or lowerCamelCase"
|
|
40
|
+
}
|
|
41
|
+
]
|
|
42
|
+
},
|
|
43
|
+
customSyntax: require.resolve("../../../compiled/postcss-less"),
|
|
44
|
+
ignoreFiles: ["node_modules"],
|
|
45
|
+
overrides: [
|
|
46
|
+
{
|
|
47
|
+
files: ["**/*.js", "**/*.jsx", "**/*.ts", "**/*.tsx"],
|
|
48
|
+
customSyntax: require.resolve("@stylelint/postcss-css-in-js")
|
|
49
|
+
}
|
|
50
|
+
]
|
|
34
51
|
};
|
package/dist/index.d.ts
CHANGED
|
File without changes
|
package/dist/index.js
CHANGED
|
@@ -1,31 +1,72 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defProps = Object.defineProperties;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
9
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
10
|
+
var __spreadValues = (a, b) => {
|
|
11
|
+
for (var prop in b || (b = {}))
|
|
12
|
+
if (__hasOwnProp.call(b, prop))
|
|
13
|
+
__defNormalProp(a, prop, b[prop]);
|
|
14
|
+
if (__getOwnPropSymbols)
|
|
15
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
16
|
+
if (__propIsEnum.call(b, prop))
|
|
17
|
+
__defNormalProp(a, prop, b[prop]);
|
|
18
|
+
}
|
|
19
|
+
return a;
|
|
20
|
+
};
|
|
21
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
22
|
+
var __export = (target, all) => {
|
|
23
|
+
for (var name in all)
|
|
24
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
25
|
+
};
|
|
26
|
+
var __copyProps = (to, from, except, desc) => {
|
|
27
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
28
|
+
for (let key of __getOwnPropNames(from))
|
|
29
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
30
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
31
|
+
}
|
|
32
|
+
return to;
|
|
33
|
+
};
|
|
34
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
35
|
+
|
|
36
|
+
// index.ts
|
|
37
|
+
var src_exports = {};
|
|
38
|
+
__export(src_exports, {
|
|
39
|
+
default: () => src_default
|
|
40
|
+
});
|
|
41
|
+
module.exports = __toCommonJS(src_exports);
|
|
42
|
+
var import_linter = require("./linter");
|
|
43
|
+
var ES_EXTS = ["**/*.js", "**/*.jsx", "**/*.ts", "**/*.tsx"];
|
|
44
|
+
var STYLE_EXTS = [
|
|
45
|
+
"**/*.less",
|
|
46
|
+
"**/*.css",
|
|
47
|
+
"**/*.sass",
|
|
48
|
+
"**/*.scss",
|
|
49
|
+
"**/*.styl"
|
|
11
50
|
];
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}
|
|
21
|
-
stylelint.run(styleArgs);
|
|
51
|
+
var src_default = (opts, args) => {
|
|
52
|
+
if (!args.eslintOnly) {
|
|
53
|
+
const stylelint = new import_linter.StyleLinter(opts);
|
|
54
|
+
const styleArgs = __spreadProps(__spreadValues({}, args), { _: [...args._] });
|
|
55
|
+
if (!styleArgs.cssinjs) {
|
|
56
|
+
for (const suffix of ES_EXTS) {
|
|
57
|
+
styleArgs._.unshift("--ignore-pattern", suffix);
|
|
58
|
+
}
|
|
22
59
|
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
60
|
+
stylelint.run(styleArgs);
|
|
61
|
+
}
|
|
62
|
+
if (!args.stylelintOnly) {
|
|
63
|
+
const eslint = new import_linter.EsLinter(opts);
|
|
64
|
+
const esArgs = __spreadProps(__spreadValues({}, args), { _: [...args._] });
|
|
65
|
+
for (const suffix of STYLE_EXTS) {
|
|
66
|
+
esArgs._.unshift("--ignore-pattern", suffix);
|
|
30
67
|
}
|
|
68
|
+
eslint.run(esArgs);
|
|
69
|
+
}
|
|
31
70
|
};
|
|
71
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
72
|
+
0 && (module.exports = {});
|
package/dist/linter/base.d.ts
CHANGED
|
File without changes
|
package/dist/linter/base.js
CHANGED
|
@@ -1,56 +1,58 @@
|
|
|
1
|
-
|
|
2
|
-
var
|
|
3
|
-
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
4
10
|
};
|
|
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
|
-
* get linter fork args
|
|
38
|
-
*/
|
|
39
|
-
getRunArgs(args) {
|
|
40
|
-
// not implemented
|
|
41
|
-
args;
|
|
42
|
-
return [];
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* execute linter
|
|
46
|
-
*/
|
|
47
|
-
run(args) {
|
|
48
|
-
(0, child_process_1.fork)(this.getBinPath(), this.getRunArgs(args)).on('exit', (code) => {
|
|
49
|
-
// override exit code when > 0
|
|
50
|
-
if (!!code) {
|
|
51
|
-
process.exitCode = code;
|
|
52
|
-
}
|
|
53
|
-
});
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
|
|
20
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
21
|
+
|
|
22
|
+
// base.ts
|
|
23
|
+
var base_exports = {};
|
|
24
|
+
__export(base_exports, {
|
|
25
|
+
default: () => BaseLinter
|
|
26
|
+
});
|
|
27
|
+
module.exports = __toCommonJS(base_exports);
|
|
28
|
+
var import_child_process = require("child_process");
|
|
29
|
+
var import_path = __toESM(require("path"));
|
|
30
|
+
var BaseLinter = class {
|
|
31
|
+
constructor({ cwd }) {
|
|
32
|
+
this.linter = "";
|
|
33
|
+
this.paths = {};
|
|
34
|
+
this.paths.cwd = cwd;
|
|
35
|
+
}
|
|
36
|
+
getBinPath() {
|
|
37
|
+
try {
|
|
38
|
+
const pkgPath = require.resolve(`${this.linter}/package.json`);
|
|
39
|
+
const pkgContent = require(pkgPath);
|
|
40
|
+
return import_path.default.resolve(import_path.default.dirname(pkgPath), pkgContent.bin[this.linter]);
|
|
41
|
+
} catch (e) {
|
|
42
|
+
throw new Error(`${this.linter} not found, please install it first.`);
|
|
54
43
|
}
|
|
55
|
-
}
|
|
56
|
-
|
|
44
|
+
}
|
|
45
|
+
getRunArgs(args) {
|
|
46
|
+
args;
|
|
47
|
+
return [];
|
|
48
|
+
}
|
|
49
|
+
run(args) {
|
|
50
|
+
(0, import_child_process.fork)(this.getBinPath(), this.getRunArgs(args)).on("exit", (code) => {
|
|
51
|
+
if (!!code) {
|
|
52
|
+
process.exitCode = code;
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
58
|
+
0 && (module.exports = {});
|
package/dist/linter/eslint.d.ts
CHANGED
|
File without changes
|
package/dist/linter/eslint.js
CHANGED
|
@@ -1,23 +1,43 @@
|
|
|
1
|
-
|
|
2
|
-
var
|
|
3
|
-
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
4
10
|
};
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
|
|
20
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
21
|
+
|
|
22
|
+
// eslint.ts
|
|
23
|
+
var eslint_exports = {};
|
|
24
|
+
__export(eslint_exports, {
|
|
25
|
+
default: () => Eslinter
|
|
26
|
+
});
|
|
27
|
+
module.exports = __toCommonJS(eslint_exports);
|
|
28
|
+
var import_base = __toESM(require("./base"));
|
|
29
|
+
var Eslinter = class extends import_base.default {
|
|
30
|
+
constructor() {
|
|
31
|
+
super(...arguments);
|
|
32
|
+
this.linter = "eslint";
|
|
33
|
+
}
|
|
34
|
+
getRunArgs(args) {
|
|
35
|
+
return [
|
|
36
|
+
...args.quiet ? ["--quiet"] : [],
|
|
37
|
+
...args.fix ? ["--fix"] : [],
|
|
38
|
+
...args._
|
|
39
|
+
];
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
43
|
+
0 && (module.exports = {});
|
package/dist/linter/index.d.ts
CHANGED
|
File without changes
|
package/dist/linter/index.js
CHANGED
|
@@ -1,10 +1,35 @@
|
|
|
1
|
-
|
|
2
|
-
var
|
|
3
|
-
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
4
10
|
};
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
|
|
20
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
21
|
+
|
|
22
|
+
// index.ts
|
|
23
|
+
var linter_exports = {};
|
|
24
|
+
__export(linter_exports, {
|
|
25
|
+
EsLinter: () => import_eslint.default,
|
|
26
|
+
StyleLinter: () => import_stylelint.default
|
|
27
|
+
});
|
|
28
|
+
module.exports = __toCommonJS(linter_exports);
|
|
29
|
+
var import_eslint = __toESM(require("./eslint"));
|
|
30
|
+
var import_stylelint = __toESM(require("./stylelint"));
|
|
31
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
32
|
+
0 && (module.exports = {
|
|
33
|
+
EsLinter,
|
|
34
|
+
StyleLinter
|
|
35
|
+
});
|
|
File without changes
|
package/dist/linter/stylelint.js
CHANGED
|
@@ -1,26 +1,46 @@
|
|
|
1
|
-
|
|
2
|
-
var
|
|
3
|
-
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
4
10
|
};
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
|
|
20
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
21
|
+
|
|
22
|
+
// stylelint.ts
|
|
23
|
+
var stylelint_exports = {};
|
|
24
|
+
__export(stylelint_exports, {
|
|
25
|
+
default: () => StyleLinter
|
|
26
|
+
});
|
|
27
|
+
module.exports = __toCommonJS(stylelint_exports);
|
|
28
|
+
var import_base = __toESM(require("./base"));
|
|
29
|
+
var StyleLinter = class extends import_base.default {
|
|
30
|
+
constructor() {
|
|
31
|
+
super(...arguments);
|
|
32
|
+
this.linter = "stylelint";
|
|
33
|
+
}
|
|
34
|
+
getRunArgs(args) {
|
|
35
|
+
return [
|
|
36
|
+
"--config-basedir",
|
|
37
|
+
this.paths.cwd,
|
|
38
|
+
...args.quiet ? ["--quiet"] : [],
|
|
39
|
+
"--allow-empty-input",
|
|
40
|
+
...args.fix ? ["--fix"] : [],
|
|
41
|
+
...args._
|
|
42
|
+
];
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
46
|
+
0 && (module.exports = {});
|
package/dist/types.d.ts
CHANGED
package/dist/types.js
CHANGED
|
@@ -1,2 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __copyProps = (to, from, except, desc) => {
|
|
6
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
7
|
+
for (let key of __getOwnPropNames(from))
|
|
8
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
9
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
10
|
+
}
|
|
11
|
+
return to;
|
|
12
|
+
};
|
|
13
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
14
|
+
|
|
15
|
+
// types.ts
|
|
16
|
+
var types_exports = {};
|
|
17
|
+
module.exports = __toCommonJS(types_exports);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@umijs/lint",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.8",
|
|
4
4
|
"description": "@umijs/lint",
|
|
5
5
|
"homepage": "https://github.com/umijs/umi/tree/master/packages/lint#readme",
|
|
6
6
|
"bugs": "https://github.com/umijs/umi/issues",
|
|
@@ -16,9 +16,9 @@
|
|
|
16
16
|
"dist"
|
|
17
17
|
],
|
|
18
18
|
"scripts": {
|
|
19
|
-
"build": "pnpm
|
|
19
|
+
"build": "pnpm father build",
|
|
20
20
|
"build:deps": "umi-scripts bundleDeps",
|
|
21
|
-
"dev": "pnpm
|
|
21
|
+
"dev": "pnpm father dev"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
24
|
"@babel/core": "7.17.9",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"@stylelint/postcss-css-in-js": "^0.38.0",
|
|
27
27
|
"@typescript-eslint/eslint-plugin": "5.27.1",
|
|
28
28
|
"@typescript-eslint/parser": "5.27.1",
|
|
29
|
-
"@umijs/babel-preset-umi": "4.0.
|
|
29
|
+
"@umijs/babel-preset-umi": "4.0.8",
|
|
30
30
|
"eslint-plugin-jest": "26.1.5",
|
|
31
31
|
"eslint-plugin-react": "7.29.4",
|
|
32
32
|
"eslint-plugin-react-hooks": "4.5.0",
|