lint-suite 2.0.1 → 2.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 +27 -7
- package/eslint.js +221 -85
- package/eslint.js.map +4 -4
- package/lib/rules/file-cache.d.ts +1 -1
- package/lib/rules/file-cache.d.ts.map +1 -1
- package/lib/rules/no-unstyled-classes/styles/stylesheet-classes.d.ts.map +1 -1
- package/lib/rules/no-unstyled-classes/styles/stylesheet-collection.d.ts +1 -1
- package/lib/rules/no-unstyled-classes/styles/stylesheet-collection.d.ts.map +1 -1
- package/lib/rules/no-unstyled-classes/styles/stylesheet-imports.d.ts +8 -1
- package/lib/rules/no-unstyled-classes/styles/stylesheet-imports.d.ts.map +1 -1
- package/lib/rules/no-unused-angular-instance-fields/project-usage/angular/angular-template-reads.d.ts.map +1 -1
- package/lib/rules/no-unused-angular-instance-fields/project-usage/common/project-index.type.d.ts +1 -0
- package/lib/rules/no-unused-angular-instance-fields/project-usage/common/project-index.type.d.ts.map +1 -1
- package/lib/rules/no-unused-angular-instance-fields/project-usage/project-file-entry.d.ts.map +1 -1
- package/lib/rules/no-unused-angular-instance-fields/project-usage/project-index-reconciliation.d.ts.map +1 -1
- package/lib/rules/no-unused-angular-instance-fields/project-usage/typescript/typescript-dangling-imports.d.ts +8 -0
- package/lib/rules/no-unused-angular-instance-fields/project-usage/typescript/typescript-dangling-imports.d.ts.map +1 -0
- package/lib/rules/no-unused-classes/no-unused-classes.d.ts.map +1 -1
- package/lib/rules/no-unused-classes/template/template-usage.d.ts.map +1 -1
- package/lib/rules/no-unused-exports/common/no-unused-exports.type.d.ts +9 -1
- package/lib/rules/no-unused-exports/common/no-unused-exports.type.d.ts.map +1 -1
- package/lib/rules/no-unused-exports/disk-resolver.d.ts +9 -0
- package/lib/rules/no-unused-exports/disk-resolver.d.ts.map +1 -0
- package/lib/rules/no-unused-exports/export-index.d.ts.map +1 -1
- package/lib/rules/no-unused-exports/utils/module-edges.util.d.ts +3 -3
- package/lib/rules/no-unused-exports/utils/module-edges.util.d.ts.map +1 -1
- package/lib/rules/no-unused-exports/utils/module-resolver.util.d.ts +8 -0
- package/lib/rules/no-unused-exports/utils/module-resolver.util.d.ts.map +1 -0
- package/lib/rules/package-version.d.ts +2 -0
- package/lib/rules/package-version.d.ts.map +1 -0
- package/lib/rules/utils/template-classes.util.d.ts +2 -0
- package/lib/rules/utils/template-classes.util.d.ts.map +1 -1
- package/lib/typescript-safety.d.ts.map +1 -1
- package/package.json +4 -7
- package/stylelint.js +96 -28
- package/stylelint.js.map +4 -4
- package/eslint.cjs +0 -7363
- package/eslint.cjs.map +0 -7
- package/lib/rules/no-unused-exports/utils/module-target.util.d.ts +0 -4
- package/lib/rules/no-unused-exports/utils/module-target.util.d.ts.map +0 -1
- package/prettier.cjs +0 -50
- package/prettier.cjs.map +0 -7
- package/stylelint.cjs +0 -947
- package/stylelint.cjs.map +0 -7
package/README.md
CHANGED
|
@@ -44,6 +44,9 @@ import { recommended } from 'lint-suite/eslint';
|
|
|
44
44
|
export default [...recommended];
|
|
45
45
|
```
|
|
46
46
|
|
|
47
|
+
The package ships as ESM only. A CommonJS config (`eslint.config.cjs`) can
|
|
48
|
+
still `require('lint-suite/eslint')` on Node 20.19+ / 22.12+.
|
|
49
|
+
|
|
47
50
|
Or selectively include configurations:
|
|
48
51
|
|
|
49
52
|
```js
|
|
@@ -110,8 +113,9 @@ export default [
|
|
|
110
113
|
|
|
111
114
|
`no-unstyled-classes`, `no-unused-classes`, and `no-unused-instance-fields`
|
|
112
115
|
parse component metadata, stylesheets, and templates once per file and keep
|
|
113
|
-
the result in memory for the life of the process, keyed by the
|
|
114
|
-
and
|
|
116
|
+
the result in memory for the life of the process, keyed by the installed
|
|
117
|
+
lint-suite version and the file's mtime and size, so an upgrade reparses
|
|
118
|
+
every file. The same entries are mirrored to
|
|
115
119
|
`node_modules/.cache/lint-suite/*.json` under the current working directory
|
|
116
120
|
at process exit, so the next ESLint or stylelint process (a CI run, or an
|
|
117
121
|
editor's first lint) skips every parse of a file that did not change. Set
|
|
@@ -170,13 +174,20 @@ templates can read a component or directive member:
|
|
|
170
174
|
folder, are re-read on every lint; edits to templates in other folders are
|
|
171
175
|
picked up on a throttled schedule (at most every 100× the duration of the
|
|
172
176
|
last check), so a cross-folder template edit can take a moment to show up
|
|
173
|
-
in another file's diagnostics.
|
|
177
|
+
in another file's diagnostics. A `templateUrl` file that does not exist
|
|
178
|
+
yet is remembered as missing and read on the same schedule once it does.
|
|
174
179
|
- `analysis` defaults to `'local'`. Project mode excludes spec-file reads. A
|
|
175
180
|
file it cannot index exactly (a template that does not parse, metadata it
|
|
176
181
|
cannot evaluate, a read it cannot type) falls back to name matching for
|
|
177
182
|
that file only: every member whose name that file mentions counts as read.
|
|
178
183
|
Set `LINT_SUITE_DEBUG=1` to print which files fell back and why, for
|
|
179
184
|
example `LINT_SUITE_DEBUG=1 eslint --no-cache src/app/some.component.ts`.
|
|
185
|
+
- A file with an import that resolves to no module (its file does not exist
|
|
186
|
+
yet, or is still empty) reads through untyped values, so every candidate
|
|
187
|
+
member it mentions counts as read, and it is re-indexed on every Program
|
|
188
|
+
until the import resolves. The project service of typescript-eslint never
|
|
189
|
+
retries a resolution that failed, so in an editor this lasts until the
|
|
190
|
+
importing file is edited or ESLint restarts.
|
|
180
191
|
- `allowEffectFields` defaults to `false`. When enabled, fields holding
|
|
181
192
|
auto-cleaned Angular `effect()` calls are allowed; effects configured with
|
|
182
193
|
`manualCleanup: true` must still be read.
|
|
@@ -207,7 +218,9 @@ literal class names inside `[class]="..."` expressions and `class="a {{ b }}"`
|
|
|
207
218
|
interpolations. String literals, object-literal keys, array elements, and both
|
|
208
219
|
branches of a ternary contribute names; identifiers, calls, pipes, and `+`
|
|
209
220
|
concatenations contribute nothing, so a class the rule cannot see is never
|
|
210
|
-
reported. `[ngClass]` is deliberately not analysed.
|
|
221
|
+
reported. `[ngClass]` is deliberately not analysed. `routerLinkActive`,
|
|
222
|
+
`animate.enter`, and `animate.leave` are also read as class lists, static or
|
|
223
|
+
bound.
|
|
211
224
|
|
|
212
225
|
Stylesheets come from the component beside the template: `styleUrl`,
|
|
213
226
|
`styleUrls`, and inline `styles` read as string or template literals from the
|
|
@@ -278,13 +291,17 @@ Selectors resolve through the same parser as the ESLint rule, so `&__element`,
|
|
|
278
291
|
`&--modifier`, `&.other`, `& > .child`, `.wrapper &`, `@media` blocks, and
|
|
279
292
|
selector lists all report the resolved name on the rule that declares it: in
|
|
280
293
|
`.panel { .inner {} }` only `inner` is checked on the inner rule, never `panel`
|
|
281
|
-
twice.
|
|
294
|
+
twice. A rule that only wraps nested rules, like `.dialog` in
|
|
295
|
+
`.dialog { &__name {} }`, emits no selector of its own and is never reported;
|
|
296
|
+
`.shell` in `.shell { .inner {} }` still is, because `.shell .inner` reaches
|
|
297
|
+
the output. Arguments of `:host(.dark)` and `:host-context(.rtl)` are skipped, and
|
|
282
298
|
everything after `::ng-deep`, `/deep/`, or `>>>` is skipped too, because those
|
|
283
299
|
classes live in other templates. A selector built with interpolation
|
|
284
300
|
(`.icon-#{$size}`) is never reported, and `@extend .base` counts `base` as
|
|
285
301
|
used.
|
|
286
302
|
|
|
287
|
-
The template side reads the same sources as `no-unstyled-classes`
|
|
303
|
+
The template side reads the same sources as `no-unstyled-classes` (including
|
|
304
|
+
`routerLinkActive`, `animate.enter`, and `animate.leave`, static or bound) plus
|
|
288
305
|
`[ngClass]`, and it does not skip custom elements: a class on
|
|
289
306
|
`<app-child class="foo">` is written by this template, so `.foo` counts as
|
|
290
307
|
used. When any template of the stylesheet holds a class source the rule cannot
|
|
@@ -468,7 +485,10 @@ export (values and types) that no other file in the TypeScript program
|
|
|
468
485
|
imports, and a module that exports names but is never imported at all.
|
|
469
486
|
|
|
470
487
|
- Source of truth is the program typescript-eslint already built for the
|
|
471
|
-
type-aware rules: no extra parse, no file enumeration
|
|
488
|
+
type-aware rules: no extra parse, no file enumeration. The disk is only
|
|
489
|
+
asked about a specifier the checker cannot resolve, because the project
|
|
490
|
+
service of typescript-eslint never retries a failed resolution; such a file
|
|
491
|
+
is re-read on every Program until the specifier resolves.
|
|
472
492
|
- Per file the rule walks top-level statements, plus every node of a file
|
|
473
493
|
whose text contains `import(`, and caches the result
|
|
474
494
|
on the `ts.SourceFile` object; the project-wide usage map is cached per
|