@sarj/eslint-plugin 9.7.1 → 9.8.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
@@ -12,11 +12,47 @@ import sarj from "@sarj/eslint-plugin";
12
12
  export default [...sarj.configs.recommended];
13
13
  ```
14
14
 
15
- 55 rules. Each source under `src/rules/` states one concise claim and links to
15
+ 57 rules. Each source under `src/rules/` states one concise claim and links to
16
16
  its paired tests. The definition and named test cases are the complete rule
17
17
  specification, and `meta.docs.url` points directly to those executable examples.
18
18
 
19
- Presets: `recommended` (warn-first), `strict` (every shipped rule at its declared strict severity), `style-guide` (formatting/naming subset). The two-sentence comment rule warns; its three-sentence companion errors.
19
+ Presets: `recommended` (warn-first), `strict` (every general-profile rule at its declared strict severity), `style-guide` (formatting/naming subset). Application-only rules are exported through `applicationOnlyRules` and configured by the application profile. The two-sentence comment rule warns; its three-sentence companion errors.
20
+
21
+ ## New in 9.8.0 — application library policy adapters
22
+
23
+ `no-restricted-library-load` extends a configured dependency policy to runtime
24
+ loading forms that ESLint's `no-restricted-imports` does not cover: literal
25
+ `import()`, unshadowed `require()` / `require.resolve()`, and TypeScript
26
+ `import x = require(...)`. It matches a package and all of its subpaths, but
27
+ deliberately ignores computed names and shadowed local `require` functions.
28
+
29
+ `prefer-native-random-uuid` reports resolved, zero-argument UUID v4 calls from
30
+ the `uuid` package and suggests `globalThis.crypto.randomUUID()`. The suggestion
31
+ changes only the call; import cleanup remains explicit. Other UUID versions,
32
+ custom-randomness arguments, re-exports, and function references are untouched.
33
+
34
+ Neither rule is in the general presets. The application profile configures them
35
+ for its Node 22+ runtime contract and supplies catalog entries to the loader
36
+ rule:
37
+
38
+ ```js
39
+ rules: {
40
+ "@sarj/no-restricted-library-load": [
41
+ "error",
42
+ {
43
+ libraries: [
44
+ {
45
+ id: "LIB101",
46
+ module: "axios",
47
+ replacement: "Ky",
48
+ note: "The APIs are not drop-in equivalents.",
49
+ },
50
+ ],
51
+ },
52
+ ],
53
+ "@sarj/prefer-native-random-uuid": "error",
54
+ }
55
+ ```
20
56
 
21
57
  ## Renamed in 7.0.0, aliases deleted in 9.0.0 (breaking)
22
58