@zukhruf/eslint 0.3.0 → 0.3.2
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/test-files/require-msw-error-on-unhandled-request.d.ts +4 -3
- package/dist/test-files/require-msw-error-on-unhandled-request.d.ts.map +1 -1
- package/dist/test-files/require-msw-error-on-unhandled-request.js +6 -5
- package/dist/test-files/require-msw-error-on-unhandled-request.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* msw answers only what a handler lists. Without this option an unstubbed
|
|
3
3
|
* request is warned about and sent to the real network, so the test passes on
|
|
4
|
-
* a live dependency it never meant to touch.
|
|
5
|
-
*
|
|
6
|
-
*
|
|
4
|
+
* a live dependency it never meant to touch. msw 3 names the option
|
|
5
|
+
* `onUnhandledFrame`; msw 2 named it `onUnhandledRequest`. Scoped by the
|
|
6
|
+
* `msw/node` import; a `listen()` on something else in the same file, called
|
|
7
|
+
* with no argument or an object, is the one known false positive.
|
|
7
8
|
*/
|
|
8
9
|
declare const _default: import("eslint").Rule.RuleModule;
|
|
9
10
|
export default _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"require-msw-error-on-unhandled-request.d.ts","sourceRoot":"","sources":["../../src/test-files/require-msw-error-on-unhandled-request.ts"],"names":[],"mappings":"AAEA
|
|
1
|
+
{"version":3,"file":"require-msw-error-on-unhandled-request.d.ts","sourceRoot":"","sources":["../../src/test-files/require-msw-error-on-unhandled-request.ts"],"names":[],"mappings":"AAEA;;;;;;;GAOG;;AACH,wBAOG"}
|
|
@@ -2,15 +2,16 @@ import { selectorRule } from "../authoring/selector-rule.js";
|
|
|
2
2
|
/**
|
|
3
3
|
* msw answers only what a handler lists. Without this option an unstubbed
|
|
4
4
|
* request is warned about and sent to the real network, so the test passes on
|
|
5
|
-
* a live dependency it never meant to touch.
|
|
6
|
-
*
|
|
7
|
-
*
|
|
5
|
+
* a live dependency it never meant to touch. msw 3 names the option
|
|
6
|
+
* `onUnhandledFrame`; msw 2 named it `onUnhandledRequest`. Scoped by the
|
|
7
|
+
* `msw/node` import; a `listen()` on something else in the same file, called
|
|
8
|
+
* with no argument or an object, is the one known false positive.
|
|
8
9
|
*/
|
|
9
10
|
export default selectorRule({
|
|
10
11
|
description: "Require msw's server.listen() to fail on unhandled requests",
|
|
11
12
|
selectors: [
|
|
12
|
-
'Program:has(ImportDeclaration[source.value="msw/node"]) CallExpression[callee.property.name="listen"]:matches([arguments.length=0], [arguments.0.type="ObjectExpression"]):not(:has(Property[key.name
|
|
13
|
+
'Program:has(ImportDeclaration[source.value="msw/node"]) CallExpression[callee.property.name="listen"]:matches([arguments.length=0], [arguments.0.type="ObjectExpression"]):not(:has(Property[key.name=/^onUnhandled(Frame|Request)$/] > Literal[value="error"]))',
|
|
13
14
|
],
|
|
14
|
-
message: "msw: server.listen() must pass {
|
|
15
|
+
message: "msw: server.listen() must pass { onUnhandledFrame: 'error' } (msw 2: onUnhandledRequest) so an unstubbed request fails the test instead of reaching the network.",
|
|
15
16
|
});
|
|
16
17
|
//# sourceMappingURL=require-msw-error-on-unhandled-request.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"require-msw-error-on-unhandled-request.js","sourceRoot":"","sources":["../../src/test-files/require-msw-error-on-unhandled-request.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAE7D
|
|
1
|
+
{"version":3,"file":"require-msw-error-on-unhandled-request.js","sourceRoot":"","sources":["../../src/test-files/require-msw-error-on-unhandled-request.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAE7D;;;;;;;GAOG;AACH,eAAe,YAAY,CAAC;IAC1B,WAAW,EAAE,6DAA6D;IAC1E,SAAS,EAAE;QACT,kQAAkQ;KACnQ;IACD,OAAO,EACL,kKAAkK;CACrK,CAAC,CAAC"}
|
package/package.json
CHANGED