lint-suite 2.0.2 → 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.
Files changed (39) hide show
  1. package/README.md +18 -4
  2. package/eslint.js +204 -81
  3. package/eslint.js.map +4 -4
  4. package/lib/rules/file-cache.d.ts +1 -1
  5. package/lib/rules/file-cache.d.ts.map +1 -1
  6. package/lib/rules/no-unstyled-classes/styles/stylesheet-classes.d.ts.map +1 -1
  7. package/lib/rules/no-unstyled-classes/styles/stylesheet-collection.d.ts +1 -1
  8. package/lib/rules/no-unstyled-classes/styles/stylesheet-collection.d.ts.map +1 -1
  9. package/lib/rules/no-unstyled-classes/styles/stylesheet-imports.d.ts +8 -1
  10. package/lib/rules/no-unstyled-classes/styles/stylesheet-imports.d.ts.map +1 -1
  11. package/lib/rules/no-unused-angular-instance-fields/project-usage/angular/angular-template-reads.d.ts.map +1 -1
  12. package/lib/rules/no-unused-angular-instance-fields/project-usage/common/project-index.type.d.ts +1 -0
  13. package/lib/rules/no-unused-angular-instance-fields/project-usage/common/project-index.type.d.ts.map +1 -1
  14. package/lib/rules/no-unused-angular-instance-fields/project-usage/project-file-entry.d.ts.map +1 -1
  15. package/lib/rules/no-unused-angular-instance-fields/project-usage/project-index-reconciliation.d.ts.map +1 -1
  16. package/lib/rules/no-unused-angular-instance-fields/project-usage/typescript/typescript-dangling-imports.d.ts +8 -0
  17. package/lib/rules/no-unused-angular-instance-fields/project-usage/typescript/typescript-dangling-imports.d.ts.map +1 -0
  18. package/lib/rules/no-unused-exports/common/no-unused-exports.type.d.ts +9 -1
  19. package/lib/rules/no-unused-exports/common/no-unused-exports.type.d.ts.map +1 -1
  20. package/lib/rules/no-unused-exports/disk-resolver.d.ts +9 -0
  21. package/lib/rules/no-unused-exports/disk-resolver.d.ts.map +1 -0
  22. package/lib/rules/no-unused-exports/export-index.d.ts.map +1 -1
  23. package/lib/rules/no-unused-exports/utils/module-edges.util.d.ts +3 -3
  24. package/lib/rules/no-unused-exports/utils/module-edges.util.d.ts.map +1 -1
  25. package/lib/rules/no-unused-exports/utils/module-resolver.util.d.ts +8 -0
  26. package/lib/rules/no-unused-exports/utils/module-resolver.util.d.ts.map +1 -0
  27. package/lib/rules/package-version.d.ts +2 -0
  28. package/lib/rules/package-version.d.ts.map +1 -0
  29. package/package.json +4 -7
  30. package/stylelint.js +65 -18
  31. package/stylelint.js.map +4 -4
  32. package/eslint.cjs +0 -7376
  33. package/eslint.cjs.map +0 -7
  34. package/lib/rules/no-unused-exports/utils/module-target.util.d.ts +0 -4
  35. package/lib/rules/no-unused-exports/utils/module-target.util.d.ts.map +0 -1
  36. package/prettier.cjs +0 -50
  37. package/prettier.cjs.map +0 -7
  38. package/stylelint.cjs +0 -968
  39. 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 file's mtime
114
- and size. The same entries are mirrored to
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.
@@ -474,7 +485,10 @@ export (values and types) that no other file in the TypeScript program
474
485
  imports, and a module that exports names but is never imported at all.
475
486
 
476
487
  - Source of truth is the program typescript-eslint already built for the
477
- type-aware rules: no extra parse, no file enumeration, no filesystem.
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.
478
492
  - Per file the rule walks top-level statements, plus every node of a file
479
493
  whose text contains `import(`, and caches the result
480
494
  on the `ts.SourceFile` object; the project-wide usage map is cached per