@lsby/eslint-config 0.2.0 → 0.2.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.
- package/dist/cjs/index.cjs +57 -54
- package/dist/cjs/index.d.cts +3 -2
- package/dist/esm/index.d.ts +3 -2
- package/dist/esm/index.js +52 -54
- package/package.json +2 -2
package/dist/cjs/index.cjs
CHANGED
@@ -30,65 +30,68 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
30
30
|
// src/index.ts
|
31
31
|
var src_exports = {};
|
32
32
|
__export(src_exports, {
|
33
|
-
|
33
|
+
\u57FA\u7840ts\u89C4\u5219: () => \u57FA\u7840ts\u89C4\u5219,
|
34
|
+
\u5FFD\u7565\u5E38\u89C1\u6587\u4EF6\u5939: () => \u5FFD\u7565\u5E38\u89C1\u6587\u4EF6\u5939
|
34
35
|
});
|
35
36
|
module.exports = __toCommonJS(src_exports);
|
36
37
|
var import_eslint_plugin = __toESM(require("@typescript-eslint/eslint-plugin"), 1);
|
37
38
|
var import_parser = __toESM(require("@typescript-eslint/parser"), 1);
|
38
39
|
var import_eslint_plugin_jsdoc = __toESM(require("eslint-plugin-jsdoc"), 1);
|
39
40
|
var import_eslint_plugin_sort_class_members = __toESM(require("eslint-plugin-sort-class-members"), 1);
|
40
|
-
var
|
41
|
-
|
42
|
-
|
41
|
+
var \u5FFD\u7565\u5E38\u89C1\u6587\u4EF6\u5939 = {
|
42
|
+
ignores: ["node_modules", "dist", "coverage", "out"]
|
43
|
+
};
|
44
|
+
var \u57FA\u7840ts\u89C4\u5219 = {
|
45
|
+
files: ["src/**/*.ts", "src/**/*.tsx", "test/**/*.ts", "test/**/*.tsx"],
|
46
|
+
languageOptions: {
|
47
|
+
parser: import_parser.default,
|
48
|
+
parserOptions: { project: true }
|
49
|
+
},
|
50
|
+
plugins: {
|
51
|
+
jsdoc: import_eslint_plugin_jsdoc.default,
|
52
|
+
"@typescript-eslint": import_eslint_plugin.default.configs,
|
53
|
+
"sort-class-members": import_eslint_plugin_sort_class_members.default
|
43
54
|
},
|
44
|
-
{
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
},
|
55
|
-
|
56
|
-
|
57
|
-
"
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
"[static-properties]",
|
81
|
-
"[static-methods]",
|
82
|
-
"[properties]",
|
83
|
-
"[conventional-private-properties]",
|
84
|
-
"constructor",
|
85
|
-
"[methods]",
|
86
|
-
"[conventional-private-methods]"
|
87
|
-
],
|
88
|
-
accessorPairPositioning: "getThenSet"
|
89
|
-
}
|
90
|
-
]
|
91
|
-
}
|
55
|
+
rules: {
|
56
|
+
// jsdoc的link必须存在
|
57
|
+
"jsdoc/no-undefined-types": "error",
|
58
|
+
// 拒绝any
|
59
|
+
"@typescript-eslint/no-unsafe-assignment": "error",
|
60
|
+
// 检查无意义的比较
|
61
|
+
"@typescript-eslint/no-unnecessary-condition": ["error", { allowConstantLoopConditions: true }],
|
62
|
+
// 拒绝浮动promise
|
63
|
+
"@typescript-eslint/no-floating-promises": "error",
|
64
|
+
// 必须标注函数返回类型
|
65
|
+
"@typescript-eslint/explicit-function-return-type": ["error", {}],
|
66
|
+
// 检查没有使用的变量
|
67
|
+
"@typescript-eslint/no-unused-vars": [
|
68
|
+
"warn",
|
69
|
+
{
|
70
|
+
varsIgnorePattern: "^_",
|
71
|
+
argsIgnorePattern: "^_",
|
72
|
+
destructuredArrayIgnorePattern: "^_"
|
73
|
+
}
|
74
|
+
],
|
75
|
+
// 排序类属性
|
76
|
+
"sort-class-members/sort-class-members": [
|
77
|
+
2,
|
78
|
+
{
|
79
|
+
order: [
|
80
|
+
"[static-properties]",
|
81
|
+
"[static-methods]",
|
82
|
+
"[properties]",
|
83
|
+
"[conventional-private-properties]",
|
84
|
+
"constructor",
|
85
|
+
"[methods]",
|
86
|
+
"[conventional-private-methods]"
|
87
|
+
],
|
88
|
+
accessorPairPositioning: "getThenSet"
|
89
|
+
}
|
90
|
+
]
|
92
91
|
}
|
93
|
-
|
94
|
-
|
92
|
+
};
|
93
|
+
// Annotate the CommonJS export names for ESM import in node:
|
94
|
+
0 && (module.exports = {
|
95
|
+
\u57FA\u7840ts\u89C4\u5219,
|
96
|
+
\u5FFD\u7565\u5E38\u89C1\u6587\u4EF6\u5939
|
97
|
+
});
|
package/dist/cjs/index.d.cts
CHANGED
package/dist/esm/index.d.ts
CHANGED
package/dist/esm/index.js
CHANGED
@@ -3,61 +3,59 @@ import typescriptEslintPlugin from "@typescript-eslint/eslint-plugin";
|
|
3
3
|
import typescriptEslintParser from "@typescript-eslint/parser";
|
4
4
|
import jsdoc from "eslint-plugin-jsdoc";
|
5
5
|
import sortClassMembers from "eslint-plugin-sort-class-members";
|
6
|
-
var
|
7
|
-
|
8
|
-
|
6
|
+
var \u5FFD\u7565\u5E38\u89C1\u6587\u4EF6\u5939 = {
|
7
|
+
ignores: ["node_modules", "dist", "coverage", "out"]
|
8
|
+
};
|
9
|
+
var \u57FA\u7840ts\u89C4\u5219 = {
|
10
|
+
files: ["src/**/*.ts", "src/**/*.tsx", "test/**/*.ts", "test/**/*.tsx"],
|
11
|
+
languageOptions: {
|
12
|
+
parser: typescriptEslintParser,
|
13
|
+
parserOptions: { project: true }
|
14
|
+
},
|
15
|
+
plugins: {
|
16
|
+
jsdoc,
|
17
|
+
"@typescript-eslint": typescriptEslintPlugin.configs,
|
18
|
+
"sort-class-members": sortClassMembers
|
9
19
|
},
|
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
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
"[static-properties]",
|
47
|
-
"[static-methods]",
|
48
|
-
"[properties]",
|
49
|
-
"[conventional-private-properties]",
|
50
|
-
"constructor",
|
51
|
-
"[methods]",
|
52
|
-
"[conventional-private-methods]"
|
53
|
-
],
|
54
|
-
accessorPairPositioning: "getThenSet"
|
55
|
-
}
|
56
|
-
]
|
57
|
-
}
|
20
|
+
rules: {
|
21
|
+
// jsdoc的link必须存在
|
22
|
+
"jsdoc/no-undefined-types": "error",
|
23
|
+
// 拒绝any
|
24
|
+
"@typescript-eslint/no-unsafe-assignment": "error",
|
25
|
+
// 检查无意义的比较
|
26
|
+
"@typescript-eslint/no-unnecessary-condition": ["error", { allowConstantLoopConditions: true }],
|
27
|
+
// 拒绝浮动promise
|
28
|
+
"@typescript-eslint/no-floating-promises": "error",
|
29
|
+
// 必须标注函数返回类型
|
30
|
+
"@typescript-eslint/explicit-function-return-type": ["error", {}],
|
31
|
+
// 检查没有使用的变量
|
32
|
+
"@typescript-eslint/no-unused-vars": [
|
33
|
+
"warn",
|
34
|
+
{
|
35
|
+
varsIgnorePattern: "^_",
|
36
|
+
argsIgnorePattern: "^_",
|
37
|
+
destructuredArrayIgnorePattern: "^_"
|
38
|
+
}
|
39
|
+
],
|
40
|
+
// 排序类属性
|
41
|
+
"sort-class-members/sort-class-members": [
|
42
|
+
2,
|
43
|
+
{
|
44
|
+
order: [
|
45
|
+
"[static-properties]",
|
46
|
+
"[static-methods]",
|
47
|
+
"[properties]",
|
48
|
+
"[conventional-private-properties]",
|
49
|
+
"constructor",
|
50
|
+
"[methods]",
|
51
|
+
"[conventional-private-methods]"
|
52
|
+
],
|
53
|
+
accessorPairPositioning: "getThenSet"
|
54
|
+
}
|
55
|
+
]
|
58
56
|
}
|
59
|
-
|
60
|
-
var src_default = config;
|
57
|
+
};
|
61
58
|
export {
|
62
|
-
|
59
|
+
\u57FA\u7840ts\u89C4\u5219,
|
60
|
+
\u5FFD\u7565\u5E38\u89C1\u6587\u4EF6\u5939
|
63
61
|
};
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@lsby/eslint-config",
|
3
|
-
"version": "0.2.
|
3
|
+
"version": "0.2.1",
|
4
4
|
"type": "module",
|
5
5
|
"main": "dist/index.js",
|
6
6
|
"files": [
|
@@ -15,7 +15,7 @@
|
|
15
15
|
"check:type": "tsc --noEmit",
|
16
16
|
"check:type:watch": "tsc --noEmit -w",
|
17
17
|
"prepare": "husky",
|
18
|
-
"pub:public": "bumpp && npm publish --access public"
|
18
|
+
"pub:public": "npm run check:all && npm run build:all && bumpp && npm publish --access public"
|
19
19
|
},
|
20
20
|
"dependencies": {},
|
21
21
|
"devDependencies": {
|