@ethang/eslint-config 19.6.7 → 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 CHANGED
@@ -5,7 +5,7 @@
5
5
  > [!CAUTION]
6
6
  > Do not use this with Prettier! Styling rules are included.
7
7
 
8
- - 887 errored rules.
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,6 +19,7 @@
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)
@@ -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: 9,
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: 10,
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: 11,
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: 12,
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: 13,
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/lib/index.js";',
179
+ importString: 'import a11y from "eslint-plugin-jsx-a11y";',
168
180
  list: a11yRules,
169
181
  name: "jsx-a11y",
170
- order: 14,
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: 15,
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 a11y from "eslint-plugin-jsx-a11y/lib/index.js";
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": "error",
936
+ "exception-handling/no-unhandled": "error",
937
+ "exception-handling/use-error-cause": "error",
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.6.7",
3
+ "version": "19.7.0",
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.0",
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.0",
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,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
+ );