@sarj/eslint-plugin 2.11.0 → 2.12.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/dist/index.cjs +459 -46
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +29 -1
- package/dist/index.d.ts +29 -1
- package/dist/index.js +459 -46
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -66,7 +66,8 @@ interface RuleOptions$2 {
|
|
|
66
66
|
* NOT FLAGGED
|
|
67
67
|
* - Files whose path matches one of the `allow` patterns. The defaults cover
|
|
68
68
|
* the conventions we have seen in practice — a `clients/` directory, a
|
|
69
|
-
* `*-client.ts` module, an `http-client.*` wrapper
|
|
69
|
+
* `*-client.ts` module, an `http-client.*` wrapper, an `api/` directory or
|
|
70
|
+
* `api.ts` / `*-api.ts` module — plus test files and codemod fixtures.
|
|
70
71
|
* - A method named `fetch` on some other receiver (`cache.fetch(k)`,
|
|
71
72
|
* `queryClient.fetch()`): only the global is HTTP.
|
|
72
73
|
* - `new Request(...)` / `axios(...)` and friends. This rule is about the
|
|
@@ -83,6 +84,21 @@ interface RuleOptions$2 {
|
|
|
83
84
|
*
|
|
84
85
|
* Supplying `allow` REPLACES the defaults, so include the test patterns if you
|
|
85
86
|
* still want test files exempt.
|
|
87
|
+
*
|
|
88
|
+
* CORPUS SWEEP (2220 files, zod / TanStack Query / react-router / swr /
|
|
89
|
+
* zustand, 2026-07): 96 raw hits. The defaults missed three path conventions
|
|
90
|
+
* that ARE the client layer, so the reports landed on the very modules the rule
|
|
91
|
+
* wants the `fetch` to live in:
|
|
92
|
+
* - `api.ts` / `api/` / `*-api.ts` — 15 hits, e.g.
|
|
93
|
+
* `query/examples/react/star-wars/src/api.ts:7`, a module that exists solely
|
|
94
|
+
* to own `getFilm`/`getPerson` HTTP calls. `api` is the same convention
|
|
95
|
+
* family as `clients/`, just the other common spelling.
|
|
96
|
+
* - Hyphenated test basenames (`*-test.ts` / `*-spec.ts`) — the default list
|
|
97
|
+
* only knew the dotted `*.test.ts` form, so react-router's entire suite
|
|
98
|
+
* (which names files `single-fetch-test.ts`) was unprotected.
|
|
99
|
+
* - `__testfixtures__/` — 8 hits from jscodeshift fixtures such as
|
|
100
|
+
* `query/packages/query-codemods/src/v5/remove-overloads/__testfixtures__/bug-reports.input.tsx`,
|
|
101
|
+
* which are input/output text for a codemod, not code that runs.
|
|
86
102
|
*/
|
|
87
103
|
|
|
88
104
|
interface RuleOptions$1 {
|
|
@@ -116,6 +132,18 @@ interface RuleOptions$1 {
|
|
|
116
132
|
* mechanism, not a bypass of it.
|
|
117
133
|
* - `.prepare()` on something that is not a database. Requiring an
|
|
118
134
|
* interpolated runtime value keeps this rare in practice.
|
|
135
|
+
* - A statement text that contains no SQL data-statement keyword. `exec` and
|
|
136
|
+
* `query` are not SQL-specific names: a 5-repo sweep of real TypeScript
|
|
137
|
+
* (zod / TanStack Query / react-router / swr / zustand, 2,186 files) found
|
|
138
|
+
* 4/4 hits were `child_process.exec` building a SHELL command line —
|
|
139
|
+
* an `open <url>` at
|
|
140
|
+
* react-router/integration/helpers/playwright-fixture.ts:230 and an
|
|
141
|
+
* `npm view <pkg>@<version> version` at
|
|
142
|
+
* react-router/scripts/changes/publish.ts:111. Requiring the statement to
|
|
143
|
+
* actually read as SQL (`SELECT` / `INSERT INTO` / `UPDATE` / `DELETE FROM`
|
|
144
|
+
* / DDL / `PRAGMA` / a CTE head) takes that class to zero without touching
|
|
145
|
+
* any real injection: an interpolated statement with no SQL verb in it was
|
|
146
|
+
* never a SQL statement.
|
|
119
147
|
*
|
|
120
148
|
* CONFIGURATION
|
|
121
149
|
* `methods` is the list of statement-taking method names to inspect. Extend it
|
package/dist/index.d.ts
CHANGED
|
@@ -66,7 +66,8 @@ interface RuleOptions$2 {
|
|
|
66
66
|
* NOT FLAGGED
|
|
67
67
|
* - Files whose path matches one of the `allow` patterns. The defaults cover
|
|
68
68
|
* the conventions we have seen in practice — a `clients/` directory, a
|
|
69
|
-
* `*-client.ts` module, an `http-client.*` wrapper
|
|
69
|
+
* `*-client.ts` module, an `http-client.*` wrapper, an `api/` directory or
|
|
70
|
+
* `api.ts` / `*-api.ts` module — plus test files and codemod fixtures.
|
|
70
71
|
* - A method named `fetch` on some other receiver (`cache.fetch(k)`,
|
|
71
72
|
* `queryClient.fetch()`): only the global is HTTP.
|
|
72
73
|
* - `new Request(...)` / `axios(...)` and friends. This rule is about the
|
|
@@ -83,6 +84,21 @@ interface RuleOptions$2 {
|
|
|
83
84
|
*
|
|
84
85
|
* Supplying `allow` REPLACES the defaults, so include the test patterns if you
|
|
85
86
|
* still want test files exempt.
|
|
87
|
+
*
|
|
88
|
+
* CORPUS SWEEP (2220 files, zod / TanStack Query / react-router / swr /
|
|
89
|
+
* zustand, 2026-07): 96 raw hits. The defaults missed three path conventions
|
|
90
|
+
* that ARE the client layer, so the reports landed on the very modules the rule
|
|
91
|
+
* wants the `fetch` to live in:
|
|
92
|
+
* - `api.ts` / `api/` / `*-api.ts` — 15 hits, e.g.
|
|
93
|
+
* `query/examples/react/star-wars/src/api.ts:7`, a module that exists solely
|
|
94
|
+
* to own `getFilm`/`getPerson` HTTP calls. `api` is the same convention
|
|
95
|
+
* family as `clients/`, just the other common spelling.
|
|
96
|
+
* - Hyphenated test basenames (`*-test.ts` / `*-spec.ts`) — the default list
|
|
97
|
+
* only knew the dotted `*.test.ts` form, so react-router's entire suite
|
|
98
|
+
* (which names files `single-fetch-test.ts`) was unprotected.
|
|
99
|
+
* - `__testfixtures__/` — 8 hits from jscodeshift fixtures such as
|
|
100
|
+
* `query/packages/query-codemods/src/v5/remove-overloads/__testfixtures__/bug-reports.input.tsx`,
|
|
101
|
+
* which are input/output text for a codemod, not code that runs.
|
|
86
102
|
*/
|
|
87
103
|
|
|
88
104
|
interface RuleOptions$1 {
|
|
@@ -116,6 +132,18 @@ interface RuleOptions$1 {
|
|
|
116
132
|
* mechanism, not a bypass of it.
|
|
117
133
|
* - `.prepare()` on something that is not a database. Requiring an
|
|
118
134
|
* interpolated runtime value keeps this rare in practice.
|
|
135
|
+
* - A statement text that contains no SQL data-statement keyword. `exec` and
|
|
136
|
+
* `query` are not SQL-specific names: a 5-repo sweep of real TypeScript
|
|
137
|
+
* (zod / TanStack Query / react-router / swr / zustand, 2,186 files) found
|
|
138
|
+
* 4/4 hits were `child_process.exec` building a SHELL command line —
|
|
139
|
+
* an `open <url>` at
|
|
140
|
+
* react-router/integration/helpers/playwright-fixture.ts:230 and an
|
|
141
|
+
* `npm view <pkg>@<version> version` at
|
|
142
|
+
* react-router/scripts/changes/publish.ts:111. Requiring the statement to
|
|
143
|
+
* actually read as SQL (`SELECT` / `INSERT INTO` / `UPDATE` / `DELETE FROM`
|
|
144
|
+
* / DDL / `PRAGMA` / a CTE head) takes that class to zero without touching
|
|
145
|
+
* any real injection: an interpolated statement with no SQL verb in it was
|
|
146
|
+
* never a SQL statement.
|
|
119
147
|
*
|
|
120
148
|
* CONFIGURATION
|
|
121
149
|
* `methods` is the list of statement-taking method names to inspect. Extend it
|