eslint-plugin-wyrm 0.0.11 → 0.0.13
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/CHANGELOG.md +53 -0
- package/README.md +114 -78
- package/bin/wyrm.mjs +3 -0
- package/dist/_virtual/_rolldown/runtime.mjs +7 -13
- package/dist/cli.d.mts +1 -0
- package/dist/cli.mjs +23 -0
- package/dist/configs/index.mjs +1 -3
- package/dist/index.mjs +1 -3
- package/dist/plugin.mjs +1 -3
- package/dist/rules/array-from-array.d.mts +9 -0
- package/dist/rules/array-from-array.mjs +56 -0
- package/dist/rules/as-unknown-as.d.mts +9 -0
- package/dist/rules/as-unknown-as.mjs +30 -0
- package/dist/rules/await-promise-resolve.d.mts +9 -0
- package/dist/rules/await-promise-resolve.mjs +41 -0
- package/dist/rules/boolean-coalescing.d.mts +9 -0
- package/dist/rules/boolean-coalescing.mjs +141 -0
- package/dist/rules/comment-duplicate-leading-space.d.mts +9 -0
- package/dist/rules/comment-duplicate-leading-space.mjs +34 -0
- package/dist/rules/conditional-boolean.d.mts +9 -0
- package/dist/rules/conditional-boolean.mjs +70 -0
- package/dist/rules/constant-boolean-cast.d.mts +9 -0
- package/dist/rules/constant-boolean-cast.mjs +203 -0
- package/dist/rules/de-morgan.d.mts +2 -2
- package/dist/rules/de-morgan.mjs +1 -3
- package/dist/rules/discarded-expression-statement.d.mts +14 -0
- package/dist/rules/discarded-expression-statement.mjs +243 -0
- package/dist/rules/distribute-boolean-casts.d.mts +2 -2
- package/dist/rules/distribute-boolean-casts.mjs +3 -3
- package/dist/rules/duplicate-destructuring.d.mts +2 -2
- package/dist/rules/duplicate-destructuring.mjs +1 -3
- package/dist/rules/duplicate-object-spread.d.mts +9 -0
- package/dist/rules/duplicate-object-spread.mjs +44 -0
- package/dist/rules/e.d.mts +3 -3
- package/dist/rules/e.mjs +4 -3
- package/dist/rules/empty-for.d.mts +9 -0
- package/dist/rules/empty-for.mjs +34 -0
- package/dist/rules/enum-member.d.mts +9 -0
- package/dist/rules/enum-member.mjs +51 -0
- package/dist/rules/eqeq-null.d.mts +9 -0
- package/dist/rules/eqeq-null.mjs +101 -0
- package/dist/rules/exact-string-regex.d.mts +2 -2
- package/dist/rules/exact-string-regex.mjs +1 -3
- package/dist/rules/export-using.mjs +1 -3
- package/dist/rules/generic-constructor-with-hook.d.mts +3 -3
- package/dist/rules/generic-constructor-with-hook.mjs +1 -3
- package/dist/rules/idiomatic-cast.mjs +6 -8
- package/dist/rules/index.d.mts +112 -77
- package/dist/rules/index.mjs +71 -3
- package/dist/rules/inferable-type-predicate.d.mts +9 -0
- package/dist/rules/inferable-type-predicate.mjs +100 -0
- package/dist/rules/inner-as-const.d.mts +9 -0
- package/dist/rules/inner-as-const.mjs +70 -0
- package/dist/rules/jsx-tostring.d.mts +9 -0
- package/dist/rules/jsx-tostring.mjs +120 -0
- package/dist/rules/literal-destructuring.d.mts +9 -0
- package/dist/rules/literal-destructuring.mjs +102 -0
- package/dist/rules/named-export-with-side-effects.d.mts +3 -3
- package/dist/rules/named-export-with-side-effects.mjs +1 -3
- package/dist/rules/nested-reduce.d.mts +9 -0
- package/dist/rules/nested-reduce.mjs +46 -0
- package/dist/rules/nested-try-catch.d.mts +9 -0
- package/dist/rules/nested-try-catch.mjs +37 -0
- package/dist/rules/no-commented-out-comment.d.mts +2 -2
- package/dist/rules/no-commented-out-comment.mjs +1 -3
- package/dist/rules/no-constant-template-expression.mjs +9 -6
- package/dist/rules/no-constructed-error-cause.d.mts +2 -2
- package/dist/rules/no-constructed-error-cause.mjs +1 -3
- package/dist/rules/no-convoluted-boolean-expressions.d.mts +9 -0
- package/dist/rules/no-convoluted-boolean-expressions.mjs +130 -0
- package/dist/rules/no-convoluted-logical-expressions.d.mts +2 -2
- package/dist/rules/no-convoluted-logical-expressions.mjs +1 -3
- package/dist/rules/no-custom-url-parsing.d.mts +2 -2
- package/dist/rules/no-custom-url-parsing.mjs +1 -3
- package/dist/rules/no-disallowed-warning-comments.d.mts +2 -2
- package/dist/rules/no-disallowed-warning-comments.mjs +1 -3
- package/dist/rules/no-duplicated-return.d.mts +2 -2
- package/dist/rules/no-duplicated-return.mjs +1 -3
- package/dist/rules/no-else-break.d.mts +2 -2
- package/dist/rules/no-else-break.mjs +1 -3
- package/dist/rules/no-else-continue.d.mts +2 -2
- package/dist/rules/no-else-continue.mjs +1 -3
- package/dist/rules/no-else-never.d.mts +9 -0
- package/dist/rules/no-else-never.mjs +75 -0
- package/dist/rules/no-else-return.d.mts +2 -2
- package/dist/rules/no-else-return.mjs +1 -3
- package/dist/rules/no-else-throw.d.mts +2 -2
- package/dist/rules/no-else-throw.mjs +1 -3
- package/dist/rules/no-empty-attribute.d.mts +3 -3
- package/dist/rules/no-empty-attribute.mjs +1 -3
- package/dist/rules/no-empty-comment.d.mts +3 -3
- package/dist/rules/no-empty-comment.mjs +1 -3
- package/dist/rules/no-empty-jsx-expression.d.mts +2 -2
- package/dist/rules/no-empty-jsx-expression.mjs +1 -3
- package/dist/rules/no-empty-literal-iteration.d.mts +2 -2
- package/dist/rules/no-empty-literal-iteration.mjs +1 -3
- package/dist/rules/no-extra-false-fallback.d.mts +2 -2
- package/dist/rules/no-extra-false-fallback.mjs +1 -3
- package/dist/rules/no-extra-nested-boolean-cast.d.mts +2 -2
- package/dist/rules/no-extra-nested-boolean-cast.mjs +2 -3
- package/dist/rules/no-first-last.d.mts +2 -2
- package/dist/rules/no-first-last.mjs +2 -4
- package/dist/rules/no-float-length-check.d.mts +2 -2
- package/dist/rules/no-float-length-check.mjs +1 -3
- package/dist/rules/no-huge-try-block.d.mts +3 -3
- package/dist/rules/no-huge-try-block.mjs +1 -3
- package/dist/rules/no-huge-useeffect.d.mts +3 -3
- package/dist/rules/no-huge-useeffect.mjs +1 -3
- package/dist/rules/no-if-length-for.d.mts +2 -2
- package/dist/rules/no-if-length-for.mjs +1 -3
- package/dist/rules/no-inline-jsdoc-tag.d.mts +3 -3
- package/dist/rules/no-inline-jsdoc-tag.mjs +1 -3
- package/dist/rules/no-invalid-date-literal.d.mts +2 -2
- package/dist/rules/no-invalid-date-literal.mjs +1 -3
- package/dist/rules/no-jsx-statement.d.mts +2 -2
- package/dist/rules/no-jsx-statement.mjs +1 -3
- package/dist/rules/no-lax-array-type.mjs +7 -9
- package/dist/rules/no-lax-return-type.mjs +7 -8
- package/dist/rules/no-mutable-literal-fill.d.mts +2 -2
- package/dist/rules/no-mutable-literal-fill.mjs +1 -3
- package/dist/rules/no-nullish-ternary.d.mts +9 -0
- package/dist/rules/no-nullish-ternary.mjs +121 -0
- package/dist/rules/no-numbered-comments.d.mts +2 -2
- package/dist/rules/no-numbered-comments.mjs +1 -3
- package/dist/rules/no-obvious-any.mjs +9 -12
- package/dist/rules/no-optional-type-guard-param.d.mts +2 -2
- package/dist/rules/no-optional-type-guard-param.mjs +1 -3
- package/dist/rules/no-out-of-order-comments.d.mts +2 -2
- package/dist/rules/no-out-of-order-comments.mjs +3 -8
- package/dist/rules/no-possibly-nullish-equality.mjs +6 -12
- package/dist/rules/no-redundant-function-declaration.d.mts +2 -2
- package/dist/rules/no-redundant-function-declaration.mjs +1 -3
- package/dist/rules/no-return-to-void.mjs +1 -3
- package/dist/rules/no-self-object-assign.d.mts +2 -2
- package/dist/rules/no-self-object-assign.mjs +1 -3
- package/dist/rules/no-sloppy-length-check.d.mts +2 -2
- package/dist/rules/no-sloppy-length-check.mjs +25 -27
- package/dist/rules/no-suspicious-jsx-semicolon.d.mts +2 -2
- package/dist/rules/no-suspicious-jsx-semicolon.mjs +2 -4
- package/dist/rules/no-ternary-return.d.mts +3 -3
- package/dist/rules/no-ternary-return.mjs +1 -3
- package/dist/rules/no-type-guard.d.mts +9 -0
- package/dist/rules/no-type-guard.mjs +36 -0
- package/dist/rules/no-unassigned-todo.d.mts +2 -2
- package/dist/rules/no-unassigned-todo.mjs +1 -3
- package/dist/rules/no-unbound-catch-error.d.mts +2 -2
- package/dist/rules/no-unbound-catch-error.mjs +1 -3
- package/dist/rules/no-unused-mutually-referential.mjs +10 -15
- package/dist/rules/no-unused-param-read.d.mts +2 -2
- package/dist/rules/no-unused-param-read.mjs +1 -3
- package/dist/rules/no-useless-computed-key.d.mts +2 -2
- package/dist/rules/no-useless-computed-key.mjs +1 -3
- package/dist/rules/no-useless-iife.d.mts +2 -2
- package/dist/rules/no-useless-iife.mjs +2 -3
- package/dist/rules/no-useless-logical-fallback.mjs +7 -12
- package/dist/rules/no-useless-return-undefined.mjs +1 -3
- package/dist/rules/no-useless-ts-check.d.mts +2 -2
- package/dist/rules/no-useless-ts-check.mjs +1 -3
- package/dist/rules/no-useless-use-strict.d.mts +2 -2
- package/dist/rules/no-useless-use-strict.mjs +1 -3
- package/dist/rules/no-useless-usememo.d.mts +2 -2
- package/dist/rules/no-useless-usememo.mjs +1 -3
- package/dist/rules/no-whitespace-property.d.mts +2 -2
- package/dist/rules/no-whitespace-property.mjs +1 -3
- package/dist/rules/nullish-object-spread.d.mts +2 -2
- package/dist/rules/nullish-object-spread.mjs +7 -6
- package/dist/rules/optional-call-expression.d.mts +2 -2
- package/dist/rules/optional-call-expression.mjs +1 -3
- package/dist/rules/prefer-array-from.d.mts +9 -0
- package/dist/rules/prefer-array-from.mjs +87 -0
- package/dist/rules/prefer-catch-method.d.mts +2 -2
- package/dist/rules/prefer-catch-method.mjs +2 -3
- package/dist/rules/prefer-early-return.d.mts +2 -2
- package/dist/rules/prefer-early-return.mjs +1 -3
- package/dist/rules/prefer-eqeq-null.d.mts +9 -0
- package/dist/rules/prefer-eqeq-null.mjs +122 -0
- package/dist/rules/prefer-finally.d.mts +2 -2
- package/dist/rules/prefer-finally.mjs +1 -3
- package/dist/rules/prefer-getorinsert.d.mts +2 -2
- package/dist/rules/prefer-getorinsert.mjs +1 -3
- package/dist/rules/prefer-has.d.mts +2 -2
- package/dist/rules/prefer-has.mjs +1 -3
- package/dist/rules/prefer-in.d.mts +9 -0
- package/dist/rules/prefer-in.mjs +81 -0
- package/dist/rules/prefer-object-keys-values.d.mts +2 -2
- package/dist/rules/prefer-object-keys-values.mjs +1 -3
- package/dist/rules/prefer-repeat.d.mts +2 -2
- package/dist/rules/prefer-repeat.mjs +1 -3
- package/dist/rules/prefer-satisfies.d.mts +9 -0
- package/dist/rules/prefer-satisfies.mjs +86 -0
- package/dist/rules/prefer-string-join.d.mts +9 -0
- package/dist/rules/prefer-string-join.mjs +67 -0
- package/dist/rules/primitive-valueof.mjs +6 -8
- package/dist/rules/slim-try.d.mts +2 -2
- package/dist/rules/slim-try.mjs +9 -11
- package/dist/rules/styled-button-has-type.d.mts +9 -0
- package/dist/rules/styled-button-has-type.mjs +82 -0
- package/dist/rules/styled-transient-props.d.mts +9 -0
- package/dist/rules/styled-transient-props.mjs +52 -0
- package/dist/rules/suspicious-map-length.d.mts +2 -2
- package/dist/rules/suspicious-map-length.mjs +1 -3
- package/dist/rules/template-tostring.d.mts +9 -0
- package/dist/rules/template-tostring.mjs +48 -0
- package/dist/rules/unsafe-asserted-chain.mjs +5 -7
- package/dist/rules/unused-object-assign.d.mts +2 -2
- package/dist/rules/unused-object-assign.mjs +1 -3
- package/dist/rules/unused-object-freeze.d.mts +9 -0
- package/dist/rules/unused-object-freeze.mjs +37 -0
- package/dist/rules/useless-as-const.d.mts +9 -0
- package/dist/rules/useless-as-const.mjs +59 -0
- package/dist/rules/useless-assign.d.mts +11 -0
- package/dist/rules/useless-assign.mjs +69 -0
- package/dist/rules/useless-conditional-assign.d.mts +9 -0
- package/dist/rules/useless-conditional-assign.mjs +58 -0
- package/dist/rules/useless-intermediary-variable.mjs +1 -3
- package/dist/rules/useless-mock.d.mts +9 -0
- package/dist/rules/useless-mock.mjs +180 -0
- package/dist/rules/useless-required.mjs +10 -12
- package/dist/utils/compareTokens.mjs +1 -3
- package/dist/utils/createRule.mjs +1 -3
- package/dist/utils/negateExpression.mjs +1 -3
- package/dist/utils/option.mjs +1 -2
- package/package.json +29 -23
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { createRule } from "../utils/createRule.mjs";
|
|
2
|
+
import { None, Some } from "../utils/option.mjs";
|
|
3
|
+
import path from "node:path";
|
|
4
|
+
import { AST_NODE_TYPES } from "@typescript-eslint/utils";
|
|
5
|
+
//#region lib/rules/inner-as-const.ts
|
|
6
|
+
const { name } = path.parse(import.meta.filename);
|
|
7
|
+
var inner_as_const_default = createRule({
|
|
8
|
+
name,
|
|
9
|
+
meta: {
|
|
10
|
+
type: "suggestion",
|
|
11
|
+
docs: {
|
|
12
|
+
description: "Enforce setting `as const` on the outermost object/array literal only",
|
|
13
|
+
strict: true
|
|
14
|
+
},
|
|
15
|
+
fixable: "code",
|
|
16
|
+
schema: [],
|
|
17
|
+
messages: {
|
|
18
|
+
noInnerAsConstObject: "Only set `as const` on the outermost object",
|
|
19
|
+
noInnerAsConstArray: "Only set `as const` on the outermost array"
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
defaultOptions: [],
|
|
23
|
+
create(context) {
|
|
24
|
+
return {
|
|
25
|
+
ArrayExpression(node) {
|
|
26
|
+
for (const elt of node.elements) {
|
|
27
|
+
if (!elt) continue;
|
|
28
|
+
const maybeExpr = getAsConstExpr(elt);
|
|
29
|
+
if (!maybeExpr.some) continue;
|
|
30
|
+
const expr = maybeExpr.value;
|
|
31
|
+
context.report({
|
|
32
|
+
node: elt,
|
|
33
|
+
messageId: "noInnerAsConstArray",
|
|
34
|
+
*fix(fixer) {
|
|
35
|
+
yield fixer.replaceText(elt, context.sourceCode.getText(expr));
|
|
36
|
+
if (getAsConstExpr(node.parent).some) return;
|
|
37
|
+
yield fixer.insertTextAfter(node, " as const");
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
ObjectExpression(node) {
|
|
43
|
+
for (const prop of node.properties) {
|
|
44
|
+
if (prop.type === AST_NODE_TYPES.SpreadElement) continue;
|
|
45
|
+
const maybeExpr = getAsConstExpr(prop.value);
|
|
46
|
+
if (!maybeExpr.some) continue;
|
|
47
|
+
const expr = maybeExpr.value;
|
|
48
|
+
context.report({
|
|
49
|
+
node: prop,
|
|
50
|
+
messageId: "noInnerAsConstObject",
|
|
51
|
+
*fix(fixer) {
|
|
52
|
+
yield fixer.replaceText(prop.value, context.sourceCode.getText(expr));
|
|
53
|
+
if (getAsConstExpr(node.parent).some) return;
|
|
54
|
+
yield fixer.insertTextAfter(node, " as const");
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
function getAsConstExpr(node) {
|
|
63
|
+
if (node.type !== AST_NODE_TYPES.TSAsExpression) return None;
|
|
64
|
+
if (node.typeAnnotation.type !== AST_NODE_TYPES.TSTypeReference) return None;
|
|
65
|
+
if (node.typeAnnotation.typeName.type !== AST_NODE_TYPES.Identifier) return None;
|
|
66
|
+
if (node.typeAnnotation.typeName.name !== "const") return None;
|
|
67
|
+
return Some(node.expression);
|
|
68
|
+
}
|
|
69
|
+
//#endregion
|
|
70
|
+
export { inner_as_const_default as default };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { WyrmPluginDocs } from "../utils/createRule.mjs";
|
|
2
|
+
import { ESLintUtils } from "@typescript-eslint/utils";
|
|
3
|
+
|
|
4
|
+
//#region lib/rules/jsx-tostring.d.ts
|
|
5
|
+
declare const _default: ESLintUtils.RuleModule<"noToString", [], WyrmPluginDocs, ESLintUtils.RuleListener> & {
|
|
6
|
+
name: string;
|
|
7
|
+
};
|
|
8
|
+
//#endregion
|
|
9
|
+
export { _default };
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import { createRule } from "../utils/createRule.mjs";
|
|
2
|
+
import { None, Some, getFirstOption } from "../utils/option.mjs";
|
|
3
|
+
import path from "node:path";
|
|
4
|
+
import { AST_NODE_TYPES, ESLintUtils } from "@typescript-eslint/utils";
|
|
5
|
+
//#region lib/rules/jsx-tostring.ts
|
|
6
|
+
const { name } = path.parse(import.meta.filename);
|
|
7
|
+
var jsx_tostring_default = createRule({
|
|
8
|
+
name,
|
|
9
|
+
meta: {
|
|
10
|
+
type: "suggestion",
|
|
11
|
+
docs: {
|
|
12
|
+
description: "Forbid calling `.toString()` inside JSX expressions containers",
|
|
13
|
+
strict: true,
|
|
14
|
+
requiresTypeChecking: true
|
|
15
|
+
},
|
|
16
|
+
fixable: "code",
|
|
17
|
+
schema: [],
|
|
18
|
+
messages: { noToString: "Calling `.toString()` is unnecessary here" }
|
|
19
|
+
},
|
|
20
|
+
defaultOptions: [],
|
|
21
|
+
create(context) {
|
|
22
|
+
let services;
|
|
23
|
+
function getServices() {
|
|
24
|
+
services ??= ESLintUtils.getParserServices(context);
|
|
25
|
+
return services;
|
|
26
|
+
}
|
|
27
|
+
let checker;
|
|
28
|
+
function getChecker() {
|
|
29
|
+
checker ??= getServices().program.getTypeChecker();
|
|
30
|
+
return checker;
|
|
31
|
+
}
|
|
32
|
+
return { JSXExpressionContainer(node) {
|
|
33
|
+
checkJsxExpression(node);
|
|
34
|
+
} };
|
|
35
|
+
function checkJsxExpression(container) {
|
|
36
|
+
const { expression } = container;
|
|
37
|
+
if (expression.type === AST_NODE_TYPES.JSXEmptyExpression) return;
|
|
38
|
+
const maybeObj = getToString(expression);
|
|
39
|
+
if (!maybeObj.some) return;
|
|
40
|
+
const obj = maybeObj.value;
|
|
41
|
+
const objType = getServices().getTypeAtLocation(obj);
|
|
42
|
+
const { parent } = container;
|
|
43
|
+
if (parent.type === AST_NODE_TYPES.JSXFragment) {
|
|
44
|
+
context.report({
|
|
45
|
+
node: expression,
|
|
46
|
+
messageId: "noToString",
|
|
47
|
+
fix(fixer) {
|
|
48
|
+
const txt = context.sourceCode.getText(obj);
|
|
49
|
+
return fixer.replaceText(expression, txt);
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
if (parent.type !== AST_NODE_TYPES.JSXElement) return;
|
|
55
|
+
const { openingElement } = parent;
|
|
56
|
+
if (openingElement.name.type === AST_NODE_TYPES.JSXIdentifier && /^[a-z]/u.test(openingElement.name.name)) {
|
|
57
|
+
context.report({
|
|
58
|
+
node: expression,
|
|
59
|
+
messageId: "noToString",
|
|
60
|
+
fix(fixer) {
|
|
61
|
+
const txt = context.sourceCode.getText(obj);
|
|
62
|
+
return fixer.replaceText(expression, txt);
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
const maybeChildrenType = getChildrenPropTypeFromComponentType(getServices().getTypeAtLocation(openingElement.name));
|
|
68
|
+
if (!maybeChildrenType.some) return;
|
|
69
|
+
const childrenType = maybeChildrenType.value;
|
|
70
|
+
if (!isAssignableTo(objType, childrenType)) return;
|
|
71
|
+
context.report({
|
|
72
|
+
node: expression,
|
|
73
|
+
messageId: "noToString",
|
|
74
|
+
fix(fixer) {
|
|
75
|
+
const txt = context.sourceCode.getText(obj);
|
|
76
|
+
return fixer.replaceText(expression, txt);
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
function getChildrenPropTypeFromComponentType(type) {
|
|
81
|
+
return getFirstOption([getChildrenTypeFromSignatures(type.getCallSignatures()), getChildrenTypeFromSignatures(type.getConstructSignatures())]);
|
|
82
|
+
}
|
|
83
|
+
function getChildrenTypeFromSignatures(signatures) {
|
|
84
|
+
for (const signature of signatures) {
|
|
85
|
+
const maybeChildrenType = getChildrenTypeFromSignature(signature);
|
|
86
|
+
if (!maybeChildrenType.some) continue;
|
|
87
|
+
return maybeChildrenType;
|
|
88
|
+
}
|
|
89
|
+
return None;
|
|
90
|
+
}
|
|
91
|
+
function getChildrenTypeFromSignature(signature) {
|
|
92
|
+
const [param] = signature.getParameters();
|
|
93
|
+
if (!param) return None;
|
|
94
|
+
const paramType = getValueTypeFromSymbol(param);
|
|
95
|
+
/* v8 ignore if -- @preserve */
|
|
96
|
+
if (!paramType) return None;
|
|
97
|
+
const childrenProp = paramType.getProperty("children");
|
|
98
|
+
if (!childrenProp) return None;
|
|
99
|
+
const childrenType = getValueTypeFromSymbol(childrenProp);
|
|
100
|
+
if (childrenType) return Some(childrenType);
|
|
101
|
+
return None;
|
|
102
|
+
}
|
|
103
|
+
function getValueTypeFromSymbol(symbol) {
|
|
104
|
+
if (!symbol.valueDeclaration) return null;
|
|
105
|
+
return getChecker().getTypeOfSymbolAtLocation(symbol, symbol.valueDeclaration);
|
|
106
|
+
}
|
|
107
|
+
function isAssignableTo(source, target) {
|
|
108
|
+
return getChecker().isTypeAssignableTo(source, getChecker().getWidenedType(target));
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
});
|
|
112
|
+
function getToString(expr) {
|
|
113
|
+
if (expr.type !== AST_NODE_TYPES.CallExpression) return None;
|
|
114
|
+
if (expr.callee.type !== AST_NODE_TYPES.MemberExpression) return None;
|
|
115
|
+
if (expr.callee.property.type !== AST_NODE_TYPES.Identifier) return None;
|
|
116
|
+
if (expr.callee.property.name !== "toString") return None;
|
|
117
|
+
return Some(expr.callee.object);
|
|
118
|
+
}
|
|
119
|
+
//#endregion
|
|
120
|
+
export { jsx_tostring_default as default };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { WyrmPluginDocs } from "../utils/createRule.mjs";
|
|
2
|
+
import * as _$_typescript_eslint_utils_ts_eslint0 from "@typescript-eslint/utils/ts-eslint";
|
|
3
|
+
|
|
4
|
+
//#region lib/rules/literal-destructuring.d.ts
|
|
5
|
+
declare const _default: _$_typescript_eslint_utils_ts_eslint0.RuleModule<"uselessSpreadElement" | "uselessSpreadProperty" | "usePlainDeclaration", [], WyrmPluginDocs, _$_typescript_eslint_utils_ts_eslint0.RuleListener> & {
|
|
6
|
+
name: string;
|
|
7
|
+
};
|
|
8
|
+
//#endregion
|
|
9
|
+
export { _default };
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { createRule } from "../utils/createRule.mjs";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { AST_NODE_TYPES, AST_TOKEN_TYPES } from "@typescript-eslint/utils";
|
|
4
|
+
//#region lib/rules/literal-destructuring.ts
|
|
5
|
+
const { name } = path.parse(import.meta.filename);
|
|
6
|
+
var literal_destructuring_default = createRule({
|
|
7
|
+
name,
|
|
8
|
+
meta: {
|
|
9
|
+
type: "suggestion",
|
|
10
|
+
docs: {
|
|
11
|
+
description: "Forbid variable declaration by destructuring object or array literals",
|
|
12
|
+
strict: true
|
|
13
|
+
},
|
|
14
|
+
fixable: "code",
|
|
15
|
+
schema: [],
|
|
16
|
+
messages: {
|
|
17
|
+
uselessSpreadElement: "Remove this spread element from the array literal, it is most likely useless since its value is never read.",
|
|
18
|
+
uselessSpreadProperty: "Remove this spread property from the object literal, it is most likely useless since its value is never read.",
|
|
19
|
+
usePlainDeclaration: "Use a plain variable declaration instead of destructuring a literal"
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
defaultOptions: [],
|
|
23
|
+
create(context) {
|
|
24
|
+
return { VariableDeclarator(node) {
|
|
25
|
+
if (!node.init) return;
|
|
26
|
+
if (node.id.type === AST_NODE_TYPES.ArrayPattern && node.init.type === AST_NODE_TYPES.ArrayExpression) {
|
|
27
|
+
checkArrayDecl(node, node.id, node.init);
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
if (node.id.type === AST_NODE_TYPES.ObjectPattern && node.init.type === AST_NODE_TYPES.ObjectExpression) checkObjectDecl(node, node.id, node.init);
|
|
31
|
+
} };
|
|
32
|
+
function checkArrayDecl(decl, id, init) {
|
|
33
|
+
const spreadElement = init.elements.find((elt) => elt?.type === AST_NODE_TYPES.SpreadElement);
|
|
34
|
+
if (spreadElement) {
|
|
35
|
+
const idx = init.elements.indexOf(spreadElement);
|
|
36
|
+
if (idx >= id.elements.length) context.report({
|
|
37
|
+
node: spreadElement,
|
|
38
|
+
messageId: "uselessSpreadElement",
|
|
39
|
+
*fix(fixer) {
|
|
40
|
+
yield fixer.remove(spreadElement);
|
|
41
|
+
const commaToken = context.sourceCode.getTokenAfter(spreadElement);
|
|
42
|
+
if (idx === 0 && commaToken?.type === AST_TOKEN_TYPES.Punctuator && commaToken.value === ",") yield fixer.remove(commaToken);
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
if (!id.elements.every((elt) => elt?.type === AST_NODE_TYPES.Identifier)) return;
|
|
48
|
+
if (!init.elements.every((elt) => elt?.type !== AST_NODE_TYPES.SpreadElement)) return;
|
|
49
|
+
const entries = id.elements.map((ident, i) => [ident.name, init.elements.filter((elt) => elt?.type !== AST_NODE_TYPES.SpreadElement).at(i)]);
|
|
50
|
+
context.report({
|
|
51
|
+
node: decl,
|
|
52
|
+
messageId: "usePlainDeclaration",
|
|
53
|
+
fix(fixer) {
|
|
54
|
+
const txt = entries.map(([key, value]) => {
|
|
55
|
+
return `${key} = ${value ? context.sourceCode.getText(value) : "undefined"}`;
|
|
56
|
+
}).join(", ");
|
|
57
|
+
return fixer.replaceText(decl, txt);
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
function checkObjectDecl(decl, id, init) {
|
|
62
|
+
if (!id.properties.every((prop) => prop.type === AST_NODE_TYPES.Property)) return;
|
|
63
|
+
if (id.properties.some((prop) => prop.computed)) return;
|
|
64
|
+
const patternKeys = id.properties.map((prop) => prop.key);
|
|
65
|
+
if (!patternKeys.every((key) => key.type === AST_NODE_TYPES.Identifier)) return;
|
|
66
|
+
const patternNames = patternKeys.map((key) => key.name);
|
|
67
|
+
for (const initProp of init.properties) {
|
|
68
|
+
if (initProp.type === AST_NODE_TYPES.Property) {
|
|
69
|
+
if (initProp.computed) return;
|
|
70
|
+
continue;
|
|
71
|
+
}
|
|
72
|
+
const idx = init.properties.indexOf(initProp);
|
|
73
|
+
const subsequentPropertyNames = new Set(init.properties.slice(idx).filter((prop) => prop.type === AST_NODE_TYPES.Property).map((prop) => prop.key).filter((key) => key.type === AST_NODE_TYPES.Identifier).map((key) => key.name));
|
|
74
|
+
if (patternNames.every((patternName) => subsequentPropertyNames.has(patternName))) context.report({
|
|
75
|
+
node: initProp,
|
|
76
|
+
messageId: "uselessSpreadProperty",
|
|
77
|
+
*fix(fixer) {
|
|
78
|
+
yield fixer.remove(initProp);
|
|
79
|
+
const commaToken = context.sourceCode.getTokenAfter(initProp);
|
|
80
|
+
if (idx === 0 && commaToken?.type === AST_TOKEN_TYPES.Punctuator && commaToken.value === ",") yield fixer.remove(commaToken);
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
const initMap = new Map(init.properties.filter((prop) => prop.type === AST_NODE_TYPES.Property).map((prop) => [prop.key, prop.value]).filter((entry) => entry[0].type === AST_NODE_TYPES.Identifier).map(([key, value]) => [key.name, value]));
|
|
86
|
+
const entries = patternNames.map((patternName) => [patternName, initMap.get(patternName)]);
|
|
87
|
+
if (!entries.every((entry) => entry[1] !== void 0)) return;
|
|
88
|
+
context.report({
|
|
89
|
+
node: decl,
|
|
90
|
+
messageId: "usePlainDeclaration",
|
|
91
|
+
fix(fixer) {
|
|
92
|
+
const txt = entries.map(([key, value]) => {
|
|
93
|
+
return `${key} = ${context.sourceCode.getText(value)}`;
|
|
94
|
+
}).join(", ");
|
|
95
|
+
return fixer.replaceText(decl, txt);
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
});
|
|
101
|
+
//#endregion
|
|
102
|
+
export { literal_destructuring_default as default };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { WyrmPluginDocs } from "../utils/createRule.mjs";
|
|
2
|
-
import * as _typescript_eslint_utils_ts_eslint0 from "@typescript-eslint/utils/ts-eslint";
|
|
2
|
+
import * as _$_typescript_eslint_utils_ts_eslint0 from "@typescript-eslint/utils/ts-eslint";
|
|
3
3
|
|
|
4
4
|
//#region lib/rules/named-export-with-side-effects.d.ts
|
|
5
|
-
declare const _default: _typescript_eslint_utils_ts_eslint0.RuleModule<"namedExportWithSideEffects", [{
|
|
5
|
+
declare const _default: _$_typescript_eslint_utils_ts_eslint0.RuleModule<"namedExportWithSideEffects", [{
|
|
6
6
|
strict: boolean;
|
|
7
|
-
}], WyrmPluginDocs, _typescript_eslint_utils_ts_eslint0.RuleListener> & {
|
|
7
|
+
}], WyrmPluginDocs, _$_typescript_eslint_utils_ts_eslint0.RuleListener> & {
|
|
8
8
|
name: string;
|
|
9
9
|
};
|
|
10
10
|
//#endregion
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { createRule } from "../utils/createRule.mjs";
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import { AST_NODE_TYPES } from "@typescript-eslint/utils";
|
|
4
|
-
|
|
5
4
|
//#region lib/rules/named-export-with-side-effects.ts
|
|
6
5
|
const { name } = path.parse(import.meta.filename);
|
|
7
6
|
const DEFAULT_STRICT = false;
|
|
@@ -69,6 +68,5 @@ function isSideEffect(stmt, strict) {
|
|
|
69
68
|
default: return false;
|
|
70
69
|
}
|
|
71
70
|
}
|
|
72
|
-
|
|
73
71
|
//#endregion
|
|
74
|
-
export { named_export_with_side_effects_default as default };
|
|
72
|
+
export { named_export_with_side_effects_default as default };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { WyrmPluginDocs } from "../utils/createRule.mjs";
|
|
2
|
+
import * as _$_typescript_eslint_utils_ts_eslint0 from "@typescript-eslint/utils/ts-eslint";
|
|
3
|
+
|
|
4
|
+
//#region lib/rules/nested-reduce.d.ts
|
|
5
|
+
declare const _default: _$_typescript_eslint_utils_ts_eslint0.RuleModule<"noNestedReduce", [], WyrmPluginDocs, _$_typescript_eslint_utils_ts_eslint0.RuleListener> & {
|
|
6
|
+
name: string;
|
|
7
|
+
};
|
|
8
|
+
//#endregion
|
|
9
|
+
export { _default };
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { createRule } from "../utils/createRule.mjs";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { AST_NODE_TYPES } from "@typescript-eslint/utils";
|
|
4
|
+
//#region lib/rules/nested-reduce.ts
|
|
5
|
+
const { name } = path.parse(import.meta.filename);
|
|
6
|
+
var nested_reduce_default = createRule({
|
|
7
|
+
name,
|
|
8
|
+
meta: {
|
|
9
|
+
type: "suggestion",
|
|
10
|
+
docs: {
|
|
11
|
+
description: "Forbid nested `reduce` calls",
|
|
12
|
+
strict: true
|
|
13
|
+
},
|
|
14
|
+
schema: [],
|
|
15
|
+
messages: { noNestedReduce: "Refactor to avoid nesting `reduce` calls." }
|
|
16
|
+
},
|
|
17
|
+
defaultOptions: [],
|
|
18
|
+
create(context) {
|
|
19
|
+
return { CallExpression(node) {
|
|
20
|
+
if (!isReduceCall(node)) return;
|
|
21
|
+
if (!isInsideReduceCall(node)) return;
|
|
22
|
+
context.report({
|
|
23
|
+
node: node.callee,
|
|
24
|
+
messageId: "noNestedReduce"
|
|
25
|
+
});
|
|
26
|
+
} };
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
function isReduceCall(expr) {
|
|
30
|
+
if (expr.callee.type !== AST_NODE_TYPES.MemberExpression) return false;
|
|
31
|
+
if (expr.callee.property.type !== AST_NODE_TYPES.Identifier) return false;
|
|
32
|
+
return expr.callee.property.name === "reduce";
|
|
33
|
+
}
|
|
34
|
+
function isInsideReduceCall(node) {
|
|
35
|
+
if (!node.parent) return false;
|
|
36
|
+
switch (node.parent.type) {
|
|
37
|
+
case AST_NODE_TYPES.FunctionDeclaration: return false;
|
|
38
|
+
case AST_NODE_TYPES.CallExpression:
|
|
39
|
+
if (isReduceCall(node.parent)) return true;
|
|
40
|
+
break;
|
|
41
|
+
default: break;
|
|
42
|
+
}
|
|
43
|
+
return isInsideReduceCall(node.parent);
|
|
44
|
+
}
|
|
45
|
+
//#endregion
|
|
46
|
+
export { nested_reduce_default as default };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { WyrmPluginDocs } from "../utils/createRule.mjs";
|
|
2
|
+
import * as _$_typescript_eslint_utils_ts_eslint0 from "@typescript-eslint/utils/ts-eslint";
|
|
3
|
+
|
|
4
|
+
//#region lib/rules/nested-try-catch.d.ts
|
|
5
|
+
declare const _default: _$_typescript_eslint_utils_ts_eslint0.RuleModule<"noNestedTryCatch", [], WyrmPluginDocs, _$_typescript_eslint_utils_ts_eslint0.RuleListener> & {
|
|
6
|
+
name: string;
|
|
7
|
+
};
|
|
8
|
+
//#endregion
|
|
9
|
+
export { _default };
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { createRule } from "../utils/createRule.mjs";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { AST_NODE_TYPES } from "@typescript-eslint/utils";
|
|
4
|
+
//#region lib/rules/nested-try-catch.ts
|
|
5
|
+
const { name } = path.parse(import.meta.filename);
|
|
6
|
+
var nested_try_catch_default = createRule({
|
|
7
|
+
name,
|
|
8
|
+
meta: {
|
|
9
|
+
type: "suggestion",
|
|
10
|
+
docs: {
|
|
11
|
+
description: "Forbid nested try/catch statements",
|
|
12
|
+
strict: true
|
|
13
|
+
},
|
|
14
|
+
schema: [],
|
|
15
|
+
messages: { noNestedTryCatch: "Refactor to avoid nesting try/catch statements." }
|
|
16
|
+
},
|
|
17
|
+
defaultOptions: [],
|
|
18
|
+
create(context) {
|
|
19
|
+
return { TryStatement(node) {
|
|
20
|
+
if (node.parent.type !== AST_NODE_TYPES.BlockStatement) return;
|
|
21
|
+
switch (node.parent.parent.type) {
|
|
22
|
+
case AST_NODE_TYPES.TryStatement:
|
|
23
|
+
case AST_NODE_TYPES.CatchClause: {
|
|
24
|
+
const token = context.sourceCode.getFirstToken(node);
|
|
25
|
+
context.report({
|
|
26
|
+
node: token ?? node,
|
|
27
|
+
messageId: "noNestedTryCatch"
|
|
28
|
+
});
|
|
29
|
+
break;
|
|
30
|
+
}
|
|
31
|
+
default: break;
|
|
32
|
+
}
|
|
33
|
+
} };
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
//#endregion
|
|
37
|
+
export { nested_try_catch_default as default };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { WyrmPluginDocs } from "../utils/createRule.mjs";
|
|
2
|
-
import * as _typescript_eslint_utils_ts_eslint0 from "@typescript-eslint/utils/ts-eslint";
|
|
2
|
+
import * as _$_typescript_eslint_utils_ts_eslint0 from "@typescript-eslint/utils/ts-eslint";
|
|
3
3
|
|
|
4
4
|
//#region lib/rules/no-commented-out-comment.d.ts
|
|
5
|
-
declare const _default: _typescript_eslint_utils_ts_eslint0.RuleModule<"commentedOutComment", [], WyrmPluginDocs, _typescript_eslint_utils_ts_eslint0.RuleListener> & {
|
|
5
|
+
declare const _default: _$_typescript_eslint_utils_ts_eslint0.RuleModule<"commentedOutComment", [], WyrmPluginDocs, _$_typescript_eslint_utils_ts_eslint0.RuleListener> & {
|
|
6
6
|
name: string;
|
|
7
7
|
};
|
|
8
8
|
//#endregion
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { createRule } from "../utils/createRule.mjs";
|
|
2
2
|
import path from "node:path";
|
|
3
|
-
|
|
4
3
|
//#region lib/rules/no-commented-out-comment.ts
|
|
5
4
|
const { name } = path.parse(import.meta.filename);
|
|
6
5
|
var no_commented_out_comment_default = createRule({
|
|
@@ -28,6 +27,5 @@ var no_commented_out_comment_default = createRule({
|
|
|
28
27
|
}
|
|
29
28
|
}
|
|
30
29
|
});
|
|
31
|
-
|
|
32
30
|
//#endregion
|
|
33
|
-
export { no_commented_out_comment_default as default };
|
|
31
|
+
export { no_commented_out_comment_default as default };
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { createRule } from "../utils/createRule.mjs";
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import { ASTUtils, AST_NODE_TYPES, ESLintUtils, TSESLint } from "@typescript-eslint/utils";
|
|
4
|
-
import * as ts from "typescript";
|
|
5
|
-
|
|
4
|
+
import * as ts$1 from "typescript";
|
|
6
5
|
//#region lib/rules/no-constant-template-expression.ts
|
|
7
6
|
/**
|
|
8
7
|
* @fileoverview
|
|
@@ -56,6 +55,7 @@ var no_constant_template_expression_default = createRule({
|
|
|
56
55
|
const def = defs.at(-1);
|
|
57
56
|
if (def?.parent?.type === AST_NODE_TYPES.VariableDeclaration && def.parent.parent.type === AST_NODE_TYPES.ExportNamedDeclaration) return;
|
|
58
57
|
if (def?.type !== TSESLint.Scope.DefinitionType.Variable) return;
|
|
58
|
+
if (isNonAlphabeticStringLiteral(def.node)) return;
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
61
|
const services = ESLintUtils.getParserServices(context);
|
|
@@ -64,7 +64,7 @@ var no_constant_template_expression_default = createRule({
|
|
|
64
64
|
if (value === null) return;
|
|
65
65
|
if (value.length >= options.minAllowedLength) return;
|
|
66
66
|
const sym = services.getSymbolAtLocation(expr);
|
|
67
|
-
if (sym && sym.getFlags() & ts.SymbolFlags.EnumMember && !quasis.some((quasi) => quasi.value.cooked)) return;
|
|
67
|
+
if (sym && sym.getFlags() & ts$1.SymbolFlags.EnumMember && !quasis.some((quasi) => quasi.value.cooked)) return;
|
|
68
68
|
context.report({
|
|
69
69
|
node: expr,
|
|
70
70
|
messageId: "noConstantTemplateExpression",
|
|
@@ -91,7 +91,8 @@ var no_constant_template_expression_default = createRule({
|
|
|
91
91
|
}
|
|
92
92
|
return { TemplateLiteral(node) {
|
|
93
93
|
const { expressions, quasis } = node;
|
|
94
|
-
if (quasis.some((quasi) => quasi.value.cooked
|
|
94
|
+
if (quasis.some((quasi) => quasi.value.cooked?.includes(" "))) return;
|
|
95
|
+
if (node.parent.type === AST_NODE_TYPES.TaggedTemplateExpression) return;
|
|
95
96
|
const scope = context.sourceCode.getScope(node);
|
|
96
97
|
for (const expr of expressions) checkExpression(expr, quasis, scope);
|
|
97
98
|
} };
|
|
@@ -103,6 +104,8 @@ function getLiteralValue(type, checker) {
|
|
|
103
104
|
if (type === checker.getFalseType()) return "false";
|
|
104
105
|
return null;
|
|
105
106
|
}
|
|
106
|
-
|
|
107
|
+
function isNonAlphabeticStringLiteral(node) {
|
|
108
|
+
return node.init?.type === AST_NODE_TYPES.Literal && typeof node.init.value === "string" && /[^a-zA-Z]/u.test(node.init.value);
|
|
109
|
+
}
|
|
107
110
|
//#endregion
|
|
108
|
-
export { no_constant_template_expression_default as default };
|
|
111
|
+
export { no_constant_template_expression_default as default };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { WyrmPluginDocs } from "../utils/createRule.mjs";
|
|
2
|
-
import * as _typescript_eslint_utils_ts_eslint0 from "@typescript-eslint/utils/ts-eslint";
|
|
2
|
+
import * as _$_typescript_eslint_utils_ts_eslint0 from "@typescript-eslint/utils/ts-eslint";
|
|
3
3
|
|
|
4
4
|
//#region lib/rules/no-constructed-error-cause.d.ts
|
|
5
|
-
declare const _default: _typescript_eslint_utils_ts_eslint0.RuleModule<"noConstructedErrorCause", [], WyrmPluginDocs, _typescript_eslint_utils_ts_eslint0.RuleListener> & {
|
|
5
|
+
declare const _default: _$_typescript_eslint_utils_ts_eslint0.RuleModule<"noConstructedErrorCause", [], WyrmPluginDocs, _$_typescript_eslint_utils_ts_eslint0.RuleListener> & {
|
|
6
6
|
name: string;
|
|
7
7
|
};
|
|
8
8
|
//#endregion
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { createRule } from "../utils/createRule.mjs";
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import { AST_NODE_TYPES } from "@typescript-eslint/utils";
|
|
4
|
-
|
|
5
4
|
//#region lib/rules/no-constructed-error-cause.ts
|
|
6
5
|
/**
|
|
7
6
|
* @fileoverview
|
|
@@ -72,6 +71,5 @@ var no_constructed_error_cause_default = createRule({
|
|
|
72
71
|
}
|
|
73
72
|
}
|
|
74
73
|
});
|
|
75
|
-
|
|
76
74
|
//#endregion
|
|
77
|
-
export { no_constructed_error_cause_default as default };
|
|
75
|
+
export { no_constructed_error_cause_default as default };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { WyrmPluginDocs } from "../utils/createRule.mjs";
|
|
2
|
+
import { ESLintUtils } from "@typescript-eslint/utils";
|
|
3
|
+
|
|
4
|
+
//#region lib/rules/no-convoluted-boolean-expressions.d.ts
|
|
5
|
+
declare const _default: ESLintUtils.RuleModule<"noConvolutedLogicalExpression", [], WyrmPluginDocs, ESLintUtils.RuleListener> & {
|
|
6
|
+
name: string;
|
|
7
|
+
};
|
|
8
|
+
//#endregion
|
|
9
|
+
export { _default };
|