@zukhruf/eslint 0.8.21 → 0.8.23
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 +21 -14
- package/dist/authoring/json-ast.d.ts +13 -0
- package/dist/authoring/json-ast.d.ts.map +1 -0
- package/dist/authoring/json-ast.js +33 -0
- package/dist/authoring/json-ast.js.map +1 -0
- package/dist/base/config.d.ts.map +1 -1
- package/dist/base/config.js +10 -0
- package/dist/base/config.js.map +1 -1
- package/dist/{test-files → imports}/no-raw-temp-directory.d.ts +3 -3
- package/dist/imports/no-raw-temp-directory.d.ts.map +1 -0
- package/dist/{test-files → imports}/no-raw-temp-directory.js +5 -5
- package/dist/imports/no-raw-temp-directory.js.map +1 -0
- package/dist/manifest/no-truncated-description.d.ts.map +1 -1
- package/dist/manifest/no-truncated-description.js +3 -11
- package/dist/manifest/no-truncated-description.js.map +1 -1
- package/dist/manifest/nx-family-pinned.d.ts +13 -0
- package/dist/manifest/nx-family-pinned.d.ts.map +1 -0
- package/dist/manifest/nx-family-pinned.js +89 -0
- package/dist/manifest/nx-family-pinned.js.map +1 -0
- package/dist/manifest/plugin.d.ts +3 -1
- package/dist/manifest/plugin.d.ts.map +1 -1
- package/dist/manifest/plugin.js +5 -1
- package/dist/manifest/plugin.js.map +1 -1
- package/dist/nx-project/no-missing-asset-input.d.ts.map +1 -1
- package/dist/nx-project/no-missing-asset-input.js +20 -28
- package/dist/nx-project/no-missing-asset-input.js.map +1 -1
- package/dist/plugin.d.ts.map +1 -1
- package/dist/plugin.js +2 -10
- package/dist/plugin.js.map +1 -1
- package/dist/test-files/config.d.ts.map +1 -1
- package/dist/test-files/config.js +0 -2
- package/dist/test-files/config.js.map +1 -1
- package/package.json +4 -3
- package/dist/test-files/no-raw-temp-directory.d.ts.map +0 -1
- package/dist/test-files/no-raw-temp-directory.js.map +0 -1
package/README.md
CHANGED
|
@@ -40,20 +40,20 @@ Put framework configs (for example [`@zukhruf/eslint/react`](#react)) **before**
|
|
|
40
40
|
|
|
41
41
|
## Configs
|
|
42
42
|
|
|
43
|
-
| Config | Files | Rules
|
|
44
|
-
| ----------------- | ------------------------------------- |
|
|
45
|
-
| `base` | all source | `@eslint/js` and `typescript-eslint` recommended; `consistent-type-assertions` (never), `no-namespace` (a `declare` namespace allowed), `zukhruf/no-enum`, `no-empty-object-type` (an interface that extends one type allowed, such as `ProcessEnv` in `env.ts`; `no-empty-interface`, which it replaced, is off); `import-x/no-duplicates`, `import-x/no-unassigned-import` (allows `**/*.css`, `**/env.ts` and `**/startup.ts`); `import-x/extensions` (a relative import names its extension, `./x.js` or `./x.ts`, also in a type import; packages and `#` subpath imports are skipped, and so are `.cjs` and `.cts` files); `functional/no-let` (module scope); `zukhruf/no-state-managers`, `zukhruf/no-playwright-test`, `zukhruf/no-other-test-runner`, `zukhruf/no-test-file-import`, `zukhruf/no-raw-database-sync`, `zukhruf/no-collect-loop`, `zukhruf/no-captured-assignment` (off, see [ADR 0007](./docs/adr/0007-no-captured-assignment-is-off-until-the-repos-are-clean.md)); typed lint: `no-floating-promises`, `no-misused-promises`, `only-throw-error`, `switch-exhaustiveness-check` (a `default` counts as exhaustive), `no-deprecated`, `zukhruf/no-promise-field`, `zukhruf/no-phase-flag`; `no-require-imports` is off in `.cjs` and `.cts`, because `require()` is the only import form in a CommonJS file |
|
|
46
|
-
| `tests` | test files, `src/testing` | `no-test-lifecycle-hooks`, `no-process-env-write`, `no-direct-msw-server`, `no-catch-all-msw-handler`, `no-timer-race`, `no-sleep-poll-loop`, `no-wall-clock-bound`, `no-short-test-timeout` (reports only with a `minimum`), `no-global-test-mock
|
|
47
|
-
| `diagnostics` | source, not tests | `no-fabricated-fallback`, `no-hardcoded-id-shape`, `consistent-event-name`
|
|
48
|
-
| `env` | TypeScript, not tests or tool configs | `no-undeclared-process-env`, `no-single-env-read-wrapper`, `no-default-for-path-env`
|
|
49
|
-
| `packaged-app` | TypeScript, not tests | `no-bare-spawn`
|
|
50
|
-
| `react` | `.tsx`, `.jsx` | `no-as-child`
|
|
51
|
-
| `react-router` | source | `require-loader-data-type-argument`; outside tests: `no-raw-route-path`, `no-internal-anchor`; TypeScript: `only-throw-error` allows a `Response` and `DataWithResponseInit`
|
|
52
|
-
| `hono` | TypeScript, not tests | `no-untyped-empty-json`, `no-http-exception-factory`, `no-catch-around-next`
|
|
53
|
-
| `better-auth` | TypeScript, not tests | `no-api-error-instanceof`, `no-on-api-error-throw`
|
|
54
|
-
| `tailwind` | source | `no-h-screen`, `no-arbitrary-z-index`, `no-will-change`
|
|
55
|
-
| `pulumi` | TypeScript | `require-server-replace-guard`
|
|
56
|
-
| `nx-project-json` | `project.json` | `no-missing-asset-input`
|
|
43
|
+
| Config | Files | Rules |
|
|
44
|
+
| ----------------- | ------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
45
|
+
| `base` | all source | `@eslint/js` and `typescript-eslint` recommended; `consistent-type-assertions` (never), `no-namespace` (a `declare` namespace allowed), `zukhruf/no-enum`, `no-empty-object-type` (an interface that extends one type allowed, such as `ProcessEnv` in `env.ts`; `no-empty-interface`, which it replaced, is off); `import-x/no-duplicates`, `import-x/no-unassigned-import` (allows `**/*.css`, `**/env.ts` and `**/startup.ts`); `import-x/extensions` (a relative import names its extension, `./x.js` or `./x.ts`, also in a type import; packages and `#` subpath imports are skipped, and so are `.cjs` and `.cts` files); `functional/no-let` (module scope); `zukhruf/no-state-managers`, `zukhruf/no-playwright-test`, `zukhruf/no-other-test-runner`, `zukhruf/no-test-file-import`, `zukhruf/no-raw-database-sync`, `zukhruf/no-raw-temp-directory`, `zukhruf/no-collect-loop`, `zukhruf/no-captured-assignment` (off, see [ADR 0007](./docs/adr/0007-no-captured-assignment-is-off-until-the-repos-are-clean.md)); typed lint: `no-floating-promises`, `return-await` (only where a missing `await` changes behaviour: in `try`, `catch`, `finally` and a scope that holds a `using` declaration), `no-misused-promises`, `only-throw-error`, `switch-exhaustiveness-check` (a `default` counts as exhaustive), `no-deprecated`, `zukhruf/no-promise-field`, `zukhruf/no-phase-flag`; `no-require-imports` is off in `.cjs` and `.cts`, because `require()` is the only import form in a CommonJS file |
|
|
46
|
+
| `tests` | test files, `src/testing` | `no-test-lifecycle-hooks`, `no-process-env-write`, `no-direct-msw-server`, `no-catch-all-msw-handler`, `no-timer-race`, `no-sleep-poll-loop`, `no-wall-clock-bound`, `no-short-test-timeout` (reports only with a `minimum`), `no-global-test-mock` |
|
|
47
|
+
| `diagnostics` | source, not tests | `no-fabricated-fallback`, `no-hardcoded-id-shape`, `consistent-event-name` |
|
|
48
|
+
| `env` | TypeScript, not tests or tool configs | `no-undeclared-process-env`, `no-single-env-read-wrapper`, `no-default-for-path-env` |
|
|
49
|
+
| `packaged-app` | TypeScript, not tests | `no-bare-spawn` |
|
|
50
|
+
| `react` | `.tsx`, `.jsx` | `no-as-child` |
|
|
51
|
+
| `react-router` | source | `require-loader-data-type-argument`; outside tests: `no-raw-route-path`, `no-internal-anchor`; TypeScript: `only-throw-error` allows a `Response` and `DataWithResponseInit` |
|
|
52
|
+
| `hono` | TypeScript, not tests | `no-untyped-empty-json`, `no-http-exception-factory`, `no-catch-around-next` |
|
|
53
|
+
| `better-auth` | TypeScript, not tests | `no-api-error-instanceof`, `no-on-api-error-throw` |
|
|
54
|
+
| `tailwind` | source | `no-h-screen`, `no-arbitrary-z-index`, `no-will-change` |
|
|
55
|
+
| `pulumi` | TypeScript | `require-server-replace-guard` |
|
|
56
|
+
| `nx-project-json` | `project.json` | `no-missing-asset-input` |
|
|
57
57
|
|
|
58
58
|
`base` turns on typed lint (`parserOptions.projectService`). Each linted TypeScript file must be in a tsconfig.
|
|
59
59
|
|
|
@@ -213,6 +213,13 @@ The rule decides each manifest's options itself, so your options add to the shar
|
|
|
213
213
|
|
|
214
214
|
`manifest/recommended` also has `manifest/no-truncated-description`. The npm registry keeps only the first 255 characters of a package's `description`. `npm view` and the npm search do not show the rest. The rule reports a `description` that is longer than 255 characters. It does not check a manifest with `"private": true`, because npm does not publish it. Put the key fact in the description, and put the details in the README.
|
|
215
215
|
|
|
216
|
+
`manifest/recommended` also has `manifest/nx-family-pinned`. `nx` ships a native addon, and each `@nx/*` package depends on `nx` at its own version. When two versions are asked for, npm nests a second `nx`, with its own addon, under the package that asked. So the rule allows one version of the nx family:
|
|
217
|
+
|
|
218
|
+
- In the workspace root `package.json`, every `nx` and `@nx/*` entry in `dependencies`, `devDependencies` and `optionalDependencies` has an exact version, with no range operator, and that version is the version of the root's `nx`.
|
|
219
|
+
- Every other `package.json` names `nx` and `@nx/*` packages only in `peerDependencies`, with any range.
|
|
220
|
+
|
|
221
|
+
The workspace root is the nearest folder with an `nx.json`, a `pnpm-workspace.yaml`, or a `package.json` that declares `workspaces`. A `package.json` outside any workspace is a root itself. The rule runs on each `package.json` that ESLint lints, so the root's clause runs only where the root `package.json` is linted.
|
|
222
|
+
|
|
216
223
|
## React
|
|
217
224
|
|
|
218
225
|
`@zukhruf/eslint/react` gives the configs that the React community maintains. The package adds no rule of its own to them and changes no severity. Use it in the `eslint.config.mjs` of a React project. Put it first, and then the root config, as before:
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type AstNode } from './ast.ts';
|
|
2
|
+
/**
|
|
3
|
+
* The name of the key of a JSON property. JSON reads only a quoted key, and so
|
|
4
|
+
* do `JSON.parse` and Nx's `parseJson`, which reject an identifier key.
|
|
5
|
+
*/
|
|
6
|
+
export declare function propertyKey(property: AstNode): string | undefined;
|
|
7
|
+
/**
|
|
8
|
+
* The properties of a JSON object, each with the name of its key, as
|
|
9
|
+
* `JSON.parse` reads them: when two properties have the same key, the last one
|
|
10
|
+
* wins and the earlier one is not included.
|
|
11
|
+
*/
|
|
12
|
+
export declare function objectProperties(object: unknown): [string, AstNode][];
|
|
13
|
+
//# sourceMappingURL=json-ast.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"json-ast.d.ts","sourceRoot":"","sources":["../../src/authoring/json-ast.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAU,MAAM,UAAU,CAAC;AAEhD;;;GAGG;AACH,wBAAgB,WAAW,CAAC,QAAQ,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAKjE;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,OAAO,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAWrE"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { isType } from "./ast.js";
|
|
2
|
+
/**
|
|
3
|
+
* The name of the key of a JSON property. JSON reads only a quoted key, and so
|
|
4
|
+
* do `JSON.parse` and Nx's `parseJson`, which reject an identifier key.
|
|
5
|
+
*/
|
|
6
|
+
export function propertyKey(property) {
|
|
7
|
+
const key = property['key'];
|
|
8
|
+
return isType(key, 'JSONLiteral') && typeof key['value'] === 'string'
|
|
9
|
+
? key['value']
|
|
10
|
+
: undefined;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* The properties of a JSON object, each with the name of its key, as
|
|
14
|
+
* `JSON.parse` reads them: when two properties have the same key, the last one
|
|
15
|
+
* wins and the earlier one is not included.
|
|
16
|
+
*/
|
|
17
|
+
export function objectProperties(object) {
|
|
18
|
+
if (!isType(object, 'JSONObjectExpression'))
|
|
19
|
+
return [];
|
|
20
|
+
const entries = object['properties'];
|
|
21
|
+
if (!Array.isArray(entries))
|
|
22
|
+
return [];
|
|
23
|
+
const properties = new Map();
|
|
24
|
+
for (const property of entries) {
|
|
25
|
+
if (!isType(property, 'JSONProperty'))
|
|
26
|
+
continue;
|
|
27
|
+
const key = propertyKey(property);
|
|
28
|
+
if (key !== undefined)
|
|
29
|
+
properties.set(key, property);
|
|
30
|
+
}
|
|
31
|
+
return [...properties];
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=json-ast.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"json-ast.js","sourceRoot":"","sources":["../../src/authoring/json-ast.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,MAAM,EAAE,MAAM,UAAU,CAAC;AAEhD;;;GAGG;AACH,MAAM,UAAU,WAAW,CAAC,QAAiB;IAC3C,MAAM,GAAG,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAC5B,OAAO,MAAM,CAAC,GAAG,EAAE,aAAa,CAAC,IAAI,OAAO,GAAG,CAAC,OAAO,CAAC,KAAK,QAAQ;QACnE,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC;QACd,CAAC,CAAC,SAAS,CAAC;AAChB,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,gBAAgB,CAAC,MAAe;IAC9C,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,sBAAsB,CAAC;QAAE,OAAO,EAAE,CAAC;IACvD,MAAM,OAAO,GAAG,MAAM,CAAC,YAAY,CAAC,CAAC;IACrC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC;QAAE,OAAO,EAAE,CAAC;IACvC,MAAM,UAAU,GAAG,IAAI,GAAG,EAAmB,CAAC;IAC9C,KAAK,MAAM,QAAQ,IAAI,OAAO,EAAE,CAAC;QAC/B,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE,cAAc,CAAC;YAAE,SAAS;QAChD,MAAM,GAAG,GAAG,WAAW,CAAC,QAAQ,CAAC,CAAC;QAClC,IAAI,GAAG,KAAK,SAAS;YAAE,UAAU,CAAC,GAAG,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;IACvD,CAAC;IACD,OAAO,CAAC,GAAG,UAAU,CAAC,CAAC;AACzB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/base/config.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,KAAK,OAAO,EAAU,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/base/config.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,KAAK,OAAO,EAAU,MAAM,eAAe,CAAC;AAuCrD;;;;GAIG;AACH,eAAO,MAAM,IAAI,EAAE,OAoMlB,CAAC"}
|
package/dist/base/config.js
CHANGED
|
@@ -13,6 +13,7 @@ import { BUILD_OUTPUT, COMMONJS, FIXTURES, JAVASCRIPT, SOURCE, TESTS, TEST_SUPPO
|
|
|
13
13
|
import noOtherTestRunner from "../imports/no-other-test-runner.js";
|
|
14
14
|
import noPlaywrightTest from "../imports/no-playwright-test.js";
|
|
15
15
|
import noRawDatabaseSync from "../imports/no-raw-database-sync.js";
|
|
16
|
+
import noRawTempDirectory from "../imports/no-raw-temp-directory.js";
|
|
16
17
|
import noStateManagers from "../imports/no-state-managers.js";
|
|
17
18
|
import noTestFileImport from "../imports/no-test-file-import.js";
|
|
18
19
|
import noEnum from "../language/no-enum.js";
|
|
@@ -24,6 +25,7 @@ const importBans = {
|
|
|
24
25
|
'no-other-test-runner': noOtherTestRunner,
|
|
25
26
|
'no-test-file-import': noTestFileImport,
|
|
26
27
|
'no-raw-database-sync': noRawDatabaseSync,
|
|
28
|
+
'no-raw-temp-directory': noRawTempDirectory,
|
|
27
29
|
};
|
|
28
30
|
const rules = {
|
|
29
31
|
'no-enum': noEnum,
|
|
@@ -189,6 +191,14 @@ export const base = {
|
|
|
189
191
|
'error',
|
|
190
192
|
noFloatingPromises(),
|
|
191
193
|
],
|
|
194
|
+
// A promise returned without await from a `try`, `catch` or
|
|
195
|
+
// `finally`, or from a scope that holds a `using` declaration,
|
|
196
|
+
// leaves that block while the work still runs: the `finally` runs
|
|
197
|
+
// and an `await using` resource is disposed under it.
|
|
198
|
+
'@typescript-eslint/return-await': [
|
|
199
|
+
'error',
|
|
200
|
+
'error-handling-correctness-only',
|
|
201
|
+
],
|
|
192
202
|
// A promise-returning function in a void slot loses its rejection
|
|
193
203
|
// the same way.
|
|
194
204
|
'@typescript-eslint/no-misused-promises': [
|
package/dist/base/config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/base/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,OAAO,UAAU,MAAM,0BAA0B,CAAC;AAClD,OAAO,OAAO,MAAM,wBAAwB,CAAC;AAC7C,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,OAAO,MAAM,SAAS,CAAC;AAC9B,OAAO,QAAQ,MAAM,mBAAmB,CAAC;AAEzC,OAAO,aAAa,MAAM,oCAAoC,CAAC;AAC/D,OAAO,cAAc,MAAM,qCAAqC,CAAC;AACjE,OAAO,WAAW,MAAM,iCAAiC,CAAC;AAC1D,OAAO,oBAAoB,MAAM,4CAA4C,CAAC;AAC9E,OAAO,EAAgB,MAAM,EAAE,MAAM,eAAe,CAAC;AACrD,OAAO,EACL,YAAY,EACZ,QAAQ,EACR,QAAQ,EACR,UAAU,EACV,MAAM,EACN,KAAK,EACL,YAAY,EACZ,UAAU,GACX,MAAM,aAAa,CAAC;AACrB,OAAO,iBAAiB,MAAM,oCAAoC,CAAC;AACnE,OAAO,gBAAgB,MAAM,kCAAkC,CAAC;AAChE,OAAO,iBAAiB,MAAM,oCAAoC,CAAC;AACnE,OAAO,eAAe,MAAM,iCAAiC,CAAC;AAC9D,OAAO,gBAAgB,MAAM,mCAAmC,CAAC;AACjE,OAAO,MAAM,MAAM,wBAAwB,CAAC;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,gCAA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yE;QACzE,iEAAiE;QACjE,IAAI,EAAE,oBAAoB;QAC1B,KAAK,EAAE,UAAU;QACjB,eAAe,EAAE;YACf,aAAa,EAAE;gBACb,cAAc,EAAE,IAAI;gBACpB,eAAe,EAAE,eAAe,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,IAAI,OAAO,CAAC,GAAG,EAAE;aACjE;SACF;QACD,KAAK,EAAE;YACL,mEAAmE;YACnE,oDAAoD;YACpD,yCAAyC,EAAE;gBACzC,OAAO;gBACP,kBAAkB,EAAE;aACrB;YACD,4DAA4D;YAC5D,+DAA+D;YAC/D,kEAAkE;YAClE,sDAAsD;YACtD,iCAAiC,EAAE;gBACjC,OAAO;gBACP,iCAAiC;aAClC;YACD,kEAAkE;YAClE,gBAAgB;YAChB,wCAAwC,EAAE;gBACxC,OAAO;gBACP,EAAE,kBAAkB,EAAE,KAAK,EAAE,aAAa,EAAE,KAAK,EAAE;aACpD;YACD,mEAAmE;YACnE,yBAAyB;YACzB,qCAAqC,EAAE,OAAO;YAC9C,kEAAkE;YAClE,gCAAgC;YAChC,gDAAgD,EAAE;gBAChD,OAAO;gBACP,EAAE,kCAAkC,EAAE,IAAI,EAAE;aAC7C;YACD,kEAAkE;YAClE,kEAAkE;YAClE,kCAAkC,EAAE,OAAO;YAC3C,0BAA0B,EAAE,OAAO;YACnC,uBAAuB,EAAE,OAAO;SACjC;KACF,CACF;CACJ,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { Rule } from 'eslint';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
3
|
+
* Code that makes its own temporary directory picks its own cleanup, and the
|
|
4
|
+
* copies drift: one forgets the retry that Windows needs for a file that is
|
|
5
|
+
* still open, another compares the path with what a child process reports,
|
|
6
6
|
* which on macOS is the real path behind the `/var` symlink. `TemporaryFiles`
|
|
7
7
|
* of `@zukhruf/fs` gives the real path and removes the directory with
|
|
8
8
|
* the retry. Only the calls of `node:fs` and `node:fs/promises` are reported:
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"no-raw-temp-directory.d.ts","sourceRoot":"","sources":["../../src/imports/no-raw-temp-directory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAiCnC;;;;;;;;GAQG;AACH,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,UA4EhB,CAAC;AAEF,eAAe,IAAI,CAAC"}
|
|
@@ -22,9 +22,9 @@ function memberName(member) {
|
|
|
22
22
|
: undefined;
|
|
23
23
|
}
|
|
24
24
|
/**
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
25
|
+
* Code that makes its own temporary directory picks its own cleanup, and the
|
|
26
|
+
* copies drift: one forgets the retry that Windows needs for a file that is
|
|
27
|
+
* still open, another compares the path with what a child process reports,
|
|
28
28
|
* which on macOS is the real path behind the `/var` symlink. `TemporaryFiles`
|
|
29
29
|
* of `@zukhruf/fs` gives the real path and removes the directory with
|
|
30
30
|
* the retry. Only the calls of `node:fs` and `node:fs/promises` are reported:
|
|
@@ -34,11 +34,11 @@ const rule = {
|
|
|
34
34
|
meta: {
|
|
35
35
|
type: 'problem',
|
|
36
36
|
docs: {
|
|
37
|
-
description: 'Disallow a raw temporary directory
|
|
37
|
+
description: 'Disallow a raw temporary directory; use TemporaryFiles of @zukhruf/fs',
|
|
38
38
|
},
|
|
39
39
|
schema: [],
|
|
40
40
|
messages: {
|
|
41
|
-
matched: 'Use `await using dir = await new TemporaryFiles().directory(prefix)` from @zukhruf/fs: one standard
|
|
41
|
+
matched: 'Use `await using dir = await new TemporaryFiles().directory(prefix)` from @zukhruf/fs, or `using dir = new TemporaryFiles().directorySync(prefix)` in code that cannot wait: one standard temporary directory, at its real path, removed with a retry for Windows.',
|
|
42
42
|
},
|
|
43
43
|
},
|
|
44
44
|
create(context) {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3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CAAC,QAAQ,CAAC,EAAE,CAAC;wBACpD,SAAS,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;oBACvB,CAAC;yBAAM,IAAI,IAAI,IAAI,QAAQ,KAAK,UAAU,EAAE,CAAC;wBAC3C,cAAc,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;oBAC5B,CAAC;gBACH,CAAC;YACH,CAAC;YACD,cAAc,CAAC,IAAe;gBAC5B,IAAI,SAAS,CAAC,IAAI,CAAC,IAAI,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC;oBACjD,OAAO,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,SAAS,EAAE,CAAC,CAAC;gBACjD,CAAC;YACH,CAAC;SACF,CAAC;IACJ,CAAC;CACF,CAAC;AAEF,eAAe,IAAI,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"no-truncated-description.d.ts","sourceRoot":"","sources":["../../src/manifest/no-truncated-description.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"no-truncated-description.d.ts","sourceRoot":"","sources":["../../src/manifest/no-truncated-description.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAanC;;;;GAIG;AACH,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,UAiChB,CAAC;AAEF,eAAe,IAAI,CAAC"}
|
|
@@ -1,18 +1,10 @@
|
|
|
1
1
|
import { isType } from "../authoring/ast.js";
|
|
2
|
+
import { objectProperties } from "../authoring/json-ast.js";
|
|
2
3
|
/** The npm registry stores at most this many characters of a description. */
|
|
3
4
|
const LIMIT = 255;
|
|
4
|
-
/**
|
|
5
|
-
* The value of the manifest's top-level `name` field. npm reads package.json
|
|
6
|
-
* with `JSON.parse`, so every key is a quoted string.
|
|
7
|
-
*/
|
|
5
|
+
/** The value of the manifest's top-level `name` field, as npm reads it with `JSON.parse`. */
|
|
8
6
|
function fieldValue(manifest, name) {
|
|
9
|
-
|
|
10
|
-
const property = Array.isArray(properties)
|
|
11
|
-
? properties.find((entry) => isType(entry, 'JSONProperty') &&
|
|
12
|
-
isType(entry['key'], 'JSONLiteral') &&
|
|
13
|
-
entry['key']['value'] === name)
|
|
14
|
-
: undefined;
|
|
15
|
-
return isType(property, 'JSONProperty') ? property['value'] : undefined;
|
|
7
|
+
return new Map(objectProperties(manifest)).get(name)?.['value'];
|
|
16
8
|
}
|
|
17
9
|
/**
|
|
18
10
|
* The npm registry cuts a package's `description` to 255 characters, so the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"no-truncated-description.js","sourceRoot":"","sources":["../../src/manifest/no-truncated-description.ts"],"names":[],"mappings":"AAEA,OAAO,EAAgB,MAAM,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"no-truncated-description.js","sourceRoot":"","sources":["../../src/manifest/no-truncated-description.ts"],"names":[],"mappings":"AAEA,OAAO,EAAgB,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAE5D,6EAA6E;AAC7E,MAAM,KAAK,GAAG,GAAG,CAAC;AAElB,6FAA6F;AAC7F,SAAS,UAAU,CAAC,QAAiB,EAAE,IAAY;IACjD,OAAO,IAAI,GAAG,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC;AAClE,CAAC;AAED;;;;GAIG;AACH,MAAM,IAAI,GAAoB;IAC5B,IAAI,EAAE;QACJ,IAAI,EAAE,SAAS;QACf,IAAI,EAAE;YACJ,WAAW,EACT,2FAA2F;SAC9F;QACD,MAAM,EAAE,EAAE;QACV,QAAQ,EAAE;YACR,SAAS,EACP,sKAAsK;SACzK;KACF;IACD,MAAM,CAAC,OAAO;QACZ,OAAO;YACL,gDAAgD,CAAC,QAAmB;gBAClE,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE,sBAAsB,CAAC;oBAAE,OAAO;gBACtD,MAAM,SAAS,GAAG,UAAU,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC;gBAClD,IAAI,MAAM,CAAC,SAAS,EAAE,aAAa,CAAC,IAAI,SAAS,CAAC,OAAO,CAAC,KAAK,IAAI,EAAE,CAAC;oBACpE,OAAO;gBACT,CAAC;gBACD,MAAM,WAAW,GAAG,UAAU,CAAC,QAAQ,EAAE,aAAa,CAAC,CAAC;gBACxD,IAAI,CAAC,MAAM,CAAC,WAAW,EAAE,aAAa,CAAC;oBAAE,OAAO;gBAChD,MAAM,IAAI,GAAG,WAAW,CAAC,OAAO,CAAC,CAAC;gBAClC,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,CAAC,MAAM,IAAI,KAAK;oBAAE,OAAO;gBAC7D,OAAO,CAAC,MAAM,CAAC;oBACb,IAAI,EAAE,WAAW;oBACjB,SAAS,EAAE,WAAW;oBACtB,IAAI,EAAE,EAAE,MAAM,EAAE,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC,EAAE;iBAC5D,CAAC,CAAC;YACL,CAAC;SACF,CAAC;IACJ,CAAC;CACF,CAAC;AAEF,eAAe,IAAI,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Rule } from 'eslint';
|
|
2
|
+
/**
|
|
3
|
+
* Each `@nx/*` package depends on `nx` at its own version, and `nx` ships a
|
|
4
|
+
* native addon. A second version of either nests a second `nx`, with its own
|
|
5
|
+
* addon, under the package that asked for it. So only the workspace root
|
|
6
|
+
* installs the nx family, each package at the exact version of the root's
|
|
7
|
+
* `nx`, and every other manifest names it in `peerDependencies`. The root is
|
|
8
|
+
* the manifest of the folder that `workspaceRootOf` finds; a manifest outside
|
|
9
|
+
* any workspace is a root itself.
|
|
10
|
+
*/
|
|
11
|
+
declare const rule: Rule.RuleModule;
|
|
12
|
+
export default rule;
|
|
13
|
+
//# sourceMappingURL=nx-family-pinned.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nx-family-pinned.d.ts","sourceRoot":"","sources":["../../src/manifest/nx-family-pinned.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAoDnC;;;;;;;;GAQG;AACH,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,UA8ChB,CAAC;AAEF,eAAe,IAAI,CAAC"}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { dirname, resolve } from 'node:path';
|
|
2
|
+
import { isAstNode, isType } from "../authoring/ast.js";
|
|
3
|
+
import { objectProperties } from "../authoring/json-ast.js";
|
|
4
|
+
import { workspaceRootOf } from "../workspace/workspace-root.js";
|
|
5
|
+
/** The sections whose packages npm installs. `peerDependencies` leaves the install to the root. */
|
|
6
|
+
const INSTALLED = [
|
|
7
|
+
'dependencies',
|
|
8
|
+
'devDependencies',
|
|
9
|
+
'optionalDependencies',
|
|
10
|
+
];
|
|
11
|
+
/** A plain version with no range operator, as `npm install --save-exact` writes it. */
|
|
12
|
+
const EXACT = /^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?$/;
|
|
13
|
+
function isNxFamily(name) {
|
|
14
|
+
return name === 'nx' || name.startsWith('@nx/');
|
|
15
|
+
}
|
|
16
|
+
/** The nx-family entries of the sections npm installs. */
|
|
17
|
+
function nxFamilyEntries(manifest) {
|
|
18
|
+
const sections = new Map(objectProperties(manifest));
|
|
19
|
+
return INSTALLED.flatMap((section) => objectProperties(sections.get(section)?.['value'])
|
|
20
|
+
.filter(([name]) => isNxFamily(name))
|
|
21
|
+
.map(([name, property]) => {
|
|
22
|
+
const value = property['value'];
|
|
23
|
+
return {
|
|
24
|
+
section,
|
|
25
|
+
name,
|
|
26
|
+
property,
|
|
27
|
+
versionNode: isAstNode(value) ? value : property,
|
|
28
|
+
version: isType(value, 'JSONLiteral') && typeof value['value'] === 'string'
|
|
29
|
+
? value['value']
|
|
30
|
+
: '',
|
|
31
|
+
};
|
|
32
|
+
}));
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Each `@nx/*` package depends on `nx` at its own version, and `nx` ships a
|
|
36
|
+
* native addon. A second version of either nests a second `nx`, with its own
|
|
37
|
+
* addon, under the package that asked for it. So only the workspace root
|
|
38
|
+
* installs the nx family, each package at the exact version of the root's
|
|
39
|
+
* `nx`, and every other manifest names it in `peerDependencies`. The root is
|
|
40
|
+
* the manifest of the folder that `workspaceRootOf` finds; a manifest outside
|
|
41
|
+
* any workspace is a root itself.
|
|
42
|
+
*/
|
|
43
|
+
const rule = {
|
|
44
|
+
meta: {
|
|
45
|
+
type: 'problem',
|
|
46
|
+
docs: {
|
|
47
|
+
description: 'Require one version of nx: the workspace root pins nx and every @nx/* package to the same exact version, and other manifests name them only in peerDependencies',
|
|
48
|
+
},
|
|
49
|
+
schema: [],
|
|
50
|
+
messages: {
|
|
51
|
+
notExact: '{{name}} is "{{version}}", a range. The workspace root pins nx and every @nx/* package to an exact version, so a newer @nx/* package cannot bring a second nx and its native addon.',
|
|
52
|
+
notEqual: '{{name}} is "{{version}}", but nx is "{{nx}}". Each @nx/* package depends on nx at its own version, so another version nests a second nx and its native addon. Give it the version of nx.',
|
|
53
|
+
notPeer: '{{section}} lists {{name}}. Only the workspace root installs nx and @nx/* packages. Move it to peerDependencies, so npm does not nest a second nx and its native addon here.',
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
create(context) {
|
|
57
|
+
const folder = dirname(resolve(context.physicalFilename));
|
|
58
|
+
const isRoot = (workspaceRootOf(folder) ?? folder) === folder;
|
|
59
|
+
return {
|
|
60
|
+
'JSONExpressionStatement > JSONObjectExpression'(manifest) {
|
|
61
|
+
if (!isType(manifest, 'JSONObjectExpression'))
|
|
62
|
+
return;
|
|
63
|
+
const entries = nxFamilyEntries(manifest);
|
|
64
|
+
if (!isRoot) {
|
|
65
|
+
for (const { section, name, property } of entries) {
|
|
66
|
+
context.report({
|
|
67
|
+
node: property,
|
|
68
|
+
messageId: 'notPeer',
|
|
69
|
+
data: { section, name },
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
const nx = entries.find(({ name }) => name === 'nx')?.version;
|
|
75
|
+
for (const { name, version, versionNode } of entries) {
|
|
76
|
+
const data = { name, version, nx: nx ?? '' };
|
|
77
|
+
if (!EXACT.test(version)) {
|
|
78
|
+
context.report({ node: versionNode, messageId: 'notExact', data });
|
|
79
|
+
}
|
|
80
|
+
else if (nx !== undefined && version !== nx) {
|
|
81
|
+
context.report({ node: versionNode, messageId: 'notEqual', data });
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
};
|
|
86
|
+
},
|
|
87
|
+
};
|
|
88
|
+
export default rule;
|
|
89
|
+
//# sourceMappingURL=nx-family-pinned.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nx-family-pinned.js","sourceRoot":"","sources":["../../src/manifest/nx-family-pinned.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAI7C,OAAO,EAAgB,SAAS,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AACtE,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAEjE,mGAAmG;AACnG,MAAM,SAAS,GAAG;IAChB,cAAc;IACd,iBAAiB;IACjB,sBAAsB;CACd,CAAC;AAEX,uFAAuF;AACvF,MAAM,KAAK,GAAG,qCAAqC,CAAC;AAYpD,SAAS,UAAU,CAAC,IAAY;IAC9B,OAAO,IAAI,KAAK,IAAI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EAAE,IAAI,EAAE,WAAW,EAAE,SAAS,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,CAAC;oBACrE,CAAC;gBACH,CAAC;YACH,CAAC;SACF,CAAC;IACJ,CAAC;CACF,CAAC;AAEF,eAAe,IAAI,CAAC"}
|
|
@@ -5,7 +5,8 @@ import type { Linter } from 'eslint';
|
|
|
5
5
|
* declares the whole closure its workspace imports pull in, an unbundled
|
|
6
6
|
* project only its own imports. Islands are checked by
|
|
7
7
|
* `island/dependency-checks`. A manifest that npm can publish keeps its
|
|
8
|
-
* description inside what the npm registry stores.
|
|
8
|
+
* description inside what the npm registry stores. Only the workspace root
|
|
9
|
+
* installs the nx family, at one exact version.
|
|
9
10
|
*/
|
|
10
11
|
declare const plugin: {
|
|
11
12
|
meta: {
|
|
@@ -15,6 +16,7 @@ declare const plugin: {
|
|
|
15
16
|
rules: {
|
|
16
17
|
'dependency-checks': import("eslint").Rule.RuleModule;
|
|
17
18
|
'no-truncated-description': import("eslint").Rule.RuleModule;
|
|
19
|
+
'nx-family-pinned': import("eslint").Rule.RuleModule;
|
|
18
20
|
};
|
|
19
21
|
configs: Record<string, Linter.Config<import("@eslint/core", { with: { "resolution-mode": "require" } }).RulesConfig>[]>;
|
|
20
22
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../src/manifest/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAU,MAAM,EAAE,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../src/manifest/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAU,MAAM,EAAE,MAAM,QAAQ,CAAC;AAU7C;;;;;;;;GAQG;AACH,QAAA,MAAM,MAAM;;;;;;;;;;;CAQa,CAAC;AAgB1B,eAAe,MAAM,CAAC"}
|
package/dist/manifest/plugin.js
CHANGED
|
@@ -2,6 +2,7 @@ import * as jsonc from 'jsonc-eslint-parser';
|
|
|
2
2
|
import { PACKAGE_JSON } from "../files.js";
|
|
3
3
|
import dependencyChecks from "./dependency-checks.js";
|
|
4
4
|
import noTruncatedDescription from "./no-truncated-description.js";
|
|
5
|
+
import nxFamilyPinned from "./nx-family-pinned.js";
|
|
5
6
|
const configs = {};
|
|
6
7
|
/**
|
|
7
8
|
* Manifests: every project's package.json declares the npm packages its
|
|
@@ -9,13 +10,15 @@ const configs = {};
|
|
|
9
10
|
* declares the whole closure its workspace imports pull in, an unbundled
|
|
10
11
|
* project only its own imports. Islands are checked by
|
|
11
12
|
* `island/dependency-checks`. A manifest that npm can publish keeps its
|
|
12
|
-
* description inside what the npm registry stores.
|
|
13
|
+
* description inside what the npm registry stores. Only the workspace root
|
|
14
|
+
* installs the nx family, at one exact version.
|
|
13
15
|
*/
|
|
14
16
|
const plugin = {
|
|
15
17
|
meta: { name: '@zukhruf/eslint/nx/manifest', namespace: 'manifest' },
|
|
16
18
|
rules: {
|
|
17
19
|
'dependency-checks': dependencyChecks,
|
|
18
20
|
'no-truncated-description': noTruncatedDescription,
|
|
21
|
+
'nx-family-pinned': nxFamilyPinned,
|
|
19
22
|
},
|
|
20
23
|
configs,
|
|
21
24
|
};
|
|
@@ -28,6 +31,7 @@ configs['recommended'] = [
|
|
|
28
31
|
rules: {
|
|
29
32
|
'manifest/dependency-checks': 'error',
|
|
30
33
|
'manifest/no-truncated-description': 'error',
|
|
34
|
+
'manifest/nx-family-pinned': 'error',
|
|
31
35
|
},
|
|
32
36
|
},
|
|
33
37
|
];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.js","sourceRoot":"","sources":["../../src/manifest/plugin.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,qBAAqB,CAAC;AAE7C,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,gBAAgB,MAAM,wBAAwB,CAAC;AACtD,OAAO,sBAAsB,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"plugin.js","sourceRoot":"","sources":["../../src/manifest/plugin.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,qBAAqB,CAAC;AAE7C,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,gBAAgB,MAAM,wBAAwB,CAAC;AACtD,OAAO,sBAAsB,MAAM,+BAA+B,CAAC;AACnE,OAAO,cAAc,MAAM,uBAAuB,CAAC;AAEnD,MAAM,OAAO,GAAoC,EAAE,CAAC;AAEpD;;;;;;;;GAQG;AACH,MAAM,MAAM,GAAG;IACb,IAAI,EAAE,EAAE,IAAI,EAAE,6BAA6B,EAAE,SAAS,EAAE,UAAU,EAAE;IACpE,KAAK,EAAE;QACL,mBAAmB,EAAE,gBAAgB;QACrC,0BAA0B,EAAE,sBAAsB;QAClD,kBAAkB,EAAE,cAAc;KACnC;IACD,OAAO;CACgB,CAAC;AAE1B,OAAO,CAAC,aAAa,CAAC,GAAG;IACvB,EAAE,IAAI,EAAE,8BAA8B,EAAE,OAAO,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE;IACvE;QACE,IAAI,EAAE,sBAAsB;QAC5B,KAAK,EAAE,YAAY;QACnB,eAAe,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE;QAClC,KAAK,EAAE;YACL,4BAA4B,EAAE,OAAO;YACrC,mCAAmC,EAAE,OAAO;YAC5C,2BAA2B,EAAE,OAAO;SACrC;KACF;CACF,CAAC;AAEF,eAAe,MAAM,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"no-missing-asset-input.d.ts","sourceRoot":"","sources":["../../src/nx-project/no-missing-asset-input.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"no-missing-asset-input.d.ts","sourceRoot":"","sources":["../../src/nx-project/no-missing-asset-input.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AA4DnC;;;;GAIG;AACH,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,UAyKhB,CAAC;AAEF,eAAe,IAAI,CAAC"}
|
|
@@ -2,17 +2,8 @@ import { existsSync, readFileSync, statSync } from 'node:fs';
|
|
|
2
2
|
import { dirname, join, posix, relative, resolve, sep } from 'node:path';
|
|
3
3
|
import ignore, {} from 'ignore';
|
|
4
4
|
import { isType } from "../authoring/ast.js";
|
|
5
|
+
import { objectProperties, propertyKey } from "../authoring/json-ast.js";
|
|
5
6
|
import { workspaceRootOf } from "../workspace/workspace-root.js";
|
|
6
|
-
function keyName(property) {
|
|
7
|
-
const key = property['key'];
|
|
8
|
-
if (isType(key, 'JSONLiteral') && typeof key['value'] === 'string') {
|
|
9
|
-
return key['value'];
|
|
10
|
-
}
|
|
11
|
-
if (isType(key, 'JSONIdentifier') && typeof key['name'] === 'string') {
|
|
12
|
-
return key['name'];
|
|
13
|
-
}
|
|
14
|
-
return undefined;
|
|
15
|
-
}
|
|
16
7
|
function stringValue(node) {
|
|
17
8
|
return isType(node, 'JSONLiteral') && typeof node['value'] === 'string'
|
|
18
9
|
? node['value']
|
|
@@ -113,10 +104,20 @@ const rule = {
|
|
|
113
104
|
});
|
|
114
105
|
}
|
|
115
106
|
};
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
107
|
+
// Nx reads project.json like JSON.parse: of two properties with the same
|
|
108
|
+
// key only the last is read, so an `assets` list inside an earlier one
|
|
109
|
+
// is never copied.
|
|
110
|
+
function isTargetAssets(assets) {
|
|
111
|
+
const properties = [
|
|
112
|
+
...context.sourceCode.getAncestors(assets),
|
|
113
|
+
assets,
|
|
114
|
+
].filter((node) => isType(node, 'JSONProperty'));
|
|
115
|
+
return (properties.some((property) => propertyKey(property) === 'targets') &&
|
|
116
|
+
properties.every((property) => {
|
|
117
|
+
const key = propertyKey(property);
|
|
118
|
+
return (key !== undefined &&
|
|
119
|
+
new Map(objectProperties(property.parent)).get(key) === property);
|
|
120
|
+
}));
|
|
120
121
|
}
|
|
121
122
|
function checkStringEntry(element) {
|
|
122
123
|
const pattern = stringValue(element);
|
|
@@ -140,19 +141,10 @@ const rule = {
|
|
|
140
141
|
reportIfIgnored(element, baseRoot, normalized);
|
|
141
142
|
}
|
|
142
143
|
function checkObjectEntry(element) {
|
|
143
|
-
const
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
const fields = new Map();
|
|
148
|
-
for (const property of properties) {
|
|
149
|
-
if (isType(property, 'JSONProperty')) {
|
|
150
|
-
const key = keyName(property);
|
|
151
|
-
if (key !== undefined) {
|
|
152
|
-
fields.set(key, property['value']);
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
}
|
|
144
|
+
const fields = new Map(objectProperties(element).map(([key, property]) => [
|
|
145
|
+
key,
|
|
146
|
+
property['value'],
|
|
147
|
+
]));
|
|
156
148
|
const value = fields.get('input');
|
|
157
149
|
if (!isType(value, 'JSONLiteral')) {
|
|
158
150
|
return;
|
|
@@ -182,7 +174,7 @@ const rule = {
|
|
|
182
174
|
if (!isType(node, 'JSONProperty')) {
|
|
183
175
|
return;
|
|
184
176
|
}
|
|
185
|
-
if (
|
|
177
|
+
if (propertyKey(node) !== 'assets' || !isTargetAssets(node)) {
|
|
186
178
|
return;
|
|
187
179
|
}
|
|
188
180
|
const value = node['value'];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"no-missing-asset-input.js","sourceRoot":"","sources":["../../src/nx-project/no-missing-asset-input.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC7D,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAGzE,OAAO,MA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;YACH,CAAC;SACF,CAAC;IACJ,CAAC;CACF,CAAC;AAEF,eAAe,IAAI,CAAC"}
|
package/dist/plugin.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAU,MAAM,EAAE,MAAM,QAAQ,CAAC;AAkC7C,QAAA,MAAM,MAAM;;;;;;;;;;CAUa,CAAC;AAM1B,eAAe,MAAM,CAAC"}
|
package/dist/plugin.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { findPackageJSON } from 'node:module';
|
|
1
|
+
import manifest from '../package.json' with { type: 'json' };
|
|
3
2
|
import { base } from "./base/config.js";
|
|
4
3
|
import { betterAuth } from "./better-auth/config.js";
|
|
5
4
|
import { diagnostics } from "./diagnostics/config.js";
|
|
@@ -12,7 +11,6 @@ import { reactRouter } from "./react-router/config.js";
|
|
|
12
11
|
import { react } from "./react/config.js";
|
|
13
12
|
import { tailwind } from "./tailwind/config.js";
|
|
14
13
|
import { tests } from "./test-files/config.js";
|
|
15
|
-
import { isRecord } from "./unknown-values.js";
|
|
16
14
|
const concepts = [
|
|
17
15
|
base,
|
|
18
16
|
tests,
|
|
@@ -27,17 +25,11 @@ const concepts = [
|
|
|
27
25
|
pulumi,
|
|
28
26
|
nxProjectJson,
|
|
29
27
|
];
|
|
30
|
-
function packageVersion() {
|
|
31
|
-
const manifest = JSON.parse(readFileSync(findPackageJSON(import.meta.url) ?? '', 'utf8'));
|
|
32
|
-
return isRecord(manifest) && typeof manifest['version'] === 'string'
|
|
33
|
-
? manifest['version']
|
|
34
|
-
: '0.0.0';
|
|
35
|
-
}
|
|
36
28
|
const configs = {};
|
|
37
29
|
const plugin = {
|
|
38
30
|
meta: {
|
|
39
31
|
name: '@zukhruf/eslint',
|
|
40
|
-
version:
|
|
32
|
+
version: manifest.version,
|
|
41
33
|
namespace: 'zukhruf',
|
|
42
34
|
},
|
|
43
35
|
rules: Object.fromEntries(concepts.flatMap((concept) => Object.entries(concept.rules))),
|
package/dist/plugin.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.js","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"plugin.js","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAEA,OAAO,QAAQ,MAAM,iBAAiB,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AAC7D,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACxC,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAErD,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,GAAG,EAAE,MAAM,yBAAyB,CAAC;AAC9C,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACxC,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1C,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAE/C,MAAM,QAAQ,GAAc;IAC1B,IAAI;IACJ,KAAK;IACL,WAAW;IACX,GAAG;IACH,WAAW;IACX,KAAK;IACL,WAAW;IACX,IAAI;IACJ,UAAU;IACV,QAAQ;IACR,MAAM;IACN,aAAa;CACd,CAAC;AAEF,MAAM,OAAO,GAAoC,EAAE,CAAC;AAEpD,MAAM,MAAM,GAAG;IACb,IAAI,EAAE;QACJ,IAAI,EAAE,iBAAiB;QACvB,OAAO,EAAE,QAAQ,CAAC,OAAO;QACzB,SAAS,EAAE,SAAS;KACrB;IACD,KAAK,EAAE,MAAM,CAAC,WAAW,CACvB,QAAQ,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAC7D;IACD,OAAO;CACgB,CAAC;AAE1B,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;IAC/B,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC,CAAC;AAC9D,CAAC;AAED,eAAe,MAAM,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/test-files/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAU,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/test-files/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAU,MAAM,eAAe,CAAC;AAwBrD,eAAO,MAAM,KAAK,EAAE,OAWnB,CAAC"}
|
|
@@ -4,7 +4,6 @@ import noCatchAllMswHandler from "./no-catch-all-msw-handler.js";
|
|
|
4
4
|
import noDirectMswServer from "./no-direct-msw-server.js";
|
|
5
5
|
import noGlobalTestMock from "./no-global-test-mock.js";
|
|
6
6
|
import noProcessEnvWrite from "./no-process-env-write.js";
|
|
7
|
-
import noRawTempDirectory from "./no-raw-temp-directory.js";
|
|
8
7
|
import noShortTestTimeout from "./no-short-test-timeout.js";
|
|
9
8
|
import noSleepPollLoop from "./no-sleep-poll-loop.js";
|
|
10
9
|
import noTestLifecycleHooks from "./no-test-lifecycle-hooks.js";
|
|
@@ -20,7 +19,6 @@ const rules = {
|
|
|
20
19
|
'no-wall-clock-bound': noWallClockBound,
|
|
21
20
|
'no-short-test-timeout': noShortTestTimeout,
|
|
22
21
|
'no-global-test-mock': noGlobalTestMock,
|
|
23
|
-
'no-raw-temp-directory': noRawTempDirectory,
|
|
24
22
|
};
|
|
25
23
|
export const tests = {
|
|
26
24
|
name: 'tests',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/test-files/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,MAAM,EAAE,MAAM,eAAe,CAAC;AACrD,OAAO,EAAE,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,oBAAoB,MAAM,+BAA+B,CAAC;AACjE,OAAO,iBAAiB,MAAM,2BAA2B,CAAC;AAC1D,OAAO,gBAAgB,MAAM,0BAA0B,CAAC;AACxD,OAAO,iBAAiB,MAAM,2BAA2B,CAAC;AAC1D,OAAO,kBAAkB,MAAM,4BAA4B,CAAC;AAC5D,OAAO,
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/test-files/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,MAAM,EAAE,MAAM,eAAe,CAAC;AACrD,OAAO,EAAE,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,oBAAoB,MAAM,+BAA+B,CAAC;AACjE,OAAO,iBAAiB,MAAM,2BAA2B,CAAC;AAC1D,OAAO,gBAAgB,MAAM,0BAA0B,CAAC;AACxD,OAAO,iBAAiB,MAAM,2BAA2B,CAAC;AAC1D,OAAO,kBAAkB,MAAM,4BAA4B,CAAC;AAC5D,OAAO,eAAe,MAAM,yBAAyB,CAAC;AACtD,OAAO,oBAAoB,MAAM,8BAA8B,CAAC;AAChE,OAAO,WAAW,MAAM,oBAAoB,CAAC;AAC7C,OAAO,gBAAgB,MAAM,0BAA0B,CAAC;AAExD,MAAM,KAAK,GAAG;IACZ,yBAAyB,EAAE,oBAAoB;IAC/C,sBAAsB,EAAE,iBAAiB;IACzC,sBAAsB,EAAE,iBAAiB;IACzC,0BAA0B,EAAE,oBAAoB;IAChD,eAAe,EAAE,WAAW;IAC5B,oBAAoB,EAAE,eAAe;IACrC,qBAAqB,EAAE,gBAAgB;IACvC,uBAAuB,EAAE,kBAAkB;IAC3C,qBAAqB,EAAE,gBAAgB;CACxC,CAAC;AAEF,MAAM,CAAC,MAAM,KAAK,GAAY;IAC5B,IAAI,EAAE,OAAO;IACb,KAAK;IACL,MAAM,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC;QACnB,EAAE,IAAI,EAAE,uBAAuB,EAAE,OAAO,EAAE;QAC1C;YACE,IAAI,EAAE,eAAe;YACrB,KAAK,EAAE,CAAC,GAAG,KAAK,EAAE,GAAG,YAAY,CAAC;YAClC,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC;SACrB;KACF;CACF,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zukhruf/eslint",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.23",
|
|
4
4
|
"description": "ESLint rules and configs shared across workspaces. Each check is its own named rule, so a repo's own config cannot silently erase it. This workspace lints itself with it.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -68,8 +68,9 @@
|
|
|
68
68
|
"ts-api-utils": "^2.5.0"
|
|
69
69
|
},
|
|
70
70
|
"devDependencies": {
|
|
71
|
-
"@zukhruf/fs": "^0.8.
|
|
72
|
-
"@zukhruf/testing": "^0.8.
|
|
71
|
+
"@zukhruf/fs": "^0.8.23",
|
|
72
|
+
"@zukhruf/testing": "^0.8.23",
|
|
73
|
+
"esbuild": "0.28.2"
|
|
73
74
|
},
|
|
74
75
|
"peerDependencies": {
|
|
75
76
|
"@e18e/eslint-plugin": "^0.8.1",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"no-raw-temp-directory.d.ts","sourceRoot":"","sources":["../../src/test-files/no-raw-temp-directory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAiCnC;;;;;;;;GAQG;AACH,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,UA4EhB,CAAC;AAEF,eAAe,IAAI,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"no-raw-temp-directory.js","sourceRoot":"","sources":["../../src/test-files/no-raw-temp-directory.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,cAAc,EACd,SAAS,EACT,MAAM,GACP,MAAM,qBAAqB,CAAC;AAE7B,MAAM,EAAE,GAAG,IAAI,GAAG,CAAC,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC,CAAC;AACtC,MAAM,WAAW,GAAG,IAAI,GAAG,CAAC,CAAC,aAAa,EAAE,kBAAkB,CAAC,CAAC,CAAC;AACjE,MAAM,OAAO,GAAG,IAAI,GAAG,CAAC;IACtB,SAAS;IACT,aAAa;IACb,mBAAmB;IACnB,uBAAuB;CACxB,CAAC,CAAC;AAEH,SAAS,YAAY,CAAC,SAAkB;IACtC,MAAM,QAAQ,GAAG,SAAS,CAAC,UAAU,CAAC,CAAC;IACvC,OAAO,MAAM,CAAC,QAAQ,EAAE,SAAS,CAAC,IAAI,OAAO,QAAQ,CAAC,OAAO,CAAC,KAAK,QAAQ;QACzE,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC;QACnB,CAAC,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC;AAC/B,CAAC;AAED,SAAS,UAAU,CAAC,MAAe;IACjC,MAAM,QAAQ,GAAG,MAAM,CAAC,UAAU,CAAC,CAAC;IACpC,IAAI,MAAM,CAAC,UAAU,CAAC,KAAK,IAAI;QAAE,OAAO,cAAc,CAAC,QAAQ,CAAC,CAAC;IACj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