@zukhruf/eslint 0.3.43 → 0.3.45
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 +13 -13
- package/dist/async-values/no-collect-loop.d.ts +9 -0
- package/dist/async-values/no-collect-loop.d.ts.map +1 -0
- package/dist/async-values/no-collect-loop.js +89 -0
- package/dist/async-values/no-collect-loop.js.map +1 -0
- package/dist/base/config.d.ts.map +1 -1
- package/dist/base/config.js +9 -0
- package/dist/base/config.js.map +1 -1
- package/dist/test-files/config.d.ts.map +1 -1
- package/dist/test-files/config.js +6 -0
- package/dist/test-files/config.js.map +1 -1
- package/dist/test-files/no-global-test-mock.d.ts +10 -0
- package/dist/test-files/no-global-test-mock.d.ts.map +1 -0
- package/dist/test-files/no-global-test-mock.js +18 -0
- package/dist/test-files/no-global-test-mock.js.map +1 -0
- package/dist/test-files/no-raw-temp-directory.d.ts +13 -0
- package/dist/test-files/no-raw-temp-directory.d.ts.map +1 -0
- package/dist/test-files/no-raw-temp-directory.js +114 -0
- package/dist/test-files/no-raw-temp-directory.js.map +1 -0
- package/dist/test-files/no-sleep-poll-loop.d.ts +11 -0
- package/dist/test-files/no-sleep-poll-loop.d.ts.map +1 -0
- package/dist/test-files/no-sleep-poll-loop.js +79 -0
- package/dist/test-files/no-sleep-poll-loop.js.map +1 -0
- package/package.json +4 -1
package/README.md
CHANGED
|
@@ -40,19 +40,19 @@ Put framework presets (for example Nx's `flat/react`) **before** the zukhruf con
|
|
|
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`, `zukhruf/no-enum`; `import-x/no-duplicates`, `import-x/no-unassigned-import`; `functional/no-let` (module scope); `zukhruf/no-state-managers`, `zukhruf/no-playwright-test`, `zukhruf/no-test-file-import`; typed lint: `no-floating-promises`, `no-misused-promises`, `only-throw-error`, `switch-exhaustiveness-check` (a `default` counts as exhaustive), `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`
|
|
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`
|
|
53
|
-
| `tailwind` | source | `no-h-screen`, `no-arbitrary-z-index`, `no-will-change`
|
|
54
|
-
| `pulumi` | TypeScript | `require-server-replace-guard`
|
|
55
|
-
| `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`, `zukhruf/no-enum`; `import-x/no-duplicates`, `import-x/no-unassigned-import`; `functional/no-let` (module scope); `zukhruf/no-state-managers`, `zukhruf/no-playwright-test`, `zukhruf/no-test-file-import`, `zukhruf/no-collect-loop`; typed lint: `no-floating-promises`, `no-misused-promises`, `only-throw-error`, `switch-exhaustiveness-check` (a `default` counts as exhaustive), `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-global-test-mock`, `no-raw-temp-directory` |
|
|
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` |
|
|
53
|
+
| `tailwind` | source | `no-h-screen`, `no-arbitrary-z-index`, `no-will-change` |
|
|
54
|
+
| `pulumi` | TypeScript | `require-server-replace-guard` |
|
|
55
|
+
| `nx-project-json` | `project.json` | `no-missing-asset-input` |
|
|
56
56
|
|
|
57
57
|
`base` turns on typed lint (`parserOptions.projectService`). Each linted TypeScript file must be in a tsconfig.
|
|
58
58
|
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Rule } from 'eslint';
|
|
2
|
+
/**
|
|
3
|
+
* A `for await` loop whose only statement pushes each value into an array is
|
|
4
|
+
* `Array.fromAsync`, with the push's expression as its map function. A loop
|
|
5
|
+
* that pushes on a condition, adds to a Set, or does more stays a loop.
|
|
6
|
+
*/
|
|
7
|
+
declare const rule: Rule.RuleModule;
|
|
8
|
+
export default rule;
|
|
9
|
+
//# sourceMappingURL=no-collect-loop.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"no-collect-loop.d.ts","sourceRoot":"","sources":["../../src/async-values/no-collect-loop.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAoDnC;;;;GAIG;AACH,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,UAyChB,CAAC;AAEF,eAAe,IAAI,CAAC"}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { identifierName, isAstNode, isType, } from "../authoring/ast.js";
|
|
2
|
+
/** The one statement of a loop body, with or without braces. */
|
|
3
|
+
function onlyStatement(body) {
|
|
4
|
+
if (!isType(body, 'BlockStatement'))
|
|
5
|
+
return body;
|
|
6
|
+
const statements = Array.isArray(body['body']) ? body['body'] : [];
|
|
7
|
+
return statements.length === 1 ? statements[0] : undefined;
|
|
8
|
+
}
|
|
9
|
+
/** The argument of `<array>.push(<argument>)`, the whole statement. */
|
|
10
|
+
function pushedValue(statement) {
|
|
11
|
+
if (!isType(statement, 'ExpressionStatement'))
|
|
12
|
+
return undefined;
|
|
13
|
+
const call = statement['expression'];
|
|
14
|
+
if (!isType(call, 'CallExpression'))
|
|
15
|
+
return undefined;
|
|
16
|
+
const callee = call['callee'];
|
|
17
|
+
const args = Array.isArray(call['arguments']) ? call['arguments'] : [];
|
|
18
|
+
if (!isType(callee, 'MemberExpression') ||
|
|
19
|
+
identifierName(callee['property']) !== 'push' ||
|
|
20
|
+
args.length !== 1 ||
|
|
21
|
+
!isAstNode(args[0]) ||
|
|
22
|
+
isType(args[0], 'SpreadElement')) {
|
|
23
|
+
return undefined;
|
|
24
|
+
}
|
|
25
|
+
return args[0];
|
|
26
|
+
}
|
|
27
|
+
/** The identifiers in `node`, a binding pattern or an expression. */
|
|
28
|
+
function identifiers(node) {
|
|
29
|
+
const name = identifierName(node);
|
|
30
|
+
if (name !== undefined)
|
|
31
|
+
return [name];
|
|
32
|
+
if (!isAstNode(node))
|
|
33
|
+
return [];
|
|
34
|
+
if (isType(node, 'MemberExpression') && node['computed'] !== true) {
|
|
35
|
+
return identifiers(node['object']);
|
|
36
|
+
}
|
|
37
|
+
return Object.entries(node).flatMap(([key, value]) => key === 'parent'
|
|
38
|
+
? []
|
|
39
|
+
: Array.isArray(value)
|
|
40
|
+
? value.flatMap(identifiers)
|
|
41
|
+
: identifiers(value));
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* A `for await` loop whose only statement pushes each value into an array is
|
|
45
|
+
* `Array.fromAsync`, with the push's expression as its map function. A loop
|
|
46
|
+
* that pushes on a condition, adds to a Set, or does more stays a loop.
|
|
47
|
+
*/
|
|
48
|
+
const rule = {
|
|
49
|
+
meta: {
|
|
50
|
+
type: 'suggestion',
|
|
51
|
+
docs: {
|
|
52
|
+
description: 'Disallow a for await loop that only collects values into an array',
|
|
53
|
+
},
|
|
54
|
+
schema: [],
|
|
55
|
+
messages: {
|
|
56
|
+
plain: 'Use Array.fromAsync(iterable).',
|
|
57
|
+
mapped: 'Use Array.fromAsync(iterable, mapFn).',
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
create(context) {
|
|
61
|
+
return {
|
|
62
|
+
'ForOfStatement[await=true]'(loop) {
|
|
63
|
+
if (!isAstNode(loop))
|
|
64
|
+
return;
|
|
65
|
+
const left = loop['left'];
|
|
66
|
+
const declarations = isType(left, 'VariableDeclaration') &&
|
|
67
|
+
Array.isArray(left['declarations'])
|
|
68
|
+
? left['declarations']
|
|
69
|
+
: [];
|
|
70
|
+
const pattern = declarations.length === 1 && isAstNode(declarations[0])
|
|
71
|
+
? declarations[0]['id']
|
|
72
|
+
: undefined;
|
|
73
|
+
const value = pushedValue(onlyStatement(loop['body']));
|
|
74
|
+
if (pattern === undefined || value === undefined)
|
|
75
|
+
return;
|
|
76
|
+
const bound = identifiers(pattern);
|
|
77
|
+
if (isType(pattern, 'Identifier') &&
|
|
78
|
+
identifierName(value) === bound[0]) {
|
|
79
|
+
context.report({ node: loop, messageId: 'plain' });
|
|
80
|
+
}
|
|
81
|
+
else if (identifiers(value).some((name) => bound.includes(name))) {
|
|
82
|
+
context.report({ node: loop, messageId: 'mapped' });
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
};
|
|
86
|
+
},
|
|
87
|
+
};
|
|
88
|
+
export default rule;
|
|
89
|
+
//# sourceMappingURL=no-collect-loop.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"no-collect-loop.js","sourceRoot":"","sources":["../../src/async-values/no-collect-loop.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,cAAc,EACd,SAAS,EACT,MAAM,GACP,MAAM,qBAAqB,CAAC;AAE7B,gEAAgE;AAChE,SAAS,aAAa,CAAC,IAAa;IAClC,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,gBAAgB,CAAC;QAAE,OAAO,IAAI,CAAC;IACjD,MAAM,UAAU,GAAG,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IACnE,OAAO,UAAU,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;AAC7D,CAAC;AAED,uEAAuE;AACvE,SAAS,WAAW,CAAC,SAAkB;IACrC,IAAI,CAAC,MAAM,CAAC,SAAS,EAAE,qBAAqB,CAAC;QAAE,OAAO,SAAS,CAAC;IAChE,MAAM,IAAI,GAAG,SAAS,CAAC,YAAY,CAAC,CAAC;IACrC,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,gBAAgB,CAAC;QAAE,OAAO,SAAS,CAAC;IACtD,MAAM,MAAM,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAC;IAC9B,MA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AE,OAAO,EAAE,CAAC,CAAC;gBACrD,CAAC;qBAAM,IAAI,WAAW,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC;oBACnE,OAAO,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,CAAC,CAAC;gBACtD,CAAC;YACH,CAAC;SACF,CAAC;IACJ,CAAC;CACF,CAAC;AAEF,eAAe,IAAI,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/base/config.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/base/config.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,KAAK,OAAO,EAAU,MAAM,eAAe,CAAC;AAgCrD;;;;GAIG;AACH,eAAO,MAAM,IAAI,EAAE,OAqIlB,CAAC"}
|
package/dist/base/config.js
CHANGED
|
@@ -4,6 +4,7 @@ import importX from 'eslint-plugin-import-x';
|
|
|
4
4
|
import { defineConfig } from 'eslint/config';
|
|
5
5
|
import globals from 'globals';
|
|
6
6
|
import tseslint from 'typescript-eslint';
|
|
7
|
+
import noCollectLoop from "../async-values/no-collect-loop.js";
|
|
7
8
|
import noPromiseField from "../async-values/no-promise-field.js";
|
|
8
9
|
import noPhaseFlag from "../class-state/no-phase-flag.js";
|
|
9
10
|
import { enable } from "../concept.js";
|
|
@@ -23,6 +24,7 @@ const rules = {
|
|
|
23
24
|
'no-enum': noEnum,
|
|
24
25
|
'no-promise-field': noPromiseField,
|
|
25
26
|
'no-phase-flag': noPhaseFlag,
|
|
27
|
+
'no-collect-loop': noCollectLoop,
|
|
26
28
|
...importBans,
|
|
27
29
|
};
|
|
28
30
|
/**
|
|
@@ -96,6 +98,13 @@ export const base = {
|
|
|
96
98
|
// order; a module you need is a value you bind.
|
|
97
99
|
'import-x/no-unassigned-import': 'error',
|
|
98
100
|
},
|
|
101
|
+
}, {
|
|
102
|
+
// An async iterable read to its end into an array is Array.fromAsync,
|
|
103
|
+
// in shipped code and in tests alike.
|
|
104
|
+
name: 'zukhruf/base/async-values',
|
|
105
|
+
files: SOURCE,
|
|
106
|
+
plugins,
|
|
107
|
+
rules: { 'zukhruf/no-collect-loop': 'error' },
|
|
99
108
|
}, {
|
|
100
109
|
// A module-scope `let` is a global, and the functions that read it
|
|
101
110
|
// cannot be closures over it, so their other dependencies get drilled
|
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,cAAc,MAAM,qCAAqC,CAAC;AACjE,OAAO,WAAW,MAAM,iCAAiC,CAAC;AAC1D,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,gBAAgB,MAAM,kCAAkC,CAAC;AAChE,OAAO,eAAe,MAAM,iCAAiC,CAAC;AAC9D,OAAO,gBAAgB,MAAM,mCAAmC,CAAC;AACjE,OAAO,MAAM,MAAM,wBAAwB,CAAC;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AACjE,OAAO,EAAE,kBAAkB,EAAE,KAAK,EAAE,M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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;AAsBrD,eAAO,MAAM,KAAK,EAAE,OAWnB,CAAC"}
|
|
@@ -2,7 +2,10 @@ import { enable } from "../concept.js";
|
|
|
2
2
|
import { TESTS, TEST_SUPPORT } from "../files.js";
|
|
3
3
|
import noCatchAllMswHandler from "./no-catch-all-msw-handler.js";
|
|
4
4
|
import noDirectMswServer from "./no-direct-msw-server.js";
|
|
5
|
+
import noGlobalTestMock from "./no-global-test-mock.js";
|
|
5
6
|
import noProcessEnvWrite from "./no-process-env-write.js";
|
|
7
|
+
import noRawTempDirectory from "./no-raw-temp-directory.js";
|
|
8
|
+
import noSleepPollLoop from "./no-sleep-poll-loop.js";
|
|
6
9
|
import noTestLifecycleHooks from "./no-test-lifecycle-hooks.js";
|
|
7
10
|
import noTimerRace from "./no-timer-race.js";
|
|
8
11
|
const rules = {
|
|
@@ -11,6 +14,9 @@ const rules = {
|
|
|
11
14
|
'no-direct-msw-server': noDirectMswServer,
|
|
12
15
|
'no-catch-all-msw-handler': noCatchAllMswHandler,
|
|
13
16
|
'no-timer-race': noTimerRace,
|
|
17
|
+
'no-sleep-poll-loop': noSleepPollLoop,
|
|
18
|
+
'no-global-test-mock': noGlobalTestMock,
|
|
19
|
+
'no-raw-temp-directory': noRawTempDirectory,
|
|
14
20
|
};
|
|
15
21
|
export const tests = {
|
|
16
22
|
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,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AM,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC;QACnB;YACE,IAAI,EAAE,eAAe;YACrB,KAAK,EAAE,CAAC,GAAG,KAAK,EAAE,GAAG,YAAY,CAAC;YAClC,OAAO;YACP,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC;SACrB;KACF;CACF,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The `mock` export of node:test belongs to no test: what it patches stays
|
|
3
|
+
* patched until someone calls `mock.restoreAll()`, and that call also restores
|
|
4
|
+
* the mocks of every other test that runs at the same time. `t.mock` belongs to
|
|
5
|
+
* the test, and node:test restores it when the test ends, also when an assert
|
|
6
|
+
* fails first.
|
|
7
|
+
*/
|
|
8
|
+
declare const _default: import("eslint").Rule.RuleModule;
|
|
9
|
+
export default _default;
|
|
10
|
+
//# sourceMappingURL=no-global-test-mock.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"no-global-test-mock.d.ts","sourceRoot":"","sources":["../../src/test-files/no-global-test-mock.ts"],"names":[],"mappings":"AAIA;;;;;;GAMG;;AACH,wBAQG"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { selectorRule } from "../authoring/selector-rule.js";
|
|
2
|
+
const NODE_TEST = '/^(node:)?test$/';
|
|
3
|
+
/**
|
|
4
|
+
* The `mock` export of node:test belongs to no test: what it patches stays
|
|
5
|
+
* patched until someone calls `mock.restoreAll()`, and that call also restores
|
|
6
|
+
* the mocks of every other test that runs at the same time. `t.mock` belongs to
|
|
7
|
+
* the test, and node:test restores it when the test ends, also when an assert
|
|
8
|
+
* fails first.
|
|
9
|
+
*/
|
|
10
|
+
export default selectorRule({
|
|
11
|
+
description: 'Disallow the global mock of node:test; use t.mock',
|
|
12
|
+
selectors: [
|
|
13
|
+
`ImportDeclaration[source.value=${NODE_TEST}] > ImportSpecifier[imported.name="mock"]`,
|
|
14
|
+
`Program:has(ImportDeclaration[source.value=${NODE_TEST}]) MemberExpression[object.name=/^(test|it)$/][property.name="mock"]`,
|
|
15
|
+
],
|
|
16
|
+
message: 'Use t.mock (the TestContext of this test): node:test restores it when the test ends, also when an assert fails.',
|
|
17
|
+
});
|
|
18
|
+
//# sourceMappingURL=no-global-test-mock.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"no-global-test-mock.js","sourceRoot":"","sources":["../../src/test-files/no-global-test-mock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAE7D,MAAM,SAAS,GAAG,kBAAkB,CAAC;AAErC;;;;;;GAMG;AACH,eAAe,YAAY,CAAC;IAC1B,WAAW,EAAE,mDAAmD;IAChE,SAAS,EAAE;QACT,kCAAkC,SAAS,2CAA2C;QACtF,8CAA8C,SAAS,sEAAsE;KAC9H;IACD,OAAO,EACL,iHAAiH;CACpH,CAAC,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Rule } from 'eslint';
|
|
2
|
+
/**
|
|
3
|
+
* Each test that makes its own temporary directory picks its own cleanup, and
|
|
4
|
+
* the copies drift: one forgets the retry that Windows needs for a file that
|
|
5
|
+
* is still open, another compares the path with what a child process reports,
|
|
6
|
+
* which on macOS is the real path behind the `/var` symlink. `TemporaryFiles`
|
|
7
|
+
* of `@zukhruf/testing/fs` gives the real path and removes the directory with
|
|
8
|
+
* the retry. Only the calls of `node:fs` and `node:fs/promises` are reported:
|
|
9
|
+
* the rule follows the imports of the file, not a value passed in.
|
|
10
|
+
*/
|
|
11
|
+
declare const rule: Rule.RuleModule;
|
|
12
|
+
export default rule;
|
|
13
|
+
//# sourceMappingURL=no-raw-temp-directory.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { identifierName, isAstNode, isType, } from "../authoring/ast.js";
|
|
2
|
+
const FS = new Set(['fs', 'node:fs']);
|
|
3
|
+
const FS_PROMISES = new Set(['fs/promises', 'node:fs/promises']);
|
|
4
|
+
const MKDTEMP = new Set([
|
|
5
|
+
'mkdtemp',
|
|
6
|
+
'mkdtempSync',
|
|
7
|
+
'mkdtempDisposable',
|
|
8
|
+
'mkdtempDisposableSync',
|
|
9
|
+
]);
|
|
10
|
+
function importedName(specifier) {
|
|
11
|
+
const imported = specifier['imported'];
|
|
12
|
+
return isType(imported, 'Literal') && typeof imported['value'] === 'string'
|
|
13
|
+
? imported['value']
|
|
14
|
+
: identifierName(imported);
|
|
15
|
+
}
|
|
16
|
+
function memberName(member) {
|
|
17
|
+
const property = member['property'];
|
|
18
|
+
if (member['computed'] !== true)
|
|
19
|
+
return identifierName(property);
|
|
20
|
+
return isType(property, 'Literal') && typeof property['value'] === 'string'
|
|
21
|
+
? property['value']
|
|
22
|
+
: undefined;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Each test that makes its own temporary directory picks its own cleanup, and
|
|
26
|
+
* the copies drift: one forgets the retry that Windows needs for a file that
|
|
27
|
+
* is still open, another compares the path with what a child process reports,
|
|
28
|
+
* which on macOS is the real path behind the `/var` symlink. `TemporaryFiles`
|
|
29
|
+
* of `@zukhruf/testing/fs` gives the real path and removes the directory with
|
|
30
|
+
* the retry. Only the calls of `node:fs` and `node:fs/promises` are reported:
|
|
31
|
+
* the rule follows the imports of the file, not a value passed in.
|
|
32
|
+
*/
|
|
33
|
+
const rule = {
|
|
34
|
+
meta: {
|
|
35
|
+
type: 'problem',
|
|
36
|
+
docs: {
|
|
37
|
+
description: 'Disallow a raw temporary directory in tests; use TemporaryFiles',
|
|
38
|
+
},
|
|
39
|
+
schema: [],
|
|
40
|
+
messages: {
|
|
41
|
+
matched: 'Use `await using dir = await new TemporaryFiles().directory(prefix)` from @zukhruf/testing/fs: one standard temp directory for tests, at its real path, removed with a retry for Windows.',
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
create(context) {
|
|
45
|
+
const functions = new Set();
|
|
46
|
+
const fsModules = new Set();
|
|
47
|
+
const promiseModules = new Set();
|
|
48
|
+
function isPromisesObject(node) {
|
|
49
|
+
const name = identifierName(node);
|
|
50
|
+
if (name !== undefined)
|
|
51
|
+
return promiseModules.has(name);
|
|
52
|
+
if (!isType(node, 'MemberExpression'))
|
|
53
|
+
return false;
|
|
54
|
+
const object = identifierName(node['object']);
|
|
55
|
+
return (object !== undefined &&
|
|
56
|
+
fsModules.has(object) &&
|
|
57
|
+
memberName(node) === 'promises');
|
|
58
|
+
}
|
|
59
|
+
function isMkdtemp(callee) {
|
|
60
|
+
const name = identifierName(callee);
|
|
61
|
+
if (name !== undefined)
|
|
62
|
+
return functions.has(name);
|
|
63
|
+
if (!isType(callee, 'MemberExpression'))
|
|
64
|
+
return false;
|
|
65
|
+
const property = memberName(callee);
|
|
66
|
+
if (property === undefined || !MKDTEMP.has(property))
|
|
67
|
+
return false;
|
|
68
|
+
const object = callee['object'];
|
|
69
|
+
const objectName = identifierName(object);
|
|
70
|
+
return ((objectName !== undefined && fsModules.has(objectName)) ||
|
|
71
|
+
isPromisesObject(object));
|
|
72
|
+
}
|
|
73
|
+
return {
|
|
74
|
+
ImportDeclaration(node) {
|
|
75
|
+
if (!isAstNode(node) || !isAstNode(node['source']))
|
|
76
|
+
return;
|
|
77
|
+
const source = node['source']['value'];
|
|
78
|
+
if (typeof source !== 'string')
|
|
79
|
+
return;
|
|
80
|
+
const isFs = FS.has(source);
|
|
81
|
+
if (!isFs && !FS_PROMISES.has(source))
|
|
82
|
+
return;
|
|
83
|
+
const specifiers = node['specifiers'];
|
|
84
|
+
if (!Array.isArray(specifiers))
|
|
85
|
+
return;
|
|
86
|
+
for (const specifier of specifiers) {
|
|
87
|
+
if (!isAstNode(specifier))
|
|
88
|
+
continue;
|
|
89
|
+
const local = identifierName(specifier['local']);
|
|
90
|
+
if (local === undefined)
|
|
91
|
+
continue;
|
|
92
|
+
if (specifier.type !== 'ImportSpecifier') {
|
|
93
|
+
(isFs ? fsModules : promiseModules).add(local);
|
|
94
|
+
continue;
|
|
95
|
+
}
|
|
96
|
+
const imported = importedName(specifier);
|
|
97
|
+
if (imported !== undefined && MKDTEMP.has(imported)) {
|
|
98
|
+
functions.add(local);
|
|
99
|
+
}
|
|
100
|
+
else if (isFs && imported === 'promises') {
|
|
101
|
+
promiseModules.add(local);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
},
|
|
105
|
+
CallExpression(node) {
|
|
106
|
+
if (isAstNode(node) && isMkdtemp(node['callee'])) {
|
|
107
|
+
context.report({ node, messageId: 'matched' });
|
|
108
|
+
}
|
|
109
|
+
},
|
|
110
|
+
};
|
|
111
|
+
},
|
|
112
|
+
};
|
|
113
|
+
export default rule;
|
|
114
|
+
//# sourceMappingURL=no-raw-temp-directory.js.map
|
|
@@ -0,0 +1 @@
|
|
|
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,CA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CAAC;YACH,CAAC;SACF,CAAC;IACJ,CAAC;CACF,CAAC;AAEF,eAAe,IAAI,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Rule } from 'eslint';
|
|
2
|
+
/**
|
|
3
|
+
* A loop that sleeps between checks is a hand-written `t.waitFor`: each copy
|
|
4
|
+
* picks its own interval and deadline, and most fail with "the condition never
|
|
5
|
+
* held" instead of the check's own error. `t.waitFor` of node:test retries
|
|
6
|
+
* until the check passes and fails with the last error. A `for await` loop
|
|
7
|
+
* and a timer awaited in a callback that the loop builds are not polls.
|
|
8
|
+
*/
|
|
9
|
+
declare const rule: Rule.RuleModule;
|
|
10
|
+
export default rule;
|
|
11
|
+
//# sourceMappingURL=no-sleep-poll-loop.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"no-sleep-poll-loop.d.ts","sourceRoot":"","sources":["../../src/test-files/no-sleep-poll-loop.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AA4DnC;;;;;;GAMG;AACH,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,UAsBhB,CAAC;AAEF,eAAe,IAAI,CAAC"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { identifierName, isAstNode, isType, } from "../authoring/ast.js";
|
|
2
|
+
const TIMERS = new Set(['setTimeout', 'sleep', 'delay']);
|
|
3
|
+
const LOOPS = new Set(['WhileStatement', 'DoWhileStatement', 'ForStatement']);
|
|
4
|
+
const FUNCTIONS = new Set([
|
|
5
|
+
'FunctionDeclaration',
|
|
6
|
+
'FunctionExpression',
|
|
7
|
+
'ArrowFunctionExpression',
|
|
8
|
+
]);
|
|
9
|
+
function calleeName(call) {
|
|
10
|
+
const callee = call['callee'];
|
|
11
|
+
return isType(callee, 'MemberExpression')
|
|
12
|
+
? identifierName(callee['property'])
|
|
13
|
+
: identifierName(callee);
|
|
14
|
+
}
|
|
15
|
+
function isTimerCall(node) {
|
|
16
|
+
if (!isType(node, 'CallExpression'))
|
|
17
|
+
return false;
|
|
18
|
+
const name = calleeName(node);
|
|
19
|
+
return name !== undefined && TIMERS.has(name);
|
|
20
|
+
}
|
|
21
|
+
/** `sleep(ms)`, `setTimeout(ms)` of `node:timers/promises`, or `new Promise((r) => setTimeout(r, ms))`. */
|
|
22
|
+
function isTimer(awaited) {
|
|
23
|
+
if (isTimerCall(awaited))
|
|
24
|
+
return true;
|
|
25
|
+
if (!isType(awaited, 'NewExpression'))
|
|
26
|
+
return false;
|
|
27
|
+
const executor = Array.isArray(awaited['arguments'])
|
|
28
|
+
? awaited['arguments'][0]
|
|
29
|
+
: undefined;
|
|
30
|
+
const body = isAstNode(executor) ? executor['body'] : undefined;
|
|
31
|
+
return (isTimerCall(body) ||
|
|
32
|
+
(isType(body, 'BlockStatement') &&
|
|
33
|
+
Array.isArray(body['body']) &&
|
|
34
|
+
body['body'].some((statement) => isType(statement, 'ExpressionStatement') &&
|
|
35
|
+
isTimerCall(statement['expression']))));
|
|
36
|
+
}
|
|
37
|
+
/** The loop that runs `node` again, in the same function. */
|
|
38
|
+
function enclosingLoop(node) {
|
|
39
|
+
let parent = node['parent'];
|
|
40
|
+
while (isAstNode(parent) && !FUNCTIONS.has(parent.type)) {
|
|
41
|
+
if (LOOPS.has(parent.type))
|
|
42
|
+
return parent;
|
|
43
|
+
parent = parent['parent'];
|
|
44
|
+
}
|
|
45
|
+
return undefined;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* A loop that sleeps between checks is a hand-written `t.waitFor`: each copy
|
|
49
|
+
* picks its own interval and deadline, and most fail with "the condition never
|
|
50
|
+
* held" instead of the check's own error. `t.waitFor` of node:test retries
|
|
51
|
+
* until the check passes and fails with the last error. A `for await` loop
|
|
52
|
+
* and a timer awaited in a callback that the loop builds are not polls.
|
|
53
|
+
*/
|
|
54
|
+
const rule = {
|
|
55
|
+
meta: {
|
|
56
|
+
type: 'problem',
|
|
57
|
+
docs: { description: 'Disallow a loop that sleeps between checks' },
|
|
58
|
+
schema: [],
|
|
59
|
+
messages: {
|
|
60
|
+
matched: 'Use t.waitFor(() => { assert… }, { interval, timeout }): it retries until the check passes and fails with the last error.',
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
create(context) {
|
|
64
|
+
const reported = new Set();
|
|
65
|
+
return {
|
|
66
|
+
AwaitExpression(node) {
|
|
67
|
+
if (!isAstNode(node) || !isTimer(node['argument']))
|
|
68
|
+
return;
|
|
69
|
+
const loop = enclosingLoop(node);
|
|
70
|
+
if (loop === undefined || reported.has(loop))
|
|
71
|
+
return;
|
|
72
|
+
reported.add(loop);
|
|
73
|
+
context.report({ node: loop, messageId: 'matched' });
|
|
74
|
+
},
|
|
75
|
+
};
|
|
76
|
+
},
|
|
77
|
+
};
|
|
78
|
+
export default rule;
|
|
79
|
+
//# sourceMappingURL=no-sleep-poll-loop.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"no-sleep-poll-loop.js","sourceRoot":"","sources":["../../src/test-files/no-sleep-poll-loop.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,cAAc,EACd,SAAS,EACT,MAAM,GACP,MAAM,qBAAqB,CAAC;AAE7B,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,CAAC,YAAY,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC;AACzD,MAAM,KAAK,GAAG,IAAI,GAAG,CAAC,CAAC,gBAAgB,EAAE,kBAAkB,EAAE,cAAc,CAAC,CAAC,CAAC;AAC9E,MAAM,SAAS,GAAG,IAAI,GAAG,CAAC;IACxB,qBAAqB;IACrB,oBAAoB;IACpB,yBAAyB;CAC1B,CAAC,CAAC;AAEH,SAAS,UAAU,CAAC,IAAa;IAC/B,MAAM,MAAM,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAC;IAC9B,OAAO,MAAM,CAAC,MAAM,EAAE,kBAAkB,CAAC;QACvC,CAAC,CAAC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|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.45",
|
|
4
4
|
"description": "ESLint rules and configs shared across workspaces. Every check is its own named rule, so a repo's own config cannot silently erase it.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -55,6 +55,9 @@
|
|
|
55
55
|
"ignore": "^7.0.12",
|
|
56
56
|
"ts-api-utils": "^2.5.0"
|
|
57
57
|
},
|
|
58
|
+
"devDependencies": {
|
|
59
|
+
"@zukhruf/testing": "^0.3.45"
|
|
60
|
+
},
|
|
58
61
|
"peerDependencies": {
|
|
59
62
|
"@eslint/js": "^9.30.0 || ^10.0.0",
|
|
60
63
|
"@nx/devkit": ">=21.0.0",
|