@ethang/eslint-config 19.6.6 → 19.7.0
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/README.md +2 -2
- package/build/rule-list.ts +9 -8
- package/eslint.config.js +6 -4
- package/package.json +5 -5
- package/setup/exception-handling.ts +12 -0
- package/setup/ethang.ts +0 -7
package/README.md
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
> [!CAUTION]
|
|
6
6
|
> Do not use this with Prettier! Styling rules are included.
|
|
7
7
|
|
|
8
|
-
-
|
|
8
|
+
- 890 errored rules.
|
|
9
9
|
- 289 rules from [eslint-plugin-sonarjs](https://github.com/SonarSource/SonarJS/blob/master/packages/jsts/src/rules/README.md)
|
|
10
10
|
- 145 rules from [@eslint/js](https://github.com/eslint/eslint/tree/main/packages/js)
|
|
11
11
|
- 113 rules from [sindresorhus/eslint-plugin-unicorn](https://github.com/sindresorhus/eslint-plugin-unicorn)
|
|
@@ -19,11 +19,11 @@
|
|
|
19
19
|
- 7 rules from [@eslint/markdown](https://github.com/eslint/markdown)
|
|
20
20
|
- 5 rules from [@tanstack/eslint-plugin-query](https://tanstack.com/query/latest/docs/eslint/eslint-plugin-query)
|
|
21
21
|
- 4 rules from [eslint-plugin-barrel-files](https://github.com/thepassle/eslint-plugin-barrel-files)
|
|
22
|
+
- 3 rules from [exception-handling](https://github.com/Akronae/eslint-plugin-exception-handling)
|
|
22
23
|
- 2 rules from [@eslint/json](https://github.com/eslint/json)
|
|
23
24
|
- 1 rule from [eslint-plugin-depend](https://github.com/es-tooling/eslint-plugin-depend/tree/main)
|
|
24
25
|
- 1 rule from [@cspell/eslint-plugin](https://github.com/streetsidesoftware/cspell/tree/main/packages/cspell-eslint-plugin)
|
|
25
26
|
- 1 rule from [eslint-plugin-compat](https://github.com/amilajack/eslint-plugin-compat)
|
|
26
|
-
- 1 rule from [@ethang/eslint-plugin](https://github.com/eglove/eslint-plugin)
|
|
27
27
|
- 1 rule from [@tanstack/eslint-plugin-router](https://tanstack.com/router/latest/docs/eslint/eslint-plugin-router)
|
|
28
28
|
|
|
29
29
|
# Add Even More!
|
package/build/rule-list.ts
CHANGED
|
@@ -5,7 +5,6 @@ import { compatRules } from "../setup/compat.ts";
|
|
|
5
5
|
import { dependRules } from "../setup/depend.ts";
|
|
6
6
|
import { deprecatedRules } from "../setup/deprecated.ts";
|
|
7
7
|
import { eslintRules } from "../setup/eslint.ts";
|
|
8
|
-
import { ethangRules } from "../setup/ethang.ts";
|
|
9
8
|
import { jsonRules } from "../setup/json.ts";
|
|
10
9
|
import { lodashRules } from "../setup/lodash.ts";
|
|
11
10
|
import { markdownRules } from "../setup/markdown.ts";
|
|
@@ -21,6 +20,7 @@ import { typescriptRules } from "../setup/typescript-eslint.ts";
|
|
|
21
20
|
import { unicornRules } from "../setup/unicorn.ts";
|
|
22
21
|
import { cspellRules } from "../setup/cspell.js";
|
|
23
22
|
import { tanstackRouterRules } from "../setup/tanstack-router.js";
|
|
23
|
+
import { exceptionHandlingRules } from "../setup/exception-handling.js";
|
|
24
24
|
|
|
25
25
|
export const ruleList = [
|
|
26
26
|
{
|
|
@@ -114,14 +114,15 @@ export const ruleList = [
|
|
|
114
114
|
url: "https://github.com/SonarSource/SonarJS/blob/master/packages/jsts/src/rules/README.md",
|
|
115
115
|
},
|
|
116
116
|
{
|
|
117
|
-
importString:
|
|
118
|
-
|
|
119
|
-
|
|
117
|
+
importString:
|
|
118
|
+
'import { plugin as exceptionHandling } from "eslint-plugin-exception-handling"',
|
|
119
|
+
list: exceptionHandlingRules,
|
|
120
|
+
name: "exception-handling",
|
|
120
121
|
order: 9,
|
|
121
|
-
pluginName: "
|
|
122
|
-
pluginValue: "
|
|
122
|
+
pluginName: "exception-handling",
|
|
123
|
+
pluginValue: "exceptionHandling",
|
|
123
124
|
type: "core",
|
|
124
|
-
url: "https://github.com/
|
|
125
|
+
url: "https://github.com/Akronae/eslint-plugin-exception-handling",
|
|
125
126
|
},
|
|
126
127
|
{
|
|
127
128
|
importString: 'import tailwind from "eslint-plugin-tailwindcss";',
|
|
@@ -175,7 +176,7 @@ export const ruleList = [
|
|
|
175
176
|
url: "https://tanstack.com/router/latest/docs/eslint/eslint-plugin-router",
|
|
176
177
|
},
|
|
177
178
|
{
|
|
178
|
-
importString: 'import a11y from "eslint-plugin-jsx-a11y
|
|
179
|
+
importString: 'import a11y from "eslint-plugin-jsx-a11y";',
|
|
179
180
|
list: a11yRules,
|
|
180
181
|
name: "jsx-a11y",
|
|
181
182
|
order: 15,
|
package/eslint.config.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { fixupPluginRules } from "@eslint/compat";
|
|
2
2
|
import { ignores, languageOptions } from "./constants.js";
|
|
3
|
-
import
|
|
3
|
+
import { plugin as exceptionHandling } from "eslint-plugin-exception-handling";
|
|
4
|
+
import a11y from "eslint-plugin-jsx-a11y";
|
|
4
5
|
import barrel from "eslint-plugin-barrel-files";
|
|
5
6
|
import compat from "eslint-plugin-compat";
|
|
6
7
|
import cspell from "@cspell/eslint-plugin";
|
|
7
8
|
import depend from "eslint-plugin-depend";
|
|
8
|
-
import ethang from "@ethang/eslint-plugin";
|
|
9
9
|
import json from "@eslint/json";
|
|
10
10
|
import lodashConfig from "eslint-plugin-lodash";
|
|
11
11
|
import markdown from "@eslint/markdown";
|
|
@@ -37,7 +37,7 @@ export default tseslint.config(
|
|
|
37
37
|
unicorn: unicorn,
|
|
38
38
|
lodash: lodashConfig,
|
|
39
39
|
sonar: fixupPluginRules(sonar),
|
|
40
|
-
|
|
40
|
+
"exception-handling": exceptionHandling,
|
|
41
41
|
tailwind: tailwind,
|
|
42
42
|
stylistic: stylistic,
|
|
43
43
|
perfectionist: perfectionist,
|
|
@@ -932,7 +932,9 @@ export default tseslint.config(
|
|
|
932
932
|
"sonar/weak-ssl": "error",
|
|
933
933
|
"sonar/x-powered-by": "error",
|
|
934
934
|
"sonar/xml-parser-xxe": "error",
|
|
935
|
-
"
|
|
935
|
+
"exception-handling/might-throw": "error",
|
|
936
|
+
"exception-handling/no-unhandled": "error",
|
|
937
|
+
"exception-handling/use-error-cause": "error",
|
|
936
938
|
"tailwind/classnames-order": "error",
|
|
937
939
|
"tailwind/enforces-negative-arbitrary-values": "error",
|
|
938
940
|
"tailwind/enforces-shorthand": "error",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ethang/eslint-config",
|
|
3
|
-
"version": "19.
|
|
3
|
+
"version": "19.7.0",
|
|
4
4
|
"repository": {
|
|
5
5
|
"url": "git+https://github.com/eglove/eslint-config-ethang.git"
|
|
6
6
|
},
|
|
@@ -19,9 +19,8 @@
|
|
|
19
19
|
"@eslint/js": "^9.11.0",
|
|
20
20
|
"@eslint/json": "^0.4.0",
|
|
21
21
|
"@eslint/markdown": "^6.1.0",
|
|
22
|
-
"@ethang/eslint-plugin": "^0.0.11",
|
|
23
22
|
"@stylistic/eslint-plugin": "^2.8.0",
|
|
24
|
-
"@tanstack/eslint-plugin-query": "^5.57.
|
|
23
|
+
"@tanstack/eslint-plugin-query": "^5.57.1",
|
|
25
24
|
"@tanstack/eslint-plugin-router": "^1.58.6",
|
|
26
25
|
"@typescript-eslint/parser": "^8.6.0",
|
|
27
26
|
"eslint": "^9.11.0",
|
|
@@ -29,6 +28,7 @@
|
|
|
29
28
|
"eslint-plugin-barrel-files": "^2.1.0",
|
|
30
29
|
"eslint-plugin-compat": "^6.0.1",
|
|
31
30
|
"eslint-plugin-depend": "^0.11.0",
|
|
31
|
+
"eslint-plugin-exception-handling": "^1.4.2",
|
|
32
32
|
"eslint-plugin-jsx-a11y": "^6.10.0",
|
|
33
33
|
"eslint-plugin-lodash": "^8.0.0",
|
|
34
34
|
"eslint-plugin-n": "^17.10.3",
|
|
@@ -59,9 +59,8 @@
|
|
|
59
59
|
"@eslint/js": "^9.11.0",
|
|
60
60
|
"@eslint/json": "^0.4.0",
|
|
61
61
|
"@eslint/markdown": "^6.1.0",
|
|
62
|
-
"@ethang/eslint-plugin": "^0.0.11",
|
|
63
62
|
"@stylistic/eslint-plugin": "^2.8.0",
|
|
64
|
-
"@tanstack/eslint-plugin-query": "^5.57.
|
|
63
|
+
"@tanstack/eslint-plugin-query": "^5.57.1",
|
|
65
64
|
"@tanstack/eslint-plugin-router": "^1.58.6",
|
|
66
65
|
"@typescript-eslint/parser": "^8.6.0",
|
|
67
66
|
"eslint": "^9.11.0",
|
|
@@ -69,6 +68,7 @@
|
|
|
69
68
|
"eslint-plugin-barrel-files": "^2.1.0",
|
|
70
69
|
"eslint-plugin-compat": "^6.0.1",
|
|
71
70
|
"eslint-plugin-depend": "^0.11.0",
|
|
71
|
+
"eslint-plugin-exception-handling": "^1.4.2",
|
|
72
72
|
"eslint-plugin-jsx-a11y": "^6.10.0",
|
|
73
73
|
"eslint-plugin-lodash": "^8.0.0",
|
|
74
74
|
"eslint-plugin-n": "^17.10.3",
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { rules } from "eslint-plugin-exception-handling";
|
|
2
|
+
import { EsLintRules, genRules, getNonDeprecatedRules } from "./gen-rules.js";
|
|
3
|
+
|
|
4
|
+
const ruleNames = Object.keys(
|
|
5
|
+
getNonDeprecatedRules(rules as unknown as EsLintRules),
|
|
6
|
+
);
|
|
7
|
+
|
|
8
|
+
export const exceptionHandlingRules = genRules(
|
|
9
|
+
ruleNames,
|
|
10
|
+
[],
|
|
11
|
+
"exception-handling",
|
|
12
|
+
);
|