@ethang/eslint-config 19.6.7 → 19.7.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/build/rule-list.ts +20 -8
- package/eslint.config.js +6 -1
- package/package.json +5 -3
- package/setup/exception-handling.ts +13 -0
package/build/rule-list.ts
CHANGED
|
@@ -20,6 +20,7 @@ import { typescriptRules } from "../setup/typescript-eslint.ts";
|
|
|
20
20
|
import { unicornRules } from "../setup/unicorn.ts";
|
|
21
21
|
import { cspellRules } from "../setup/cspell.js";
|
|
22
22
|
import { tanstackRouterRules } from "../setup/tanstack-router.js";
|
|
23
|
+
import { exceptionHandlingRules } from "../setup/exception-handling.js";
|
|
23
24
|
|
|
24
25
|
export const ruleList = [
|
|
25
26
|
{
|
|
@@ -112,11 +113,22 @@ export const ruleList = [
|
|
|
112
113
|
type: "core",
|
|
113
114
|
url: "https://github.com/SonarSource/SonarJS/blob/master/packages/jsts/src/rules/README.md",
|
|
114
115
|
},
|
|
116
|
+
{
|
|
117
|
+
importString:
|
|
118
|
+
'import { plugin as exceptionHandling } from "eslint-plugin-exception-handling"',
|
|
119
|
+
list: exceptionHandlingRules,
|
|
120
|
+
name: "exception-handling",
|
|
121
|
+
order: 9,
|
|
122
|
+
pluginName: "exception-handling",
|
|
123
|
+
pluginValue: "exceptionHandling",
|
|
124
|
+
type: "core",
|
|
125
|
+
url: "https://github.com/Akronae/eslint-plugin-exception-handling",
|
|
126
|
+
},
|
|
115
127
|
{
|
|
116
128
|
importString: 'import tailwind from "eslint-plugin-tailwindcss";',
|
|
117
129
|
list: tailwindRules,
|
|
118
130
|
name: "eslint-plugin-tailwindcss",
|
|
119
|
-
order:
|
|
131
|
+
order: 10,
|
|
120
132
|
pluginName: "tailwind",
|
|
121
133
|
pluginValue: "tailwind",
|
|
122
134
|
type: "core",
|
|
@@ -126,7 +138,7 @@ export const ruleList = [
|
|
|
126
138
|
importString: 'import stylistic from "@stylistic/eslint-plugin";',
|
|
127
139
|
list: stylisticRules,
|
|
128
140
|
name: "@stylistic/eslint-plugin",
|
|
129
|
-
order:
|
|
141
|
+
order: 11,
|
|
130
142
|
pluginName: "stylistic",
|
|
131
143
|
pluginValue: "stylistic",
|
|
132
144
|
type: "core",
|
|
@@ -136,7 +148,7 @@ export const ruleList = [
|
|
|
136
148
|
importString: 'import perfectionist from "eslint-plugin-perfectionist";',
|
|
137
149
|
list: perfectionistRules,
|
|
138
150
|
name: "eslint-plugin-perfectionist",
|
|
139
|
-
order:
|
|
151
|
+
order: 12,
|
|
140
152
|
pluginName: "perfectionist",
|
|
141
153
|
pluginValue: "perfectionist",
|
|
142
154
|
type: "core",
|
|
@@ -146,7 +158,7 @@ export const ruleList = [
|
|
|
146
158
|
importString: 'import tanstackQuery from "@tanstack/eslint-plugin-query";',
|
|
147
159
|
list: tanstackQueryRules,
|
|
148
160
|
name: "@tanstack/eslint-plugin-query",
|
|
149
|
-
order:
|
|
161
|
+
order: 13,
|
|
150
162
|
pluginName: "@tanstack/query",
|
|
151
163
|
pluginValue: "tanstackQuery",
|
|
152
164
|
type: "core",
|
|
@@ -157,17 +169,17 @@ export const ruleList = [
|
|
|
157
169
|
'import tanstackRouter from "@tanstack/eslint-plugin-router";',
|
|
158
170
|
list: tanstackRouterRules,
|
|
159
171
|
name: "@tanstack/eslint-plugin-router",
|
|
160
|
-
order:
|
|
172
|
+
order: 14,
|
|
161
173
|
pluginName: "@tanstack/router",
|
|
162
174
|
pluginValue: "tanstackRouter",
|
|
163
175
|
type: "core",
|
|
164
176
|
url: "https://tanstack.com/router/latest/docs/eslint/eslint-plugin-router",
|
|
165
177
|
},
|
|
166
178
|
{
|
|
167
|
-
importString: 'import a11y from "eslint-plugin-jsx-a11y
|
|
179
|
+
importString: 'import a11y from "eslint-plugin-jsx-a11y";',
|
|
168
180
|
list: a11yRules,
|
|
169
181
|
name: "jsx-a11y",
|
|
170
|
-
order:
|
|
182
|
+
order: 15,
|
|
171
183
|
pluginName: "a11y",
|
|
172
184
|
pluginValue: "a11y",
|
|
173
185
|
type: "core",
|
|
@@ -177,7 +189,7 @@ export const ruleList = [
|
|
|
177
189
|
importString: undefined,
|
|
178
190
|
list: deprecatedRules,
|
|
179
191
|
name: "@eslint/js",
|
|
180
|
-
order:
|
|
192
|
+
order: 16,
|
|
181
193
|
pluginName: undefined,
|
|
182
194
|
pluginValue: undefined,
|
|
183
195
|
type: "core",
|
package/eslint.config.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
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";
|
|
@@ -36,6 +37,7 @@ export default tseslint.config(
|
|
|
36
37
|
unicorn: unicorn,
|
|
37
38
|
lodash: lodashConfig,
|
|
38
39
|
sonar: fixupPluginRules(sonar),
|
|
40
|
+
"exception-handling": exceptionHandling,
|
|
39
41
|
tailwind: tailwind,
|
|
40
42
|
stylistic: stylistic,
|
|
41
43
|
perfectionist: perfectionist,
|
|
@@ -930,6 +932,9 @@ export default tseslint.config(
|
|
|
930
932
|
"sonar/weak-ssl": "error",
|
|
931
933
|
"sonar/x-powered-by": "error",
|
|
932
934
|
"sonar/xml-parser-xxe": "error",
|
|
935
|
+
"exception-handling/might-throw": "off",
|
|
936
|
+
"exception-handling/no-unhandled": "off",
|
|
937
|
+
"exception-handling/use-error-cause": "off",
|
|
933
938
|
"tailwind/classnames-order": "error",
|
|
934
939
|
"tailwind/enforces-negative-arbitrary-values": "error",
|
|
935
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.1",
|
|
4
4
|
"repository": {
|
|
5
5
|
"url": "git+https://github.com/eglove/eslint-config-ethang.git"
|
|
6
6
|
},
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"@eslint/json": "^0.4.0",
|
|
21
21
|
"@eslint/markdown": "^6.1.0",
|
|
22
22
|
"@stylistic/eslint-plugin": "^2.8.0",
|
|
23
|
-
"@tanstack/eslint-plugin-query": "^5.57.
|
|
23
|
+
"@tanstack/eslint-plugin-query": "^5.57.1",
|
|
24
24
|
"@tanstack/eslint-plugin-router": "^1.58.6",
|
|
25
25
|
"@typescript-eslint/parser": "^8.6.0",
|
|
26
26
|
"eslint": "^9.11.0",
|
|
@@ -28,6 +28,7 @@
|
|
|
28
28
|
"eslint-plugin-barrel-files": "^2.1.0",
|
|
29
29
|
"eslint-plugin-compat": "^6.0.1",
|
|
30
30
|
"eslint-plugin-depend": "^0.11.0",
|
|
31
|
+
"eslint-plugin-exception-handling": "^1.4.2",
|
|
31
32
|
"eslint-plugin-jsx-a11y": "^6.10.0",
|
|
32
33
|
"eslint-plugin-lodash": "^8.0.0",
|
|
33
34
|
"eslint-plugin-n": "^17.10.3",
|
|
@@ -59,7 +60,7 @@
|
|
|
59
60
|
"@eslint/json": "^0.4.0",
|
|
60
61
|
"@eslint/markdown": "^6.1.0",
|
|
61
62
|
"@stylistic/eslint-plugin": "^2.8.0",
|
|
62
|
-
"@tanstack/eslint-plugin-query": "^5.57.
|
|
63
|
+
"@tanstack/eslint-plugin-query": "^5.57.1",
|
|
63
64
|
"@tanstack/eslint-plugin-router": "^1.58.6",
|
|
64
65
|
"@typescript-eslint/parser": "^8.6.0",
|
|
65
66
|
"eslint": "^9.11.0",
|
|
@@ -67,6 +68,7 @@
|
|
|
67
68
|
"eslint-plugin-barrel-files": "^2.1.0",
|
|
68
69
|
"eslint-plugin-compat": "^6.0.1",
|
|
69
70
|
"eslint-plugin-depend": "^0.11.0",
|
|
71
|
+
"eslint-plugin-exception-handling": "^1.4.2",
|
|
70
72
|
"eslint-plugin-jsx-a11y": "^6.10.0",
|
|
71
73
|
"eslint-plugin-lodash": "^8.0.0",
|
|
72
74
|
"eslint-plugin-n": "^17.10.3",
|
|
@@ -0,0 +1,13 @@
|
|
|
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
|
+
"off", // TODO fix with https://github.com/Akronae/eslint-plugin-exception-handling/issues/5
|
|
13
|
+
);
|