@umijs/lint 4.0.0-canary.20220718.2 → 4.0.0-canary.20220720.1

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.
Files changed (37) hide show
  1. package/dist/config/eslint/index.d.ts +0 -1
  2. package/dist/config/eslint/index.js +56 -64
  3. package/dist/config/eslint/legacy.d.ts +0 -1
  4. package/dist/config/eslint/legacy.js +45 -53
  5. package/dist/config/eslint/rules/fabric.d.ts +4 -5
  6. package/dist/config/eslint/rules/fabric.js +101 -88
  7. package/dist/config/eslint/rules/recommended.d.ts +4 -5
  8. package/dist/config/eslint/rules/recommended.js +113 -108
  9. package/dist/config/eslint/setup.d.ts +0 -1
  10. package/dist/config/eslint/setup.js +2 -3
  11. package/dist/config/stylelint/index.d.ts +0 -1
  12. package/dist/config/stylelint/index.js +49 -38
  13. package/dist/index.d.ts +0 -1
  14. package/dist/index.js +68 -27
  15. package/dist/linter/base.d.ts +0 -1
  16. package/dist/linter/base.js +56 -54
  17. package/dist/linter/eslint.d.ts +0 -1
  18. package/dist/linter/eslint.js +42 -22
  19. package/dist/linter/index.d.ts +0 -1
  20. package/dist/linter/index.js +34 -9
  21. package/dist/linter/stylelint.d.ts +0 -1
  22. package/dist/linter/stylelint.js +45 -25
  23. package/dist/types.d.ts +0 -1
  24. package/dist/types.js +17 -2
  25. package/package.json +4 -4
  26. package/dist/config/eslint/index.d.ts.map +0 -1
  27. package/dist/config/eslint/legacy.d.ts.map +0 -1
  28. package/dist/config/eslint/rules/fabric.d.ts.map +0 -1
  29. package/dist/config/eslint/rules/recommended.d.ts.map +0 -1
  30. package/dist/config/eslint/setup.d.ts.map +0 -1
  31. package/dist/config/stylelint/index.d.ts.map +0 -1
  32. package/dist/index.d.ts.map +0 -1
  33. package/dist/linter/base.d.ts.map +0 -1
  34. package/dist/linter/eslint.d.ts.map +0 -1
  35. package/dist/linter/index.d.ts.map +0 -1
  36. package/dist/linter/stylelint.d.ts.map +0 -1
  37. package/dist/types.d.ts.map +0 -1
@@ -1,2 +1 @@
1
1
  import './setup';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1,70 +1,62 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
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
- Object.defineProperty(exports, "__esModule", { value: true });
26
- const recommended_1 = __importStar(require("./rules/recommended"));
27
- require("./setup");
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
- parser: require.resolve('@babel/eslint-parser'),
30
- plugins: ['react', 'react-hooks'],
31
- settings: {
32
- react: {
33
- version: 'detect',
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
- env: {
37
- browser: true,
38
- node: true,
39
- es2022: true,
40
- jest: true,
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
- rules: recommended_1.default,
43
- overrides: [
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
  };
@@ -1,2 +1 @@
1
1
  import './setup';
2
- //# sourceMappingURL=legacy.d.ts.map
@@ -1,58 +1,50 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
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
- Object.defineProperty(exports, "__esModule", { value: true });
26
- const fabric_1 = __importStar(require("./rules/fabric"));
27
- require("./setup");
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
- extends: ['prettier', 'plugin:react/recommended'],
30
- parser: require.resolve('@babel/eslint-parser'),
31
- plugins: ['react', 'react-hooks'],
32
- env: {
33
- browser: true,
34
- node: true,
35
- es6: true,
36
- mocha: true,
37
- jest: true,
38
- jasmine: true,
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
- rules: fabric_1.default,
41
- overrides: [
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,5 +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;
87
- //# sourceMappingURL=fabric.d.ts.map
@@ -1,90 +1,103 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.typescript = void 0;
4
- /**
5
- * legay enabled/disabled rules from @umijs/fabric tsEslintConfig
6
- * @see https://github.com/umijs/fabric/blob/master/src/tsEslintConfig.ts
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
- * legay enabled/disabled rules from @umijs/fabric
74
- * @see https://github.com/umijs/fabric/blob/master/src/eslint.ts#L54
75
- */
76
- exports.default = {
77
- // eslint built-in rules
78
- 'no-param-reassign': 2,
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
@@ -95,4 +95,3 @@ export declare const typescript: {
95
95
  '@typescript-eslint/no-useless-constructor': number;
96
96
  '@typescript-eslint/triple-slash-reference': number;
97
97
  };
98
- //# sourceMappingURL=recommended.d.ts.map