@sarj/eslint-plugin 9.10.0 → 9.11.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 +7 -0
- package/dist/index.cjs +3 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# @sarj/eslint-plugin
|
|
2
2
|
|
|
3
|
+
## New in 9.11.0 — disabled test assertions
|
|
4
|
+
|
|
5
|
+
`no-comment-cruft` now recognizes commented-out `expect(...)` chains and
|
|
6
|
+
`assert(...)` calls. A disabled assertion leaves a collected test passing while
|
|
7
|
+
verifying nothing. JSDoc and assertion examples introduced by prose remain
|
|
8
|
+
exempt, as do active assertions.
|
|
9
|
+
|
|
3
10
|
## New in 9.9.0 — static Next.js matchers
|
|
4
11
|
|
|
5
12
|
`require-static-next-matcher` rejects runtime expressions in exported
|
package/dist/index.cjs
CHANGED
|
@@ -683,6 +683,7 @@ var CODE_KEYWORD_RE = /^(import |export |const |let |var |function\b|class |inte
|
|
|
683
683
|
var CODE_TAIL_RE = /[;{}()]\s*$|=>\s*$|,\s*$/;
|
|
684
684
|
var ASSIGN_RE = /^[A-Za-z_$][\w.$[\]]*\s*(?:=(?![=>])|\+=|-=|\*=)\s*\S.*[;)}\]]\s*$/;
|
|
685
685
|
var CALL_RE = /^[A-Za-z_$][\w.$]*\([^)]*\)\s*;?\s*$/;
|
|
686
|
+
var ASSERTION_CODE_RE = /^(?:await\s+)?(?:expect(?:TypeOf)?\s*\(.+\)\s*(?:\.\w+(?:<[^;()]*>)?)+(?:\s*\(.*\))?|assert(?:\.\w+)?\s*\(.+\))\s*;?\s*$/;
|
|
686
687
|
var PSEUDOCODE_RE = /%\w+%|\[opt\]|(?:^|\s)<[A-Za-z]\w*>|…|\.\.\./;
|
|
687
688
|
function stripCommentMarker(line) {
|
|
688
689
|
return line.replace(/^\s*\/{1,2}/, "").replace(/^\s*\*+/, "").trim();
|
|
@@ -701,6 +702,7 @@ function looksLikeCode(text, allowCall = true) {
|
|
|
701
702
|
if (!t) return false;
|
|
702
703
|
if (CODE_KEYWORD_RE.test(t) && CODE_TAIL_RE.test(t)) return true;
|
|
703
704
|
if (ASSIGN_RE.test(t)) return true;
|
|
705
|
+
if (ASSERTION_CODE_RE.test(t)) return true;
|
|
704
706
|
return allowCall && CALL_RE.test(t);
|
|
705
707
|
}
|
|
706
708
|
function hasPseudocode(text) {
|
|
@@ -10359,7 +10361,7 @@ var rules = {
|
|
|
10359
10361
|
};
|
|
10360
10362
|
var meta = {
|
|
10361
10363
|
name: "@sarj/eslint-plugin",
|
|
10362
|
-
version: "9.
|
|
10364
|
+
version: "9.11.0"
|
|
10363
10365
|
};
|
|
10364
10366
|
var applicationOnlyRules = [
|
|
10365
10367
|
"no-restricted-library-load",
|