@simplysm/eslint-plugin 7.3.2 → 10.0.4
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/.eslintrc.cjs +1 -0
- package/package.json +8 -15
- package/src/configs/base.cjs +2 -2
- package/src/configs/typescript.cjs +4 -4
- package/src/index.cjs +2 -5
- package/src/rules/ts-no-self-entry-import.cjs +1 -1
- package/src/configs/angular-template.cjs +0 -10
- package/src/configs/angular.cjs +0 -5
- package/src/rules/ng-template-no-todo-comments.cjs +0 -45
package/.eslintrc.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = {};
|
package/package.json
CHANGED
|
@@ -1,35 +1,28 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@simplysm/eslint-plugin",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "10.0.4",
|
|
4
4
|
"description": "심플리즘 패키지 - ESLINT 플러그인",
|
|
5
5
|
"author": "김석래",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
8
|
-
"url": "https://github.com/kslhunter/
|
|
8
|
+
"url": "https://github.com/kslhunter/simplysm10.git",
|
|
9
9
|
"directory": "packages/eslint-plugin"
|
|
10
10
|
},
|
|
11
11
|
"license": "MIT",
|
|
12
12
|
"type": "module",
|
|
13
13
|
"main": "src/index.cjs",
|
|
14
|
-
"sideEffects": false,
|
|
15
14
|
"engines": {
|
|
16
|
-
"node": "^
|
|
15
|
+
"node": "^20"
|
|
17
16
|
},
|
|
18
|
-
"files": [
|
|
19
|
-
"**/*"
|
|
20
|
-
],
|
|
21
17
|
"dependencies": {
|
|
22
|
-
"@
|
|
23
|
-
"@
|
|
24
|
-
"@
|
|
25
|
-
"
|
|
26
|
-
"@typescript-eslint/experimental-utils": "5.59.11",
|
|
27
|
-
"@typescript-eslint/parser": "5.59.11",
|
|
28
|
-
"eslint": "^8.42.0",
|
|
18
|
+
"@typescript-eslint/eslint-plugin": "^5.60.1",
|
|
19
|
+
"@typescript-eslint/experimental-utils": "^5.60.1",
|
|
20
|
+
"@typescript-eslint/parser": "^5.60.1",
|
|
21
|
+
"eslint": "^8.43.0",
|
|
29
22
|
"eslint-import-resolver-typescript": "^3.5.5",
|
|
30
23
|
"eslint-module-utils": "^2.8.0",
|
|
31
24
|
"eslint-plugin-deprecation": "^1.4.1",
|
|
32
25
|
"eslint-plugin-import": "^2.27.5",
|
|
33
|
-
"typescript": "
|
|
26
|
+
"typescript": "^4.9.5"
|
|
34
27
|
}
|
|
35
28
|
}
|
package/src/configs/base.cjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
module.exports = {
|
|
2
2
|
env: {
|
|
3
3
|
node: true,
|
|
4
|
-
|
|
4
|
+
es2021: true
|
|
5
5
|
},
|
|
6
6
|
plugins: ["import"],
|
|
7
7
|
rules: {
|
|
8
8
|
// import
|
|
9
|
-
|
|
9
|
+
"import/no-extraneous-dependencies": ["error"], // 느림
|
|
10
10
|
|
|
11
11
|
"no-console": ["warn"],
|
|
12
12
|
"no-warning-comments": ["warn"],
|
|
@@ -18,10 +18,10 @@ module.exports = {
|
|
|
18
18
|
"linebreak-style": ["error", "unix"],
|
|
19
19
|
|
|
20
20
|
// Deprecation
|
|
21
|
-
|
|
21
|
+
"deprecation/deprecation": ["warn"], // 느림
|
|
22
22
|
|
|
23
23
|
// import
|
|
24
|
-
|
|
24
|
+
"import/no-extraneous-dependencies": ["error"], // 느림
|
|
25
25
|
|
|
26
26
|
// 심플리즘
|
|
27
27
|
"@simplysm/ts-no-throw-not-implement-error": ["warn"],
|
|
@@ -34,9 +34,9 @@ module.exports = {
|
|
|
34
34
|
"@typescript-eslint/quotes": ["error", "double", { avoidEscape: true, allowTemplateLiterals: true }],
|
|
35
35
|
"@typescript-eslint/semi": ["error"],
|
|
36
36
|
"@typescript-eslint/no-shadow": ["error"],
|
|
37
|
-
"@typescript-eslint/member-delimiter-style": ["error"],
|
|
37
|
+
// "@typescript-eslint/member-delimiter-style": ["error"],
|
|
38
38
|
// "@typescript-eslint/no-unnecessary-condition": ["error", { allowConstantLoopConditions: true }],
|
|
39
|
-
"@typescript-eslint/no-unnecessary-type-assertion": ["error"],
|
|
39
|
+
// "@typescript-eslint/no-unnecessary-type-assertion": ["error"],
|
|
40
40
|
"@typescript-eslint/non-nullable-type-assertion-style": ["error"],
|
|
41
41
|
"@typescript-eslint/prefer-reduce-type-parameter": ["error"],
|
|
42
42
|
"@typescript-eslint/prefer-return-this-type": ["error"],
|
package/src/index.cjs
CHANGED
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
module.exports = {
|
|
2
2
|
configs: {
|
|
3
3
|
"base": require("./configs/base.cjs"),
|
|
4
|
-
"typescript": require("./configs/typescript.cjs")
|
|
5
|
-
"angular": require("./configs/angular.cjs"),
|
|
6
|
-
"angular-template": require("./configs/angular-template.cjs")
|
|
4
|
+
"typescript": require("./configs/typescript.cjs")
|
|
7
5
|
},
|
|
8
6
|
rules: {
|
|
9
7
|
"ts-no-self-entry-import": require("./rules/ts-no-self-entry-import.cjs"),
|
|
10
|
-
"ts-no-throw-not-implement-error": require("./rules/ts-no-throw-not-implement-error.cjs")
|
|
11
|
-
"ng-template-no-todo-comments": require("./rules/ng-template-no-todo-comments.cjs")
|
|
8
|
+
"ts-no-throw-not-implement-error": require("./rules/ts-no-throw-not-implement-error.cjs")
|
|
12
9
|
}
|
|
13
10
|
};
|
package/src/configs/angular.cjs
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
meta: {
|
|
3
|
-
type: "suggestion",
|
|
4
|
-
docs: {
|
|
5
|
-
description: "HTML의 'TODO' 주석 경고"
|
|
6
|
-
},
|
|
7
|
-
|
|
8
|
-
schema: []
|
|
9
|
-
},
|
|
10
|
-
|
|
11
|
-
create: (context) => {
|
|
12
|
-
// const parserServices = context.parserServices;
|
|
13
|
-
return {
|
|
14
|
-
Program(node) {
|
|
15
|
-
if (node.value) {
|
|
16
|
-
const comments = node.value.match(/<!--(((?!-->)[\s\S])*)-->/g);
|
|
17
|
-
if (!comments) return;
|
|
18
|
-
|
|
19
|
-
let cursor = 0;
|
|
20
|
-
for (const comment of comments) {
|
|
21
|
-
if (!comment.includes("TODO:")) continue;
|
|
22
|
-
|
|
23
|
-
const index = node.value.slice(cursor).indexOf(comment) + cursor;
|
|
24
|
-
const line = node.value.slice(0, index).split("\n").length;
|
|
25
|
-
const column = index - node.value.slice(0, index).lastIndexOf("\n") - 1;
|
|
26
|
-
|
|
27
|
-
const endIndex = index + comment.length;
|
|
28
|
-
const endLine = node.value.slice(0, endIndex).split("\n").length;
|
|
29
|
-
const endColumn = endIndex - node.value.slice(0, endIndex).lastIndexOf("\n") - 1;
|
|
30
|
-
|
|
31
|
-
cursor += index;
|
|
32
|
-
|
|
33
|
-
context.report({
|
|
34
|
-
loc: {
|
|
35
|
-
start: { line, column },
|
|
36
|
-
end: { line: endLine, column: endColumn }
|
|
37
|
-
},
|
|
38
|
-
message: comment.match(/<!--(((?!-->)[\s\S])*)-->/)[1].trim()
|
|
39
|
-
});
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
};
|
|
44
|
-
}
|
|
45
|
-
};
|