@umijs/lint 4.0.51 → 4.0.53

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.
@@ -13,6 +13,10 @@ var __copyProps = (to, from, except, desc) => {
13
13
  return to;
14
14
  };
15
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.
16
20
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
17
21
  mod
18
22
  ));
@@ -13,6 +13,10 @@ var __copyProps = (to, from, except, desc) => {
13
13
  return to;
14
14
  };
15
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.
16
20
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
17
21
  mod
18
22
  ));
@@ -24,10 +24,12 @@ __export(fabric_exports, {
24
24
  });
25
25
  module.exports = __toCommonJS(fabric_exports);
26
26
  var typescript = {
27
+ // eslint built-in rules
27
28
  "no-dupe-class-members": 0,
28
29
  "no-redeclare": 0,
29
30
  "no-undef": 0,
30
31
  "no-unused-vars": 0,
32
+ // @typescript-eslint rules
31
33
  "@typescript-eslint/adjacent-overload-signatures": 0,
32
34
  "@typescript-eslint/array-type": 2,
33
35
  "@typescript-eslint/await-thenable": 0,
@@ -86,14 +88,17 @@ var typescript = {
86
88
  "@typescript-eslint/unified-signatures": 2
87
89
  };
88
90
  var fabric_default = {
91
+ // eslint built-in rules
89
92
  "no-param-reassign": 2,
90
93
  "no-prototype-builtins": 0,
94
+ // eslint-plugin-react rules
91
95
  "react/display-name": 0,
92
96
  "react/jsx-key": 1,
93
97
  "react/no-array-index-key": 1,
94
98
  "react/prop-types": 0,
95
99
  "react/react-in-jsx-scope": 0,
96
100
  "react/self-closing-comp": 1,
101
+ // eslint-pluginr-react-hooks rules
97
102
  "react-hooks/exhaustive-deps": 1,
98
103
  "react-hooks/rules-of-hooks": 2
99
104
  };
@@ -25,9 +25,13 @@ __export(recommended_exports, {
25
25
  });
26
26
  module.exports = __toCommonJS(recommended_exports);
27
27
  var recommended_default = {
28
+ // eslint built-in rules
29
+ // 不需要返回就用 forEach
28
30
  "array-callback-return": 2,
31
+ // eqeq 可能导致潜在的类型转换问题
29
32
  eqeqeq: 2,
30
33
  "for-direction": 2,
34
+ // 不加 hasOwnProperty 判断会多出原型链的内容
31
35
  "guard-for-in": 2,
32
36
  "no-async-promise-executor": 2,
33
37
  "no-case-declarations": 2,
@@ -35,12 +39,16 @@ var recommended_default = {
35
39
  "no-delete-var": 2,
36
40
  "no-dupe-else-if": 2,
37
41
  "no-duplicate-case": 2,
42
+ // eval()可能导致潜在的安全问题
38
43
  "no-eval": 2,
39
44
  "no-ex-assign": 2,
40
45
  "no-global-assign": 2,
41
46
  "no-invalid-regexp": 2,
47
+ // 没必要改 native 变量
42
48
  "no-native-reassign": 2,
49
+ // 修改对象时,会影响原对象;但是有些场景就是有目的
43
50
  "no-param-reassign": 2,
51
+ // return 值无意义,可能会理解为 resolve
44
52
  "no-promise-executor-return": 2,
45
53
  "no-self-assign": 2,
46
54
  "no-self-compare": 2,
@@ -54,6 +62,8 @@ var recommended_default = {
54
62
  "no-with": 2,
55
63
  "require-yield": 2,
56
64
  "use-isnan": 2,
65
+ // config-plugin-react rules
66
+ // button 自带 submit 属性
57
67
  "react/button-has-type": 2,
58
68
  "react/jsx-key": 2,
59
69
  "react/jsx-no-comment-textnodes": 2,
@@ -73,6 +83,7 @@ var recommended_default = {
73
83
  "react/no-unescaped-entities": 2,
74
84
  "react/no-unknown-property": 2,
75
85
  "react/require-render-return": 2,
86
+ // config-plugin-react-hooks rules
76
87
  "react-hooks/rules-of-hooks": 2
77
88
  };
78
89
  var jest = {
@@ -92,6 +103,7 @@ var jest = {
92
103
  "jest/valid-title": 2
93
104
  };
94
105
  var typescript = {
106
+ // config-plugin-typescript rules
95
107
  "@typescript-eslint/ban-types": 2,
96
108
  "@typescript-eslint/no-confusing-non-null-assertion": 2,
97
109
  "@typescript-eslint/no-dupe-class-members": 2,
@@ -13,6 +13,10 @@ var __copyProps = (to, from, except, desc) => {
13
13
  return to;
14
14
  };
15
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.
16
20
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
17
21
  mod
18
22
  ));
@@ -32,8 +36,10 @@ module.exports = {
32
36
  "function-url-quotes": "always",
33
37
  "selector-attribute-quotes": "always",
34
38
  "font-family-no-missing-generic-family-keyword": null,
39
+ // iconfont
35
40
  "plugin/declaration-block-no-ignored-properties": true,
36
41
  "unit-no-unknown": [true, { ignoreUnits: ["rpx"] }],
42
+ // webcomponent
37
43
  "selector-type-no-unknown": null,
38
44
  "value-keyword-case": ["lower", { ignoreProperties: ["composes"] }],
39
45
  "selector-class-pattern": [
@@ -17,6 +17,10 @@ var __copyProps = (to, from, except, desc) => {
17
17
  return to;
18
18
  };
19
19
  var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
+ // If the importer is in node compatibility mode or this is not an ESM
21
+ // file that has been converted to a CommonJS file using a Babel-
22
+ // compatible transform (i.e. "__esModule" has not been set), then set
23
+ // "default" to the CommonJS "module.exports" for node compatibility.
20
24
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
21
25
  mod
22
26
  ));
@@ -32,10 +36,19 @@ var import_child_process = require("child_process");
32
36
  var import_path = __toESM(require("path"));
33
37
  var BaseLinter = class {
34
38
  constructor({ cwd }) {
39
+ /**
40
+ * linter package name
41
+ */
35
42
  this.linter = "";
43
+ /**
44
+ * paths for linter
45
+ */
36
46
  this.paths = {};
37
47
  this.paths.cwd = cwd;
38
48
  }
49
+ /**
50
+ * get bin file path for current linter
51
+ */
39
52
  getBinPath() {
40
53
  try {
41
54
  const pkgPath = require.resolve(`${this.linter}/package.json`);
@@ -47,10 +60,16 @@ var BaseLinter = class {
47
60
  });
48
61
  }
49
62
  }
63
+ /**
64
+ * get linter fork args
65
+ */
50
66
  getRunArgs(args) {
51
67
  args;
52
68
  return [];
53
69
  }
70
+ /**
71
+ * execute linter
72
+ */
54
73
  run(args) {
55
74
  (0, import_child_process.fork)(this.getBinPath(), this.getRunArgs(args)).on("exit", (code) => {
56
75
  if (!!code) {
@@ -17,6 +17,10 @@ var __copyProps = (to, from, except, desc) => {
17
17
  return to;
18
18
  };
19
19
  var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
+ // If the importer is in node compatibility mode or this is not an ESM
21
+ // file that has been converted to a CommonJS file using a Babel-
22
+ // compatible transform (i.e. "__esModule" has not been set), then set
23
+ // "default" to the CommonJS "module.exports" for node compatibility.
20
24
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
21
25
  mod
22
26
  ));
@@ -17,6 +17,10 @@ var __copyProps = (to, from, except, desc) => {
17
17
  return to;
18
18
  };
19
19
  var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
+ // If the importer is in node compatibility mode or this is not an ESM
21
+ // file that has been converted to a CommonJS file using a Babel-
22
+ // compatible transform (i.e. "__esModule" has not been set), then set
23
+ // "default" to the CommonJS "module.exports" for node compatibility.
20
24
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
21
25
  mod
22
26
  ));
@@ -17,6 +17,10 @@ var __copyProps = (to, from, except, desc) => {
17
17
  return to;
18
18
  };
19
19
  var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
+ // If the importer is in node compatibility mode or this is not an ESM
21
+ // file that has been converted to a CommonJS file using a Babel-
22
+ // compatible transform (i.e. "__esModule" has not been set), then set
23
+ // "default" to the CommonJS "module.exports" for node compatibility.
20
24
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
21
25
  mod
22
26
  ));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@umijs/lint",
3
- "version": "4.0.51",
3
+ "version": "4.0.53",
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",
@@ -26,7 +26,7 @@
26
26
  "@stylelint/postcss-css-in-js": "^0.38.0",
27
27
  "@typescript-eslint/eslint-plugin": "5.48.1",
28
28
  "@typescript-eslint/parser": "5.48.1",
29
- "@umijs/babel-preset-umi": "4.0.51",
29
+ "@umijs/babel-preset-umi": "4.0.53",
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",