@umijs/lint 4.0.0-canary-20240513.3

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 (40) hide show
  1. package/README.md +3 -0
  2. package/compiled/@rushstack/eslint-patch/LICENSE +24 -0
  3. package/compiled/@rushstack/eslint-patch/lib/modern-module-resolution.js +216 -0
  4. package/compiled/@rushstack/eslint-patch/package.json +1 -0
  5. package/compiled/postcss-less/LICENSE +24 -0
  6. package/compiled/postcss-less/index.js +1 -0
  7. package/compiled/postcss-less/package.json +1 -0
  8. package/compiled/stylelint-config-css-modules/index.js +1 -0
  9. package/compiled/stylelint-config-css-modules/package.json +1 -0
  10. package/compiled/stylelint-config-prettier/LICENSE +22 -0
  11. package/compiled/stylelint-config-prettier/index.js +1 -0
  12. package/compiled/stylelint-config-prettier/package.json +1 -0
  13. package/compiled/stylelint-declaration-block-no-ignored-properties/LICENSE +21 -0
  14. package/compiled/stylelint-declaration-block-no-ignored-properties/index.js +75 -0
  15. package/compiled/stylelint-declaration-block-no-ignored-properties/package.json +1 -0
  16. package/dist/config/eslint/index.d.ts +1 -0
  17. package/dist/config/eslint/index.js +83 -0
  18. package/dist/config/eslint/legacy.d.ts +1 -0
  19. package/dist/config/eslint/legacy.js +61 -0
  20. package/dist/config/eslint/rules/fabric.d.ts +86 -0
  21. package/dist/config/eslint/rules/fabric.js +108 -0
  22. package/dist/config/eslint/rules/recommended.d.ts +96 -0
  23. package/dist/config/eslint/rules/recommended.js +127 -0
  24. package/dist/config/eslint/setup.d.ts +0 -0
  25. package/dist/config/eslint/setup.js +2 -0
  26. package/dist/config/stylelint/index.d.ts +0 -0
  27. package/dist/config/stylelint/index.js +74 -0
  28. package/dist/index.d.ts +4 -0
  29. package/dist/index.js +53 -0
  30. package/dist/linter/base.d.ts +27 -0
  31. package/dist/linter/base.js +80 -0
  32. package/dist/linter/eslint.d.ts +9 -0
  33. package/dist/linter/eslint.js +48 -0
  34. package/dist/linter/index.d.ts +2 -0
  35. package/dist/linter/index.js +42 -0
  36. package/dist/linter/stylelint.d.ts +9 -0
  37. package/dist/linter/stylelint.js +51 -0
  38. package/dist/types.d.ts +11 -0
  39. package/dist/types.js +17 -0
  40. package/package.json +64 -0
@@ -0,0 +1 @@
1
+ {"name":"stylelint-declaration-block-no-ignored-properties","author":{"name":"Krister Kari","url":"https://github.com/kristerkari/"},"license":"MIT"}
@@ -0,0 +1 @@
1
+ import './setup';
@@ -0,0 +1,83 @@
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(
16
+ // If the importer is in node compatibility mode or this is not an ESM
17
+ // file that has been converted to a CommonJS file using a Babel-
18
+ // compatible transform (i.e. "__esModule" has not been set), then set
19
+ // "default" to the CommonJS "module.exports" for node compatibility.
20
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
21
+ mod
22
+ ));
23
+
24
+ // src/config/eslint/index.ts
25
+ var import_recommended = __toESM(require("./rules/recommended"));
26
+ var import_setup = require("./setup");
27
+ module.exports = {
28
+ parser: require.resolve("@babel/eslint-parser"),
29
+ plugins: ["react", "react-hooks"],
30
+ settings: {
31
+ react: {
32
+ version: "detect"
33
+ }
34
+ },
35
+ env: {
36
+ browser: true,
37
+ node: true,
38
+ es2022: true,
39
+ jest: true
40
+ },
41
+ rules: import_recommended.default,
42
+ overrides: [
43
+ {
44
+ parser: require.resolve("@typescript-eslint/parser"),
45
+ plugins: ["@typescript-eslint/eslint-plugin"],
46
+ files: ["**/*.{ts,tsx}"],
47
+ rules: import_recommended.typescript
48
+ },
49
+ {
50
+ settings: {
51
+ jest: {
52
+ version: detectJestVersion()
53
+ }
54
+ },
55
+ files: ["**/*.{test,spec,unit,e2e}.{ts,tsx,js,jsx}"],
56
+ plugins: ["jest"],
57
+ rules: import_recommended.jest
58
+ }
59
+ ],
60
+ parserOptions: {
61
+ ecmaFeatures: {
62
+ jsx: true
63
+ },
64
+ babelOptions: {
65
+ babelrc: false,
66
+ configFile: false,
67
+ browserslistConfigFile: false,
68
+ presets: [require.resolve("@umijs/babel-preset-umi")]
69
+ },
70
+ requireConfigFile: false,
71
+ warnOnUnsupportedTypeScriptVersion: false
72
+ }
73
+ };
74
+ function detectJestVersion() {
75
+ try {
76
+ const pkg = require.resolve("jest/package.json", {
77
+ paths: [process.cwd()]
78
+ });
79
+ return require(pkg).version;
80
+ } catch {
81
+ return 29;
82
+ }
83
+ }
@@ -0,0 +1 @@
1
+ import './setup';
@@ -0,0 +1,61 @@
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(
16
+ // If the importer is in node compatibility mode or this is not an ESM
17
+ // file that has been converted to a CommonJS file using a Babel-
18
+ // compatible transform (i.e. "__esModule" has not been set), then set
19
+ // "default" to the CommonJS "module.exports" for node compatibility.
20
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
21
+ mod
22
+ ));
23
+
24
+ // src/config/eslint/legacy.ts
25
+ var import_fabric = __toESM(require("./rules/fabric"));
26
+ var import_setup = require("./setup");
27
+ module.exports = {
28
+ extends: ["prettier", "plugin:react/recommended"],
29
+ parser: require.resolve("@babel/eslint-parser"),
30
+ plugins: ["react", "react-hooks"],
31
+ env: {
32
+ browser: true,
33
+ node: true,
34
+ es6: true,
35
+ mocha: true,
36
+ jest: true,
37
+ jasmine: true
38
+ },
39
+ rules: import_fabric.default,
40
+ overrides: [
41
+ {
42
+ files: ["**/*.{ts,tsx}"],
43
+ parser: require.resolve("@typescript-eslint/parser"),
44
+ rules: import_fabric.typescript,
45
+ extends: ["prettier", "plugin:@typescript-eslint/recommended"]
46
+ }
47
+ ],
48
+ parserOptions: {
49
+ ecmaFeatures: {
50
+ jsx: true
51
+ },
52
+ babelOptions: {
53
+ babelrc: false,
54
+ configFile: false,
55
+ browserslistConfigFile: false,
56
+ presets: [require.resolve("@umijs/babel-preset-umi")]
57
+ },
58
+ requireConfigFile: false,
59
+ warnOnUnsupportedTypeScriptVersion: false
60
+ }
61
+ };
@@ -0,0 +1,86 @@
1
+ /**
2
+ * legay enabled/disabled rules from @umijs/fabric tsEslintConfig
3
+ * @see https://github.com/umijs/fabric/blob/master/src/tsEslintConfig.ts
4
+ */
5
+ export declare const typescript: {
6
+ 'no-dupe-class-members': number;
7
+ 'no-redeclare': number;
8
+ 'no-undef': number;
9
+ 'no-unused-vars': number;
10
+ '@typescript-eslint/adjacent-overload-signatures': number;
11
+ '@typescript-eslint/array-type': number;
12
+ '@typescript-eslint/await-thenable': number;
13
+ '@typescript-eslint/ban-ts-comment': number;
14
+ '@typescript-eslint/ban-types': number;
15
+ '@typescript-eslint/consistent-indexed-object-style': number;
16
+ '@typescript-eslint/consistent-type-imports': number;
17
+ '@typescript-eslint/dot-notation': number;
18
+ '@typescript-eslint/method-signature-style': number;
19
+ '@typescript-eslint/no-array-constructor': number;
20
+ '@typescript-eslint/no-confusing-non-null-assertion': number;
21
+ '@typescript-eslint/no-dupe-class-members': number;
22
+ '@typescript-eslint/no-empty-function': number;
23
+ '@typescript-eslint/no-empty-interface': number;
24
+ '@typescript-eslint/no-explicit-any': number;
25
+ '@typescript-eslint/no-extra-non-null-assertion': number;
26
+ '@typescript-eslint/no-floating-promises': number;
27
+ '@typescript-eslint/no-implied-eval': number;
28
+ '@typescript-eslint/no-inferrable-types': number;
29
+ '@typescript-eslint/no-invalid-this': number;
30
+ '@typescript-eslint/no-loop-func': number;
31
+ '@typescript-eslint/no-loss-of-precision': number;
32
+ '@typescript-eslint/no-misused-promises': number;
33
+ '@typescript-eslint/no-namespace': number;
34
+ '@typescript-eslint/no-non-null-assertion': number;
35
+ '@typescript-eslint/no-parameter-properties': number;
36
+ '@typescript-eslint/no-redeclare': number;
37
+ '@typescript-eslint/no-shadow': number;
38
+ '@typescript-eslint/no-throw-literal': number;
39
+ '@typescript-eslint/no-unnecessary-type-assertion': number;
40
+ '@typescript-eslint/no-unnecessary-type-constraint': number;
41
+ '@typescript-eslint/no-unsafe-assignment': number;
42
+ '@typescript-eslint/no-unsafe-call': number;
43
+ '@typescript-eslint/no-unsafe-member-access': number;
44
+ '@typescript-eslint/no-unsafe-return': number;
45
+ '@typescript-eslint/no-unused-expressions': number;
46
+ '@typescript-eslint/no-unused-vars': (string | {
47
+ vars: string;
48
+ args: string;
49
+ ignoreRestSiblings: boolean;
50
+ })[];
51
+ '@typescript-eslint/no-use-before-define': (string | {
52
+ functions: boolean;
53
+ classes: boolean;
54
+ variables: boolean;
55
+ typedefs: boolean;
56
+ })[];
57
+ '@typescript-eslint/no-useless-constructor': number;
58
+ '@typescript-eslint/no-var-requires': number;
59
+ '@typescript-eslint/prefer-as-const': number;
60
+ '@typescript-eslint/prefer-namespace-keyword': number;
61
+ '@typescript-eslint/require-await': number;
62
+ '@typescript-eslint/restrict-plus-operands': number;
63
+ '@typescript-eslint/restrict-template-expressions': number;
64
+ '@typescript-eslint/switch-exhaustiveness-check': number;
65
+ '@typescript-eslint/type-annotation-spacing': number;
66
+ '@typescript-eslint/typedef': number;
67
+ '@typescript-eslint/unbound-method': number;
68
+ '@typescript-eslint/unified-signatures': number;
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
+ declare const _default: {
75
+ 'no-param-reassign': number;
76
+ 'no-prototype-builtins': number;
77
+ 'react/display-name': number;
78
+ 'react/jsx-key': number;
79
+ 'react/no-array-index-key': number;
80
+ 'react/prop-types': number;
81
+ 'react/react-in-jsx-scope': number;
82
+ 'react/self-closing-comp': number;
83
+ 'react-hooks/exhaustive-deps': number;
84
+ 'react-hooks/rules-of-hooks': number;
85
+ };
86
+ export default _default;
@@ -0,0 +1,108 @@
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 });
8
+ };
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;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+
19
+ // src/config/eslint/rules/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
+ // eslint built-in rules
28
+ "no-dupe-class-members": 0,
29
+ "no-redeclare": 0,
30
+ "no-undef": 0,
31
+ "no-unused-vars": 0,
32
+ // @typescript-eslint rules
33
+ "@typescript-eslint/adjacent-overload-signatures": 0,
34
+ "@typescript-eslint/array-type": 2,
35
+ "@typescript-eslint/await-thenable": 0,
36
+ "@typescript-eslint/ban-ts-comment": 0,
37
+ "@typescript-eslint/ban-types": 1,
38
+ "@typescript-eslint/consistent-indexed-object-style": 1,
39
+ "@typescript-eslint/consistent-type-imports": 1,
40
+ "@typescript-eslint/dot-notation": 1,
41
+ "@typescript-eslint/method-signature-style": 2,
42
+ "@typescript-eslint/no-array-constructor": 0,
43
+ "@typescript-eslint/no-confusing-non-null-assertion": 2,
44
+ "@typescript-eslint/no-dupe-class-members": 2,
45
+ "@typescript-eslint/no-empty-function": 0,
46
+ "@typescript-eslint/no-empty-interface": 1,
47
+ "@typescript-eslint/no-explicit-any": 0,
48
+ "@typescript-eslint/no-extra-non-null-assertion": 0,
49
+ "@typescript-eslint/no-floating-promises": 0,
50
+ "@typescript-eslint/no-implied-eval": 0,
51
+ "@typescript-eslint/no-inferrable-types": 0,
52
+ "@typescript-eslint/no-invalid-this": 1,
53
+ "@typescript-eslint/no-loop-func": 2,
54
+ "@typescript-eslint/no-loss-of-precision": 0,
55
+ "@typescript-eslint/no-misused-promises": 0,
56
+ "@typescript-eslint/no-namespace": 1,
57
+ "@typescript-eslint/no-non-null-assertion": 0,
58
+ "@typescript-eslint/no-parameter-properties": 2,
59
+ "@typescript-eslint/no-redeclare": 2,
60
+ "@typescript-eslint/no-shadow": 2,
61
+ "@typescript-eslint/no-throw-literal": 2,
62
+ "@typescript-eslint/no-unnecessary-type-assertion": 0,
63
+ "@typescript-eslint/no-unnecessary-type-constraint": 0,
64
+ "@typescript-eslint/no-unsafe-assignment": 0,
65
+ "@typescript-eslint/no-unsafe-call": 0,
66
+ "@typescript-eslint/no-unsafe-member-access": 0,
67
+ "@typescript-eslint/no-unsafe-return": 0,
68
+ "@typescript-eslint/no-unused-expressions": 2,
69
+ "@typescript-eslint/no-unused-vars": [
70
+ "error",
71
+ { vars: "all", args: "after-used", ignoreRestSiblings: true }
72
+ ],
73
+ "@typescript-eslint/no-use-before-define": [
74
+ "error",
75
+ { functions: false, classes: true, variables: true, typedefs: true }
76
+ ],
77
+ "@typescript-eslint/no-useless-constructor": 2,
78
+ "@typescript-eslint/no-var-requires": 0,
79
+ "@typescript-eslint/prefer-as-const": 0,
80
+ "@typescript-eslint/prefer-namespace-keyword": 0,
81
+ "@typescript-eslint/require-await": 0,
82
+ "@typescript-eslint/restrict-plus-operands": 0,
83
+ "@typescript-eslint/restrict-template-expressions": 0,
84
+ "@typescript-eslint/switch-exhaustiveness-check": 2,
85
+ "@typescript-eslint/type-annotation-spacing": 2,
86
+ "@typescript-eslint/typedef": 2,
87
+ "@typescript-eslint/unbound-method": 0,
88
+ "@typescript-eslint/unified-signatures": 2
89
+ };
90
+ var fabric_default = {
91
+ // eslint built-in rules
92
+ "no-param-reassign": 2,
93
+ "no-prototype-builtins": 0,
94
+ // eslint-plugin-react rules
95
+ "react/display-name": 0,
96
+ "react/jsx-key": 1,
97
+ "react/no-array-index-key": 1,
98
+ "react/prop-types": 0,
99
+ "react/react-in-jsx-scope": 0,
100
+ "react/self-closing-comp": 1,
101
+ // eslint-pluginr-react-hooks rules
102
+ "react-hooks/exhaustive-deps": 1,
103
+ "react-hooks/rules-of-hooks": 2
104
+ };
105
+ // Annotate the CommonJS export names for ESM import in node:
106
+ 0 && (module.exports = {
107
+ typescript
108
+ });
@@ -0,0 +1,96 @@
1
+ /**
2
+ * recommended enabled/disabled rules for umi project
3
+ * @note base on recommended rule set from loaded eslint plugins
4
+ */
5
+ declare const _default: {
6
+ 'array-callback-return': number;
7
+ eqeqeq: number;
8
+ 'for-direction': number;
9
+ 'guard-for-in': number;
10
+ 'no-async-promise-executor': number;
11
+ 'no-case-declarations': number;
12
+ 'no-debugger': number;
13
+ 'no-delete-var': number;
14
+ 'no-dupe-else-if': number;
15
+ 'no-duplicate-case': number;
16
+ 'no-eval': number;
17
+ 'no-ex-assign': number;
18
+ 'no-global-assign': number;
19
+ 'no-invalid-regexp': number;
20
+ 'no-native-reassign': number;
21
+ 'no-param-reassign': number;
22
+ 'no-promise-executor-return': number;
23
+ 'no-self-assign': number;
24
+ 'no-self-compare': number;
25
+ 'no-shadow-restricted-names': number;
26
+ 'no-sparse-arrays': number;
27
+ 'no-unsafe-finally': number;
28
+ 'no-unused-labels': number;
29
+ 'no-useless-catch': number;
30
+ 'no-useless-escape': number;
31
+ 'no-var': number;
32
+ 'no-with': number;
33
+ 'require-yield': number;
34
+ 'use-isnan': number;
35
+ 'react/button-has-type': number;
36
+ 'react/jsx-key': number;
37
+ 'react/jsx-no-comment-textnodes': number;
38
+ 'react/jsx-no-duplicate-props': number;
39
+ 'react/jsx-no-target-blank': number;
40
+ 'react/jsx-no-undef': number;
41
+ 'react/jsx-uses-react': number;
42
+ 'react/jsx-uses-vars': number;
43
+ 'react/no-children-prop': number;
44
+ 'react/no-danger-with-children': number;
45
+ 'react/no-deprecated': number;
46
+ 'react/no-direct-mutation-state': number;
47
+ 'react/no-find-dom-node': number;
48
+ 'react/no-is-mounted': number;
49
+ 'react/no-string-refs': number;
50
+ 'react/no-render-return-value': number;
51
+ 'react/no-unescaped-entities': number;
52
+ 'react/no-unknown-property': number;
53
+ 'react/require-render-return': number;
54
+ 'react-hooks/rules-of-hooks': number;
55
+ };
56
+ export default _default;
57
+ /**
58
+ * config-plugin-jest rules
59
+ */
60
+ export declare const jest: {
61
+ 'jest/no-conditional-expect': number;
62
+ 'jest/no-deprecated-functions': number;
63
+ 'jest/no-export': number;
64
+ 'jest/no-focused-tests': number;
65
+ 'jest/no-identical-title': number;
66
+ 'jest/no-interpolation-in-snapshots': number;
67
+ 'jest/no-jasmine-globals': number;
68
+ 'jest/no-mocks-import': number;
69
+ 'jest/no-standalone-expect': number;
70
+ 'jest/valid-describe-callback': number;
71
+ 'jest/valid-expect-in-promise': number;
72
+ 'jest/valid-expect': number;
73
+ 'jest/valid-title': number;
74
+ };
75
+ /**
76
+ * recommended enabled/disabled rules for typescript umi project
77
+ * @note base on recommended rule set from loaded eslint plugins
78
+ */
79
+ export declare const typescript: {
80
+ '@typescript-eslint/ban-types': number;
81
+ '@typescript-eslint/no-confusing-non-null-assertion': number;
82
+ '@typescript-eslint/no-dupe-class-members': number;
83
+ '@typescript-eslint/no-empty-interface': number;
84
+ '@typescript-eslint/no-invalid-this': number;
85
+ '@typescript-eslint/no-loop-func': number;
86
+ '@typescript-eslint/no-misused-new': number;
87
+ '@typescript-eslint/no-namespace': number;
88
+ '@typescript-eslint/no-non-null-asserted-optional-chain': number;
89
+ '@typescript-eslint/no-redeclare': number;
90
+ '@typescript-eslint/no-this-alias': number;
91
+ '@typescript-eslint/no-unused-expressions': number;
92
+ '@typescript-eslint/no-unused-vars': number;
93
+ '@typescript-eslint/no-use-before-define': number;
94
+ '@typescript-eslint/no-useless-constructor': number;
95
+ '@typescript-eslint/triple-slash-reference': number;
96
+ };
@@ -0,0 +1,127 @@
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 });
8
+ };
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;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+
19
+ // src/config/eslint/rules/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
+ // eslint built-in rules
29
+ // 不需要返回就用 forEach
30
+ "array-callback-return": 2,
31
+ // eqeq 可能导致潜在的类型转换问题
32
+ eqeqeq: 2,
33
+ "for-direction": 2,
34
+ // 不加 hasOwnProperty 判断会多出原型链的内容
35
+ "guard-for-in": 2,
36
+ "no-async-promise-executor": 2,
37
+ "no-case-declarations": 2,
38
+ "no-debugger": 2,
39
+ "no-delete-var": 2,
40
+ "no-dupe-else-if": 2,
41
+ "no-duplicate-case": 2,
42
+ // eval()可能导致潜在的安全问题
43
+ "no-eval": 2,
44
+ "no-ex-assign": 2,
45
+ "no-global-assign": 2,
46
+ "no-invalid-regexp": 2,
47
+ // 没必要改 native 变量
48
+ "no-native-reassign": 2,
49
+ // 修改对象时,会影响原对象;但是有些场景就是有目的
50
+ "no-param-reassign": 2,
51
+ // return 值无意义,可能会理解为 resolve
52
+ "no-promise-executor-return": 2,
53
+ "no-self-assign": 2,
54
+ "no-self-compare": 2,
55
+ "no-shadow-restricted-names": 2,
56
+ "no-sparse-arrays": 2,
57
+ "no-unsafe-finally": 2,
58
+ "no-unused-labels": 2,
59
+ "no-useless-catch": 2,
60
+ "no-useless-escape": 2,
61
+ "no-var": 2,
62
+ "no-with": 2,
63
+ "require-yield": 2,
64
+ "use-isnan": 2,
65
+ // config-plugin-react rules
66
+ // button 自带 submit 属性
67
+ "react/button-has-type": 2,
68
+ "react/jsx-key": 2,
69
+ "react/jsx-no-comment-textnodes": 2,
70
+ "react/jsx-no-duplicate-props": 2,
71
+ "react/jsx-no-target-blank": 2,
72
+ "react/jsx-no-undef": 2,
73
+ "react/jsx-uses-react": 2,
74
+ "react/jsx-uses-vars": 2,
75
+ "react/no-children-prop": 2,
76
+ "react/no-danger-with-children": 2,
77
+ "react/no-deprecated": 2,
78
+ "react/no-direct-mutation-state": 2,
79
+ "react/no-find-dom-node": 2,
80
+ "react/no-is-mounted": 2,
81
+ "react/no-string-refs": 2,
82
+ "react/no-render-return-value": 2,
83
+ "react/no-unescaped-entities": 2,
84
+ "react/no-unknown-property": 2,
85
+ "react/require-render-return": 2,
86
+ // config-plugin-react-hooks rules
87
+ "react-hooks/rules-of-hooks": 2
88
+ };
89
+ var jest = {
90
+ "jest/no-conditional-expect": 2,
91
+ "jest/no-deprecated-functions": 2,
92
+ "jest/no-export": 2,
93
+ "jest/no-focused-tests": 2,
94
+ "jest/no-identical-title": 2,
95
+ "jest/no-interpolation-in-snapshots": 2,
96
+ "jest/no-jasmine-globals": 2,
97
+ "jest/no-mocks-import": 2,
98
+ "jest/no-standalone-expect": 2,
99
+ "jest/valid-describe-callback": 2,
100
+ "jest/valid-expect-in-promise": 2,
101
+ "jest/valid-expect": 2,
102
+ "jest/valid-title": 2
103
+ };
104
+ var typescript = {
105
+ // config-plugin-typescript rules
106
+ "@typescript-eslint/ban-types": 2,
107
+ "@typescript-eslint/no-confusing-non-null-assertion": 2,
108
+ "@typescript-eslint/no-dupe-class-members": 2,
109
+ "@typescript-eslint/no-empty-interface": 2,
110
+ "@typescript-eslint/no-invalid-this": 2,
111
+ "@typescript-eslint/no-loop-func": 2,
112
+ "@typescript-eslint/no-misused-new": 2,
113
+ "@typescript-eslint/no-namespace": 2,
114
+ "@typescript-eslint/no-non-null-asserted-optional-chain": 2,
115
+ "@typescript-eslint/no-redeclare": 2,
116
+ "@typescript-eslint/no-this-alias": 2,
117
+ "@typescript-eslint/no-unused-expressions": 2,
118
+ "@typescript-eslint/no-unused-vars": 2,
119
+ "@typescript-eslint/no-use-before-define": 2,
120
+ "@typescript-eslint/no-useless-constructor": 2,
121
+ "@typescript-eslint/triple-slash-reference": 2
122
+ };
123
+ // Annotate the CommonJS export names for ESM import in node:
124
+ 0 && (module.exports = {
125
+ jest,
126
+ typescript
127
+ });
File without changes
@@ -0,0 +1,2 @@
1
+ // src/config/eslint/setup.ts
2
+ require("../../../compiled/@rushstack/eslint-patch/lib/modern-module-resolution.js");
File without changes
@@ -0,0 +1,74 @@
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(
16
+ // If the importer is in node compatibility mode or this is not an ESM
17
+ // file that has been converted to a CommonJS file using a Babel-
18
+ // compatible transform (i.e. "__esModule" has not been set), then set
19
+ // "default" to the CommonJS "module.exports" for node compatibility.
20
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
21
+ mod
22
+ ));
23
+
24
+ // src/config/stylelint/index.ts
25
+ module.exports = {
26
+ extends: [
27
+ require.resolve("stylelint-config-standard"),
28
+ require.resolve("../../../compiled/stylelint-config-prettier"),
29
+ require.resolve("../../../compiled/stylelint-config-css-modules")
30
+ ],
31
+ plugins: [
32
+ require.resolve("../../../compiled/stylelint-declaration-block-no-ignored-properties")
33
+ ],
34
+ rules: {
35
+ "no-descending-specificity": null,
36
+ "function-url-quotes": "always",
37
+ "selector-attribute-quotes": "always",
38
+ "font-family-no-missing-generic-family-keyword": null,
39
+ // iconfont
40
+ "plugin/declaration-block-no-ignored-properties": true,
41
+ "unit-no-unknown": [true, { ignoreUnits: ["rpx"] }],
42
+ // webcomponent
43
+ "selector-type-no-unknown": null,
44
+ "value-keyword-case": ["lower", { ignoreProperties: ["composes"] }],
45
+ "selector-class-pattern": [
46
+ "^([a-z][a-z0-9]*(-[a-z0-9]+)*|[a-z][a-zA-Z0-9]+)$",
47
+ {
48
+ message: "Expected class selector to be kebab-case or lowerCamelCase"
49
+ }
50
+ ],
51
+ // to avoid conflicts with less option { math: always }
52
+ // ref: https://github.com/less/less-docs/blob/c8b9d33b0b4ec5fe59a4bbda11db202545741228/content/usage/less-options.md#math
53
+ "color-function-notation": null,
54
+ // disallowed set single font-family as PingFangSC
55
+ // in most cases, this font-family rule is copied unconsciously from Sketch
56
+ // and it will cause an unexpected font rendering on the devices that have no PingFangSC font
57
+ "declaration-property-value-disallowed-list": [
58
+ {
59
+ "font-family": `/^('|")?PingFangSC(-(Regular|Medium|Semibold|Bold))?\\1$/`
60
+ },
61
+ {
62
+ message: 'Unexpected value for property "font-family", which will cause some devices to render the wrong font, please delete this "font-family" css rule, see also: https://github.com/umijs/umi/pull/11001'
63
+ }
64
+ ]
65
+ },
66
+ customSyntax: require.resolve("../../../compiled/postcss-less"),
67
+ ignoreFiles: ["node_modules"],
68
+ overrides: [
69
+ {
70
+ files: ["**/*.js", "**/*.jsx", "**/*.ts", "**/*.tsx"],
71
+ customSyntax: require.resolve("@stylelint/postcss-css-in-js")
72
+ }
73
+ ]
74
+ };
@@ -0,0 +1,4 @@
1
+ import type { ILintArgs, ILinterOpts } from './types';
2
+ export type { ILintArgs, ILinterOpts };
3
+ declare const _default: (opts: ILinterOpts, args: ILintArgs) => void;
4
+ export default _default;