@simplysm/lint 13.0.78 → 13.0.80
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"eslint-recommended.d.ts","sourceRoot":"","sources":["../src/eslint-recommended.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"eslint-recommended.d.ts","sourceRoot":"","sources":["../src/eslint-recommended.ts"],"names":[],"mappings":";AA+EA,wBA6MG"}
|
|
@@ -33,11 +33,11 @@ const noNodeBuiltinsRules = {
|
|
|
33
33
|
},
|
|
34
34
|
{
|
|
35
35
|
name: "events",
|
|
36
|
-
message: "Use
|
|
36
|
+
message: "Use EventEmitter from @simplysm/core-common."
|
|
37
37
|
},
|
|
38
38
|
{
|
|
39
39
|
name: "eventemitter3",
|
|
40
|
-
message: "Use
|
|
40
|
+
message: "Use EventEmitter from @simplysm/core-common."
|
|
41
41
|
}
|
|
42
42
|
]
|
|
43
43
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/eslint-recommended.ts"],
|
|
4
|
-
"mappings": "AAAA,OAAO,aAAa;AACpB,OAAO,kBAAmC;AAC1C,OAAO,YAAY;AACnB,OAAO,kBAAkB;AACzB,OAAO,yBAAyB;AAChC,OAAO,iBAAiB;AACxB,OAAO,uBAAuB;AAC9B,SAAS,cAAc,qBAAqB;AAC5C,SAAS,cAAc;AACvB,SAAS,qBAAqB;AAY9B,MAAM,cAAgC;AAAA,EACpC,cAAc;AAAA,EACd,uBAAuB;AAAA,EACvB,UAAU,CAAC,SAAS,UAAU,EAAE,MAAM,SAAS,CAAC;AAAA,EAChD,mBAAmB;AAAA,EACnB,yBAAyB;AAC3B;
|
|
4
|
+
"mappings": "AAAA,OAAO,aAAa;AACpB,OAAO,kBAAmC;AAC1C,OAAO,YAAY;AACnB,OAAO,kBAAkB;AACzB,OAA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,uBAAuB;AAAA;AAAA,MACvB,iCAAiC;AAAA;AAAA;AAAA,MAGjC,sBAAsB;AAAA;AAAA,MACtB,2BAA2B;AAAA;AAAA;AAAA,MAG3B,uBAAuB;AAAA;AAAA;AAAA,MAGvB,oBAAoB;AAAA;AAAA,MACpB,wBAAwB;AAAA;AAAA,MACxB,iBAAiB;AAAA;AAAA,MACjB,oBAAoB;AAAA;AAAA,MACpB,2BAA2B;AAAA;AAAA;AAAA,MAG3B,gCAAgC;AAAA;AAAA,MAChC,kDAAkD;AAAA;AAAA,MAClD,kCAAkC;AAAA;AAAA,MAClC,0CAA0C;AAAA;AAAA,MAC1C,mCAAmC;AAAA;AAAA,MACnC,8CAA8C;AAAA;AAAA,IAChD;AAAA,EACF;AACF,CAAC;",
|
|
5
5
|
"names": []
|
|
6
6
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@simplysm/lint",
|
|
3
|
-
"version": "13.0.
|
|
3
|
+
"version": "13.0.80",
|
|
4
4
|
"description": "Simplysm package - Lint configuration (ESLint)",
|
|
5
5
|
"author": "simplysm",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -13,7 +13,8 @@
|
|
|
13
13
|
"files": [
|
|
14
14
|
"dist",
|
|
15
15
|
"src",
|
|
16
|
-
"tests"
|
|
16
|
+
"tests",
|
|
17
|
+
"docs"
|
|
17
18
|
],
|
|
18
19
|
"sideEffects": false,
|
|
19
20
|
"exports": {
|
|
@@ -27,8 +28,8 @@
|
|
|
27
28
|
}
|
|
28
29
|
},
|
|
29
30
|
"dependencies": {
|
|
30
|
-
"@typescript-eslint/utils": "^8.
|
|
31
|
-
"eslint": "^9.39.
|
|
31
|
+
"@typescript-eslint/utils": "^8.57.0",
|
|
32
|
+
"eslint": "^9.39.4",
|
|
32
33
|
"eslint-import-resolver-typescript": "^4.4.4",
|
|
33
34
|
"eslint-plugin-import": "^2.32.0",
|
|
34
35
|
"eslint-plugin-solid": "^0.14.5",
|
|
@@ -36,10 +37,10 @@
|
|
|
36
37
|
"eslint-plugin-unused-imports": "^4.4.1",
|
|
37
38
|
"globals": "^17.4.0",
|
|
38
39
|
"typescript": "^5.9.3",
|
|
39
|
-
"typescript-eslint": "^8.
|
|
40
|
+
"typescript-eslint": "^8.57.0"
|
|
40
41
|
},
|
|
41
42
|
"devDependencies": {
|
|
42
43
|
"@types/eslint-plugin-tailwindcss": "^3.17.0",
|
|
43
|
-
"@typescript-eslint/rule-tester": "^8.
|
|
44
|
+
"@typescript-eslint/rule-tester": "^8.57.0"
|
|
44
45
|
}
|
|
45
46
|
}
|
|
@@ -27,11 +27,6 @@ const commonRules: FlatConfig.Rules = {
|
|
|
27
27
|
"array-callback-return": "error",
|
|
28
28
|
};
|
|
29
29
|
|
|
30
|
-
/**
|
|
31
|
-
* Prohibit Node.js-specific API usage across all packages (unified codebase)
|
|
32
|
-
* - Buffer → Uint8Array, bytesToHex/bytesFromHex/bytesConcat
|
|
33
|
-
* - EventEmitter → SdEventEmitter
|
|
34
|
-
*/
|
|
35
30
|
const noNodeBuiltinsRules: FlatConfig.Rules = {
|
|
36
31
|
"no-restricted-globals": [
|
|
37
32
|
"error",
|
|
@@ -51,11 +46,11 @@ const noNodeBuiltinsRules: FlatConfig.Rules = {
|
|
|
51
46
|
},
|
|
52
47
|
{
|
|
53
48
|
name: "events",
|
|
54
|
-
message: "Use
|
|
49
|
+
message: "Use EventEmitter from @simplysm/core-common.",
|
|
55
50
|
},
|
|
56
51
|
{
|
|
57
52
|
name: "eventemitter3",
|
|
58
|
-
message: "Use
|
|
53
|
+
message: "Use EventEmitter from @simplysm/core-common.",
|
|
59
54
|
},
|
|
60
55
|
],
|
|
61
56
|
},
|
package/README.md
DELETED
|
@@ -1,238 +0,0 @@
|
|
|
1
|
-
# @simplysm/lint
|
|
2
|
-
|
|
3
|
-
Simplysm package - Lint configuration (ESLint)
|
|
4
|
-
|
|
5
|
-
Provides a shared ESLint flat config and a custom ESLint plugin with Simplysm-specific rules for use across Simplysm projects.
|
|
6
|
-
|
|
7
|
-
## Installation
|
|
8
|
-
|
|
9
|
-
```bash
|
|
10
|
-
pnpm add -D @simplysm/lint
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
## Entry Points
|
|
14
|
-
|
|
15
|
-
This package exposes two separate entry points:
|
|
16
|
-
|
|
17
|
-
| Entry point | Description |
|
|
18
|
-
|---|---|
|
|
19
|
-
| `@simplysm/lint/eslint-plugin` | Custom ESLint plugin (Simplysm rules only) |
|
|
20
|
-
| `@simplysm/lint/eslint-recommended` | Full recommended ESLint flat config |
|
|
21
|
-
|
|
22
|
-
---
|
|
23
|
-
|
|
24
|
-
## `@simplysm/lint/eslint-recommended`
|
|
25
|
-
|
|
26
|
-
A pre-built ESLint [flat config](https://eslint.org/docs/latest/use/configure/configuration-files-new) array that covers JS, TS, SolidJS (TSX), and Tailwind CSS files.
|
|
27
|
-
|
|
28
|
-
**Included plugins:**
|
|
29
|
-
- `typescript-eslint`
|
|
30
|
-
- `eslint-plugin-import`
|
|
31
|
-
- `eslint-plugin-unused-imports`
|
|
32
|
-
- `eslint-plugin-solid`
|
|
33
|
-
- `eslint-plugin-tailwindcss`
|
|
34
|
-
- `@simplysm` (custom plugin, see below)
|
|
35
|
-
|
|
36
|
-
### Usage
|
|
37
|
-
|
|
38
|
-
```typescript
|
|
39
|
-
// eslint.config.ts
|
|
40
|
-
import sdRecommended from "@simplysm/lint/eslint-recommended";
|
|
41
|
-
|
|
42
|
-
export default sdRecommended;
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
### Covered file globs
|
|
46
|
-
|
|
47
|
-
| Glob | Applied rule groups |
|
|
48
|
-
|---|---|
|
|
49
|
-
| `**/*.js`, `**/*.jsx` | Common rules, import, unused-imports, `@simplysm` rules |
|
|
50
|
-
| `**/*.ts`, `**/*.tsx` | All of the above + typescript-eslint rules |
|
|
51
|
-
| `**/*.ts`, `**/*.tsx` | SolidJS reactivity + Tailwind CSS rules |
|
|
52
|
-
| `**/tests/**/*.ts`, `**/tests/**/*.tsx` | Relaxed rules (no-console off, import/no-extraneous-dependencies off) |
|
|
53
|
-
|
|
54
|
-
### Global ignores
|
|
55
|
-
|
|
56
|
-
The following paths are ignored by default:
|
|
57
|
-
|
|
58
|
-
```
|
|
59
|
-
**/node_modules/**
|
|
60
|
-
**/dist/**
|
|
61
|
-
**/.*/**
|
|
62
|
-
**/_*/**
|
|
63
|
-
```
|
|
64
|
-
|
|
65
|
-
### Key rules enabled
|
|
66
|
-
|
|
67
|
-
**Common (JS + TS)**
|
|
68
|
-
|
|
69
|
-
| Rule | Severity | Notes |
|
|
70
|
-
|---|---|---|
|
|
71
|
-
| `no-console` | error | Prohibit console usage |
|
|
72
|
-
| `no-warning-comments` | warn | Flag TODO/FIXME comments |
|
|
73
|
-
| `eqeqeq` | error | Enforce `===`; allow `== null` |
|
|
74
|
-
| `no-self-compare` | error | Catch `x === x` typos |
|
|
75
|
-
| `array-callback-return` | error | Require return in map/filter callbacks |
|
|
76
|
-
| `no-restricted-globals` | error | Prohibit `Buffer` (use `Uint8Array`) |
|
|
77
|
-
| `no-restricted-imports` | error | Prohibit `buffer`, `events`, `eventemitter3` |
|
|
78
|
-
| `unused-imports/no-unused-imports` | error | Auto-remove unused imports |
|
|
79
|
-
| `unused-imports/no-unused-vars` | error | Unused vars allowed with `_` prefix |
|
|
80
|
-
| `import/no-extraneous-dependencies` | error | Prohibit undeclared dependencies |
|
|
81
|
-
| `@simplysm/no-hard-private` | error | See custom rules below |
|
|
82
|
-
| `@simplysm/no-subpath-imports-from-simplysm` | error | See custom rules below |
|
|
83
|
-
|
|
84
|
-
**TypeScript-only additions**
|
|
85
|
-
|
|
86
|
-
| Rule | Severity | Notes |
|
|
87
|
-
|---|---|---|
|
|
88
|
-
| `@typescript-eslint/require-await` | error | |
|
|
89
|
-
| `@typescript-eslint/await-thenable` | error | |
|
|
90
|
-
| `@typescript-eslint/return-await` | error | `in-try-catch` mode |
|
|
91
|
-
| `@typescript-eslint/no-floating-promises` | error | |
|
|
92
|
-
| `@typescript-eslint/no-shadow` | error | |
|
|
93
|
-
| `@typescript-eslint/no-unnecessary-condition` | error | `allowConstantLoopConditions: true` |
|
|
94
|
-
| `@typescript-eslint/no-unnecessary-type-assertion` | error | |
|
|
95
|
-
| `@typescript-eslint/prefer-reduce-type-parameter` | error | |
|
|
96
|
-
| `@typescript-eslint/prefer-return-this-type` | error | |
|
|
97
|
-
| `@typescript-eslint/strict-boolean-expressions` | error | Allow nullable boolean/object |
|
|
98
|
-
| `@typescript-eslint/ban-ts-comment` | error | `ts-expect-error` allowed with description |
|
|
99
|
-
| `@typescript-eslint/prefer-readonly` | error | |
|
|
100
|
-
| `@typescript-eslint/no-misused-promises` | error | `checksVoidReturn.arguments/attributes: false` |
|
|
101
|
-
| `@typescript-eslint/only-throw-error` | error | |
|
|
102
|
-
| `@typescript-eslint/no-array-delete` | error | |
|
|
103
|
-
| `@simplysm/ts-no-throw-not-implemented-error` | warn | See custom rules below |
|
|
104
|
-
|
|
105
|
-
**SolidJS + Tailwind CSS (TS/TSX)**
|
|
106
|
-
|
|
107
|
-
| Rule | Severity | Notes |
|
|
108
|
-
|---|---|---|
|
|
109
|
-
| `solid/reactivity` | off | Disabled (too many false positives) |
|
|
110
|
-
| `solid/no-destructure` | error | Props destructuring guard |
|
|
111
|
-
| `solid/components-return-once` | error | Early return guard |
|
|
112
|
-
| `solid/jsx-no-duplicate-props` | error | |
|
|
113
|
-
| `solid/jsx-no-undef` | error | TypeScript-enabled |
|
|
114
|
-
| `solid/no-react-deps` | error | |
|
|
115
|
-
| `solid/no-react-specific-props` | error | |
|
|
116
|
-
| `solid/no-innerhtml` | error | XSS prevention |
|
|
117
|
-
| `solid/jsx-no-script-url` | error | |
|
|
118
|
-
| `solid/jsx-uses-vars` | error | |
|
|
119
|
-
| `solid/prefer-for` | error | Recommend `<For>` component |
|
|
120
|
-
| `solid/event-handlers` | error | |
|
|
121
|
-
| `solid/imports` | error | |
|
|
122
|
-
| `solid/style-prop` | error | |
|
|
123
|
-
| `solid/self-closing-comp` | error | |
|
|
124
|
-
| `tailwindcss/classnames-order` | warn | Auto-sort class order; supports `clsx` tag |
|
|
125
|
-
| `tailwindcss/enforces-negative-arbitrary-values` | error | |
|
|
126
|
-
| `tailwindcss/enforces-shorthand` | error | |
|
|
127
|
-
| `tailwindcss/no-contradicting-classname` | error | |
|
|
128
|
-
| `tailwindcss/no-custom-classname` | error | |
|
|
129
|
-
| `tailwindcss/no-unnecessary-arbitrary-value` | error | |
|
|
130
|
-
|
|
131
|
-
---
|
|
132
|
-
|
|
133
|
-
## `@simplysm/lint/eslint-plugin`
|
|
134
|
-
|
|
135
|
-
A custom ESLint plugin that exposes three Simplysm-specific rules under the `@simplysm` namespace.
|
|
136
|
-
|
|
137
|
-
### Usage
|
|
138
|
-
|
|
139
|
-
```typescript
|
|
140
|
-
// eslint.config.ts
|
|
141
|
-
import plugin from "@simplysm/lint/eslint-plugin";
|
|
142
|
-
import type { ESLint } from "eslint";
|
|
143
|
-
|
|
144
|
-
export default [
|
|
145
|
-
{
|
|
146
|
-
plugins: {
|
|
147
|
-
"@simplysm": plugin as unknown as ESLint.Plugin,
|
|
148
|
-
},
|
|
149
|
-
rules: {
|
|
150
|
-
"@simplysm/no-hard-private": "error",
|
|
151
|
-
"@simplysm/no-subpath-imports-from-simplysm": "error",
|
|
152
|
-
"@simplysm/ts-no-throw-not-implemented-error": "warn",
|
|
153
|
-
},
|
|
154
|
-
},
|
|
155
|
-
];
|
|
156
|
-
```
|
|
157
|
-
|
|
158
|
-
### Custom Rules
|
|
159
|
-
|
|
160
|
-
#### `@simplysm/no-hard-private`
|
|
161
|
-
|
|
162
|
-
**Type:** `problem` | **Fixable:** yes
|
|
163
|
-
|
|
164
|
-
Prohibits ECMAScript hard-private fields (`#field`) and enforces the TypeScript `private _field` style instead.
|
|
165
|
-
|
|
166
|
-
Checks:
|
|
167
|
-
- Class field declarations: `#field`
|
|
168
|
-
- Class method declarations: `#method()`
|
|
169
|
-
- Class accessor declarations: `accessor #field`
|
|
170
|
-
- Member access expressions: `this.#field`
|
|
171
|
-
|
|
172
|
-
Auto-fix renames `#name` to `_name` and inserts the `private` access modifier when missing. The fix is skipped if a member named `_name` already exists in the same class.
|
|
173
|
-
|
|
174
|
-
```typescript
|
|
175
|
-
// Error
|
|
176
|
-
class Foo {
|
|
177
|
-
#count = 0;
|
|
178
|
-
#increment() { this.#count++; }
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
// OK (after auto-fix)
|
|
182
|
-
class Foo {
|
|
183
|
-
private _count = 0;
|
|
184
|
-
private _increment() { this._count++; }
|
|
185
|
-
}
|
|
186
|
-
```
|
|
187
|
-
|
|
188
|
-
---
|
|
189
|
-
|
|
190
|
-
#### `@simplysm/no-subpath-imports-from-simplysm`
|
|
191
|
-
|
|
192
|
-
**Type:** `problem` | **Fixable:** yes
|
|
193
|
-
|
|
194
|
-
Prohibits imports into the `src/` subpath of `@simplysm/*` packages. Only the package root (or other declared export subpaths) may be imported.
|
|
195
|
-
|
|
196
|
-
Checks:
|
|
197
|
-
- Static import declarations: `import ... from '...'`
|
|
198
|
-
- Dynamic imports: `import('...')`
|
|
199
|
-
- Named re-exports: `export { ... } from '...'`
|
|
200
|
-
- Namespace re-exports: `export * from '...'`
|
|
201
|
-
|
|
202
|
-
Auto-fix rewrites the import to the package root (`@simplysm/pkg`).
|
|
203
|
-
|
|
204
|
-
```typescript
|
|
205
|
-
// Error
|
|
206
|
-
import { foo } from "@simplysm/core-common/src/foo";
|
|
207
|
-
|
|
208
|
-
// OK (after auto-fix)
|
|
209
|
-
import { foo } from "@simplysm/core-common";
|
|
210
|
-
```
|
|
211
|
-
|
|
212
|
-
---
|
|
213
|
-
|
|
214
|
-
#### `@simplysm/ts-no-throw-not-implemented-error`
|
|
215
|
-
|
|
216
|
-
**Type:** `suggestion` | **Fixable:** no | **Severity in recommended config:** warn
|
|
217
|
-
|
|
218
|
-
Warns when `NotImplementedError` from `@simplysm/core-common` is instantiated with `new`. This prevents unfinished placeholder code from reaching production.
|
|
219
|
-
|
|
220
|
-
Detects all import forms:
|
|
221
|
-
- Named import: `import { NotImplementedError } from "@simplysm/core-common"`
|
|
222
|
-
- Aliased import: `import { NotImplementedError as NIE } from "@simplysm/core-common"`
|
|
223
|
-
- Namespace import: `import * as CC from "@simplysm/core-common"` used as `new CC.NotImplementedError()`
|
|
224
|
-
|
|
225
|
-
Dynamic imports (`await import(...)`) are not detected.
|
|
226
|
-
|
|
227
|
-
The warning message is the string passed as the first argument to the constructor, or `"Not implemented"` if no argument is provided.
|
|
228
|
-
|
|
229
|
-
```typescript
|
|
230
|
-
import { NotImplementedError } from "@simplysm/core-common";
|
|
231
|
-
|
|
232
|
-
// Warning: "Not implemented"
|
|
233
|
-
throw new NotImplementedError();
|
|
234
|
-
|
|
235
|
-
// Warning: "TODO: finish this"
|
|
236
|
-
throw new NotImplementedError("TODO: finish this");
|
|
237
|
-
```
|
|
238
|
-
|