@asd14/eslint-plugin 1.0.0 → 1.1.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 +5 -4
- package/SKILL.md +4 -5
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -20,7 +20,8 @@
|
|
|
20
20
|
npm install @asd14/eslint-plugin --save-dev
|
|
21
21
|
```
|
|
22
22
|
|
|
23
|
-
> NOTE
|
|
23
|
+
> [!NOTE]
|
|
24
|
+
> Works with either `eslint ^9` or `eslint ^10`.
|
|
24
25
|
|
|
25
26
|
## Rules
|
|
26
27
|
|
|
@@ -29,7 +30,7 @@ npm install @asd14/eslint-plugin --save-dev
|
|
|
29
30
|
Enforce consistent error message format in `throw` statements.
|
|
30
31
|
|
|
31
32
|
- Per error class: `Error`, `TypeError` or custom `DBError`
|
|
32
|
-
- Each is an array of `RegExp` patterns
|
|
33
|
+
- Each class is an array of `RegExp` patterns
|
|
33
34
|
- `OR` matching, first match wins
|
|
34
35
|
|
|
35
36
|
```js
|
|
@@ -64,7 +65,7 @@ export default [
|
|
|
64
65
|
]
|
|
65
66
|
```
|
|
66
67
|
|
|
67
|
-
|
|
68
|
+
**Correct** message examples:
|
|
68
69
|
|
|
69
70
|
```js
|
|
70
71
|
// Template literal with interpolation
|
|
@@ -86,7 +87,7 @@ throw new TypeError(
|
|
|
86
87
|
throw new Error("something went wrong")
|
|
87
88
|
```
|
|
88
89
|
|
|
89
|
-
|
|
90
|
+
**Incorrect** message examples:
|
|
90
91
|
|
|
91
92
|
```js
|
|
92
93
|
// Missing @asd14/m/ prefix
|
package/SKILL.md
CHANGED
|
@@ -12,12 +12,11 @@ Requires `eslint ^9 || ^10` as peer dependency.
|
|
|
12
12
|
|
|
13
13
|
## error-message-format
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
Enforce consistent error message format in `throw` statements.
|
|
16
16
|
|
|
17
|
-
-
|
|
18
|
-
- Each class
|
|
19
|
-
- `
|
|
20
|
-
- OR matching: first match wins, reports if none match
|
|
17
|
+
- Per error class: `Error`, `TypeError` or custom `DBError`
|
|
18
|
+
- Each class is an array of `RegExp` patterns
|
|
19
|
+
- `OR` matching, first match wins
|
|
21
20
|
- Supports string literals, template literals, and string concatenation
|
|
22
21
|
- Variables or function calls as the sole argument are flagged as non-evaluable
|
|
23
22
|
|