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.
Files changed (223) hide show
  1. package/CHANGELOG.md +53 -0
  2. package/README.md +114 -78
  3. package/bin/wyrm.mjs +3 -0
  4. package/dist/_virtual/_rolldown/runtime.mjs +7 -13
  5. package/dist/cli.d.mts +1 -0
  6. package/dist/cli.mjs +23 -0
  7. package/dist/configs/index.mjs +1 -3
  8. package/dist/index.mjs +1 -3
  9. package/dist/plugin.mjs +1 -3
  10. package/dist/rules/array-from-array.d.mts +9 -0
  11. package/dist/rules/array-from-array.mjs +56 -0
  12. package/dist/rules/as-unknown-as.d.mts +9 -0
  13. package/dist/rules/as-unknown-as.mjs +30 -0
  14. package/dist/rules/await-promise-resolve.d.mts +9 -0
  15. package/dist/rules/await-promise-resolve.mjs +41 -0
  16. package/dist/rules/boolean-coalescing.d.mts +9 -0
  17. package/dist/rules/boolean-coalescing.mjs +141 -0
  18. package/dist/rules/comment-duplicate-leading-space.d.mts +9 -0
  19. package/dist/rules/comment-duplicate-leading-space.mjs +34 -0
  20. package/dist/rules/conditional-boolean.d.mts +9 -0
  21. package/dist/rules/conditional-boolean.mjs +70 -0
  22. package/dist/rules/constant-boolean-cast.d.mts +9 -0
  23. package/dist/rules/constant-boolean-cast.mjs +203 -0
  24. package/dist/rules/de-morgan.d.mts +2 -2
  25. package/dist/rules/de-morgan.mjs +1 -3
  26. package/dist/rules/discarded-expression-statement.d.mts +14 -0
  27. package/dist/rules/discarded-expression-statement.mjs +243 -0
  28. package/dist/rules/distribute-boolean-casts.d.mts +2 -2
  29. package/dist/rules/distribute-boolean-casts.mjs +3 -3
  30. package/dist/rules/duplicate-destructuring.d.mts +2 -2
  31. package/dist/rules/duplicate-destructuring.mjs +1 -3
  32. package/dist/rules/duplicate-object-spread.d.mts +9 -0
  33. package/dist/rules/duplicate-object-spread.mjs +44 -0
  34. package/dist/rules/e.d.mts +3 -3
  35. package/dist/rules/e.mjs +4 -3
  36. package/dist/rules/empty-for.d.mts +9 -0
  37. package/dist/rules/empty-for.mjs +34 -0
  38. package/dist/rules/enum-member.d.mts +9 -0
  39. package/dist/rules/enum-member.mjs +51 -0
  40. package/dist/rules/eqeq-null.d.mts +9 -0
  41. package/dist/rules/eqeq-null.mjs +101 -0
  42. package/dist/rules/exact-string-regex.d.mts +2 -2
  43. package/dist/rules/exact-string-regex.mjs +1 -3
  44. package/dist/rules/export-using.mjs +1 -3
  45. package/dist/rules/generic-constructor-with-hook.d.mts +3 -3
  46. package/dist/rules/generic-constructor-with-hook.mjs +1 -3
  47. package/dist/rules/idiomatic-cast.mjs +6 -8
  48. package/dist/rules/index.d.mts +112 -77
  49. package/dist/rules/index.mjs +71 -3
  50. package/dist/rules/inferable-type-predicate.d.mts +9 -0
  51. package/dist/rules/inferable-type-predicate.mjs +100 -0
  52. package/dist/rules/inner-as-const.d.mts +9 -0
  53. package/dist/rules/inner-as-const.mjs +70 -0
  54. package/dist/rules/jsx-tostring.d.mts +9 -0
  55. package/dist/rules/jsx-tostring.mjs +120 -0
  56. package/dist/rules/literal-destructuring.d.mts +9 -0
  57. package/dist/rules/literal-destructuring.mjs +102 -0
  58. package/dist/rules/named-export-with-side-effects.d.mts +3 -3
  59. package/dist/rules/named-export-with-side-effects.mjs +1 -3
  60. package/dist/rules/nested-reduce.d.mts +9 -0
  61. package/dist/rules/nested-reduce.mjs +46 -0
  62. package/dist/rules/nested-try-catch.d.mts +9 -0
  63. package/dist/rules/nested-try-catch.mjs +37 -0
  64. package/dist/rules/no-commented-out-comment.d.mts +2 -2
  65. package/dist/rules/no-commented-out-comment.mjs +1 -3
  66. package/dist/rules/no-constant-template-expression.mjs +9 -6
  67. package/dist/rules/no-constructed-error-cause.d.mts +2 -2
  68. package/dist/rules/no-constructed-error-cause.mjs +1 -3
  69. package/dist/rules/no-convoluted-boolean-expressions.d.mts +9 -0
  70. package/dist/rules/no-convoluted-boolean-expressions.mjs +130 -0
  71. package/dist/rules/no-convoluted-logical-expressions.d.mts +2 -2
  72. package/dist/rules/no-convoluted-logical-expressions.mjs +1 -3
  73. package/dist/rules/no-custom-url-parsing.d.mts +2 -2
  74. package/dist/rules/no-custom-url-parsing.mjs +1 -3
  75. package/dist/rules/no-disallowed-warning-comments.d.mts +2 -2
  76. package/dist/rules/no-disallowed-warning-comments.mjs +1 -3
  77. package/dist/rules/no-duplicated-return.d.mts +2 -2
  78. package/dist/rules/no-duplicated-return.mjs +1 -3
  79. package/dist/rules/no-else-break.d.mts +2 -2
  80. package/dist/rules/no-else-break.mjs +1 -3
  81. package/dist/rules/no-else-continue.d.mts +2 -2
  82. package/dist/rules/no-else-continue.mjs +1 -3
  83. package/dist/rules/no-else-never.d.mts +9 -0
  84. package/dist/rules/no-else-never.mjs +75 -0
  85. package/dist/rules/no-else-return.d.mts +2 -2
  86. package/dist/rules/no-else-return.mjs +1 -3
  87. package/dist/rules/no-else-throw.d.mts +2 -2
  88. package/dist/rules/no-else-throw.mjs +1 -3
  89. package/dist/rules/no-empty-attribute.d.mts +3 -3
  90. package/dist/rules/no-empty-attribute.mjs +1 -3
  91. package/dist/rules/no-empty-comment.d.mts +3 -3
  92. package/dist/rules/no-empty-comment.mjs +1 -3
  93. package/dist/rules/no-empty-jsx-expression.d.mts +2 -2
  94. package/dist/rules/no-empty-jsx-expression.mjs +1 -3
  95. package/dist/rules/no-empty-literal-iteration.d.mts +2 -2
  96. package/dist/rules/no-empty-literal-iteration.mjs +1 -3
  97. package/dist/rules/no-extra-false-fallback.d.mts +2 -2
  98. package/dist/rules/no-extra-false-fallback.mjs +1 -3
  99. package/dist/rules/no-extra-nested-boolean-cast.d.mts +2 -2
  100. package/dist/rules/no-extra-nested-boolean-cast.mjs +2 -3
  101. package/dist/rules/no-first-last.d.mts +2 -2
  102. package/dist/rules/no-first-last.mjs +2 -4
  103. package/dist/rules/no-float-length-check.d.mts +2 -2
  104. package/dist/rules/no-float-length-check.mjs +1 -3
  105. package/dist/rules/no-huge-try-block.d.mts +3 -3
  106. package/dist/rules/no-huge-try-block.mjs +1 -3
  107. package/dist/rules/no-huge-useeffect.d.mts +3 -3
  108. package/dist/rules/no-huge-useeffect.mjs +1 -3
  109. package/dist/rules/no-if-length-for.d.mts +2 -2
  110. package/dist/rules/no-if-length-for.mjs +1 -3
  111. package/dist/rules/no-inline-jsdoc-tag.d.mts +3 -3
  112. package/dist/rules/no-inline-jsdoc-tag.mjs +1 -3
  113. package/dist/rules/no-invalid-date-literal.d.mts +2 -2
  114. package/dist/rules/no-invalid-date-literal.mjs +1 -3
  115. package/dist/rules/no-jsx-statement.d.mts +2 -2
  116. package/dist/rules/no-jsx-statement.mjs +1 -3
  117. package/dist/rules/no-lax-array-type.mjs +7 -9
  118. package/dist/rules/no-lax-return-type.mjs +7 -8
  119. package/dist/rules/no-mutable-literal-fill.d.mts +2 -2
  120. package/dist/rules/no-mutable-literal-fill.mjs +1 -3
  121. package/dist/rules/no-nullish-ternary.d.mts +9 -0
  122. package/dist/rules/no-nullish-ternary.mjs +121 -0
  123. package/dist/rules/no-numbered-comments.d.mts +2 -2
  124. package/dist/rules/no-numbered-comments.mjs +1 -3
  125. package/dist/rules/no-obvious-any.mjs +9 -12
  126. package/dist/rules/no-optional-type-guard-param.d.mts +2 -2
  127. package/dist/rules/no-optional-type-guard-param.mjs +1 -3
  128. package/dist/rules/no-out-of-order-comments.d.mts +2 -2
  129. package/dist/rules/no-out-of-order-comments.mjs +3 -8
  130. package/dist/rules/no-possibly-nullish-equality.mjs +6 -12
  131. package/dist/rules/no-redundant-function-declaration.d.mts +2 -2
  132. package/dist/rules/no-redundant-function-declaration.mjs +1 -3
  133. package/dist/rules/no-return-to-void.mjs +1 -3
  134. package/dist/rules/no-self-object-assign.d.mts +2 -2
  135. package/dist/rules/no-self-object-assign.mjs +1 -3
  136. package/dist/rules/no-sloppy-length-check.d.mts +2 -2
  137. package/dist/rules/no-sloppy-length-check.mjs +25 -27
  138. package/dist/rules/no-suspicious-jsx-semicolon.d.mts +2 -2
  139. package/dist/rules/no-suspicious-jsx-semicolon.mjs +2 -4
  140. package/dist/rules/no-ternary-return.d.mts +3 -3
  141. package/dist/rules/no-ternary-return.mjs +1 -3
  142. package/dist/rules/no-type-guard.d.mts +9 -0
  143. package/dist/rules/no-type-guard.mjs +36 -0
  144. package/dist/rules/no-unassigned-todo.d.mts +2 -2
  145. package/dist/rules/no-unassigned-todo.mjs +1 -3
  146. package/dist/rules/no-unbound-catch-error.d.mts +2 -2
  147. package/dist/rules/no-unbound-catch-error.mjs +1 -3
  148. package/dist/rules/no-unused-mutually-referential.mjs +10 -15
  149. package/dist/rules/no-unused-param-read.d.mts +2 -2
  150. package/dist/rules/no-unused-param-read.mjs +1 -3
  151. package/dist/rules/no-useless-computed-key.d.mts +2 -2
  152. package/dist/rules/no-useless-computed-key.mjs +1 -3
  153. package/dist/rules/no-useless-iife.d.mts +2 -2
  154. package/dist/rules/no-useless-iife.mjs +2 -3
  155. package/dist/rules/no-useless-logical-fallback.mjs +7 -12
  156. package/dist/rules/no-useless-return-undefined.mjs +1 -3
  157. package/dist/rules/no-useless-ts-check.d.mts +2 -2
  158. package/dist/rules/no-useless-ts-check.mjs +1 -3
  159. package/dist/rules/no-useless-use-strict.d.mts +2 -2
  160. package/dist/rules/no-useless-use-strict.mjs +1 -3
  161. package/dist/rules/no-useless-usememo.d.mts +2 -2
  162. package/dist/rules/no-useless-usememo.mjs +1 -3
  163. package/dist/rules/no-whitespace-property.d.mts +2 -2
  164. package/dist/rules/no-whitespace-property.mjs +1 -3
  165. package/dist/rules/nullish-object-spread.d.mts +2 -2
  166. package/dist/rules/nullish-object-spread.mjs +7 -6
  167. package/dist/rules/optional-call-expression.d.mts +2 -2
  168. package/dist/rules/optional-call-expression.mjs +1 -3
  169. package/dist/rules/prefer-array-from.d.mts +9 -0
  170. package/dist/rules/prefer-array-from.mjs +87 -0
  171. package/dist/rules/prefer-catch-method.d.mts +2 -2
  172. package/dist/rules/prefer-catch-method.mjs +2 -3
  173. package/dist/rules/prefer-early-return.d.mts +2 -2
  174. package/dist/rules/prefer-early-return.mjs +1 -3
  175. package/dist/rules/prefer-eqeq-null.d.mts +9 -0
  176. package/dist/rules/prefer-eqeq-null.mjs +122 -0
  177. package/dist/rules/prefer-finally.d.mts +2 -2
  178. package/dist/rules/prefer-finally.mjs +1 -3
  179. package/dist/rules/prefer-getorinsert.d.mts +2 -2
  180. package/dist/rules/prefer-getorinsert.mjs +1 -3
  181. package/dist/rules/prefer-has.d.mts +2 -2
  182. package/dist/rules/prefer-has.mjs +1 -3
  183. package/dist/rules/prefer-in.d.mts +9 -0
  184. package/dist/rules/prefer-in.mjs +81 -0
  185. package/dist/rules/prefer-object-keys-values.d.mts +2 -2
  186. package/dist/rules/prefer-object-keys-values.mjs +1 -3
  187. package/dist/rules/prefer-repeat.d.mts +2 -2
  188. package/dist/rules/prefer-repeat.mjs +1 -3
  189. package/dist/rules/prefer-satisfies.d.mts +9 -0
  190. package/dist/rules/prefer-satisfies.mjs +86 -0
  191. package/dist/rules/prefer-string-join.d.mts +9 -0
  192. package/dist/rules/prefer-string-join.mjs +67 -0
  193. package/dist/rules/primitive-valueof.mjs +6 -8
  194. package/dist/rules/slim-try.d.mts +2 -2
  195. package/dist/rules/slim-try.mjs +9 -11
  196. package/dist/rules/styled-button-has-type.d.mts +9 -0
  197. package/dist/rules/styled-button-has-type.mjs +82 -0
  198. package/dist/rules/styled-transient-props.d.mts +9 -0
  199. package/dist/rules/styled-transient-props.mjs +52 -0
  200. package/dist/rules/suspicious-map-length.d.mts +2 -2
  201. package/dist/rules/suspicious-map-length.mjs +1 -3
  202. package/dist/rules/template-tostring.d.mts +9 -0
  203. package/dist/rules/template-tostring.mjs +48 -0
  204. package/dist/rules/unsafe-asserted-chain.mjs +5 -7
  205. package/dist/rules/unused-object-assign.d.mts +2 -2
  206. package/dist/rules/unused-object-assign.mjs +1 -3
  207. package/dist/rules/unused-object-freeze.d.mts +9 -0
  208. package/dist/rules/unused-object-freeze.mjs +37 -0
  209. package/dist/rules/useless-as-const.d.mts +9 -0
  210. package/dist/rules/useless-as-const.mjs +59 -0
  211. package/dist/rules/useless-assign.d.mts +11 -0
  212. package/dist/rules/useless-assign.mjs +69 -0
  213. package/dist/rules/useless-conditional-assign.d.mts +9 -0
  214. package/dist/rules/useless-conditional-assign.mjs +58 -0
  215. package/dist/rules/useless-intermediary-variable.mjs +1 -3
  216. package/dist/rules/useless-mock.d.mts +9 -0
  217. package/dist/rules/useless-mock.mjs +180 -0
  218. package/dist/rules/useless-required.mjs +10 -12
  219. package/dist/utils/compareTokens.mjs +1 -3
  220. package/dist/utils/createRule.mjs +1 -3
  221. package/dist/utils/negateExpression.mjs +1 -3
  222. package/dist/utils/option.mjs +1 -2
  223. package/package.json +29 -23
@@ -1,8 +1,7 @@
1
1
  import { createRule } from "../utils/createRule.mjs";
2
2
  import path from "node:path";
3
3
  import { AST_NODE_TYPES, ESLintUtils } from "@typescript-eslint/utils";
4
- import * as ts from "typescript";
5
-
4
+ import * as ts$1 from "typescript";
6
5
  //#region lib/rules/no-possibly-nullish-equality.ts
7
6
  /**
8
7
  * @fileoverview
@@ -81,34 +80,29 @@ var no_possibly_nullish_equality_default = createRule({
81
80
  });
82
81
  function isPossiblyNullish(type) {
83
82
  if (type.isUnion() && type.types.some((t) => isPossiblyNullish(t))) return true;
84
- return (type.flags & (ts.TypeFlags.Undefined | ts.TypeFlags.Null)) !== 0;
83
+ return (type.flags & (ts$1.TypeFlags.Undefined | ts$1.TypeFlags.Null)) !== 0;
85
84
  }
86
85
  function nullishTypesIntersect(a, b) {
87
86
  if (isPossiblyNull(a) && !isPossiblyNull(b)) return false;
88
87
  if (isPossiblyUndefined(a) && !isPossiblyUndefined(b)) return false;
89
- /* v8 ignore if -- @preserve */
90
- if (!isPossiblyNull(a) && isPossiblyNull(b)) return false;
91
- /* v8 ignore if -- @preserve */
92
- if (!isPossiblyUndefined(a) && isPossiblyUndefined(b)) return false;
93
88
  return true;
94
89
  }
95
90
  function isPossiblyNull(type) {
96
91
  if (type.isUnion() && type.types.some((t) => isPossiblyNull(t))) return true;
97
- return (type.flags & ts.TypeFlags.Null) !== 0;
92
+ return (type.flags & ts$1.TypeFlags.Null) !== 0;
98
93
  }
99
94
  function isPossiblyUndefined(type) {
100
95
  if (type.isUnion() && type.types.some((t) => isPossiblyUndefined(t))) return true;
101
- return (type.flags & ts.TypeFlags.Undefined) !== 0;
96
+ return (type.flags & ts$1.TypeFlags.Undefined) !== 0;
102
97
  }
103
98
  function isConstantNullish(type) {
104
99
  if (type.isUnion() && type.types.every((t) => isConstantNullish(t))) return true;
105
- return (type.flags & (ts.TypeFlags.Undefined | ts.TypeFlags.Null)) !== 0;
100
+ return (type.flags & (ts$1.TypeFlags.Undefined | ts$1.TypeFlags.Null)) !== 0;
106
101
  }
107
102
  function isIdentifier(node) {
108
103
  if (node.type !== AST_NODE_TYPES.Identifier) return false;
109
104
  if (node.name === "undefined") return false;
110
105
  return true;
111
106
  }
112
-
113
107
  //#endregion
114
- export { no_possibly_nullish_equality_default as default };
108
+ export { no_possibly_nullish_equality_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-redundant-function-declaration.d.ts
5
- declare const _default: _typescript_eslint_utils_ts_eslint0.RuleModule<"noRedundantFunctionDeclaration", [], WyrmPluginDocs, _typescript_eslint_utils_ts_eslint0.RuleListener> & {
5
+ declare const _default: _$_typescript_eslint_utils_ts_eslint0.RuleModule<"noRedundantFunctionDeclaration", [], 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-redundant-function-declaration.ts
6
5
  const { name } = path.parse(import.meta.filename);
7
6
  var no_redundant_function_declaration_default = createRule({
@@ -57,6 +56,5 @@ var no_redundant_function_declaration_default = createRule({
57
56
  } };
58
57
  }
59
58
  });
60
-
61
59
  //#endregion
62
- export { no_redundant_function_declaration_default as default };
60
+ export { no_redundant_function_declaration_default as default };
@@ -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, ESLintUtils } from "@typescript-eslint/utils";
4
-
5
4
  //#region lib/rules/no-return-to-void.ts
6
5
  const { name } = path.parse(import.meta.filename);
7
6
  var no_return_to_void_default = createRule({
@@ -91,6 +90,5 @@ function isFunctionExpression(node) {
91
90
  if (node.type === AST_NODE_TYPES.ArrowFunctionExpression) return true;
92
91
  return false;
93
92
  }
94
-
95
93
  //#endregion
96
- export { no_return_to_void_default as default };
94
+ export { no_return_to_void_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-self-object-assign.d.ts
5
- declare const _default: _typescript_eslint_utils_ts_eslint0.RuleModule<"noSelfObjectAssign" | "noDuplicateSources", [], WyrmPluginDocs, _typescript_eslint_utils_ts_eslint0.RuleListener> & {
5
+ declare const _default: _$_typescript_eslint_utils_ts_eslint0.RuleModule<"noSelfObjectAssign" | "noDuplicateSources", [], 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-self-object-assign.ts
6
5
  const { name } = path.parse(import.meta.filename);
7
6
  var no_self_object_assign_default = createRule({
@@ -51,6 +50,5 @@ function getDuplicateEntries(entries) {
51
50
  else seen.add(k);
52
51
  return duplicates;
53
52
  }
54
-
55
53
  //#endregion
56
- export { no_self_object_assign_default as default };
54
+ export { no_self_object_assign_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-sloppy-length-check.d.ts
5
- declare const _default: _typescript_eslint_utils_ts_eslint0.RuleModule<"noSloppyLengthCheck" | "noRedundantLengthCheck" | "noConstantLengthCheck", [], WyrmPluginDocs, _typescript_eslint_utils_ts_eslint0.RuleListener> & {
5
+ declare const _default: _$_typescript_eslint_utils_ts_eslint0.RuleModule<"noSloppyLengthCheck" | "noRedundantLengthCheck" | "noConstantLengthCheck", [], WyrmPluginDocs, _$_typescript_eslint_utils_ts_eslint0.RuleListener> & {
6
6
  name: string;
7
7
  };
8
8
  //#endregion
@@ -2,7 +2,6 @@ import { createRule } from "../utils/createRule.mjs";
2
2
  import { None, Some } from "../utils/option.mjs";
3
3
  import path from "node:path";
4
4
  import { AST_NODE_TYPES } from "@typescript-eslint/utils";
5
-
6
5
  //#region lib/rules/no-sloppy-length-check.ts
7
6
  /**
8
7
  * @fileoverview
@@ -58,7 +57,8 @@ var no_sloppy_length_check_default = createRule({
58
57
  checkFlags(flags, info, node);
59
58
  }
60
59
  function getFlagsForLogicalOrBinaryExpression(node) {
61
- if (isSymmetricBinaryExpression(node)) return getFlagsForBinaryExpression(node);
60
+ const expr = getSymmetricBinaryExpression(node);
61
+ if (expr) return getFlagsForBinaryExpression(expr);
62
62
  if (node.type === AST_NODE_TYPES.LogicalExpression) return getFlagsForLogicalExpression(node);
63
63
  return None;
64
64
  }
@@ -95,15 +95,16 @@ var no_sloppy_length_check_default = createRule({
95
95
  checkLogicalExpression(node);
96
96
  },
97
97
  BinaryExpression(node) {
98
- if (!isSymmetricBinaryExpression(node)) return;
99
- checkBinaryExpression(node);
98
+ const expr = getSymmetricBinaryExpression(node);
99
+ if (!expr) return;
100
+ checkBinaryExpression(expr);
100
101
  }
101
102
  };
102
103
  }
103
104
  });
104
105
  function getFlagsForBinaryExpression(node) {
105
- const { operator } = node;
106
- if (!isComparisonOperator(operator)) return None;
106
+ const operator = getComparisonOperator(node.operator);
107
+ if (!operator) return None;
107
108
  const maybeInfo = extractComparisonInfo({
108
109
  ...node,
109
110
  operator
@@ -135,11 +136,10 @@ function getFlags(info) {
135
136
  case ">": return Flags.SUPERIOR_TO_ZERO;
136
137
  case "<=": return Flags.EQUAL_TO_ZERO | Flags.INFERIOR_TO_ZERO;
137
138
  case ">=": return Flags.EQUAL_TO_ZERO | Flags.SUPERIOR_TO_ZERO;
138
- default: {
139
- const check = op;
140
- console.error(`[wyrm] Unexpected binary operator: ${check}`);
139
+ /* v8 ignore next -- @preserve */
140
+ default:
141
+ console.error(`[wyrm] Unexpected binary operator: ${op}`);
141
142
  return Flags.UNKNOWN;
142
- }
143
143
  }
144
144
  }
145
145
  function extractNumberLiteralValue(node) {
@@ -176,11 +176,10 @@ function reverseOperator(op) {
176
176
  case "<=": return ">=";
177
177
  case ">": return "<";
178
178
  case ">=": return "<=";
179
- default: {
180
- const check = op;
181
- console.error(`[wyrm] Unexpected binary operator: ${check}`);
179
+ /* v8 ignore next -- @preserve */
180
+ default:
181
+ console.error(`[wyrm] Unexpected binary operator: ${op}`);
182
182
  return op;
183
- }
184
183
  }
185
184
  }
186
185
  function extractComparisonInfo(node, reversed = false) {
@@ -207,11 +206,12 @@ function extractComparisonInfo(node, reversed = false) {
207
206
  op: reversed ? reverseOperator(operator) : operator
208
207
  });
209
208
  }
210
- function isSymmetricBinaryExpression(node) {
211
- if (node.type !== AST_NODE_TYPES.BinaryExpression) return false;
212
- return node.operator !== "in";
209
+ function getSymmetricBinaryExpression(node) {
210
+ if (node.type !== AST_NODE_TYPES.BinaryExpression) return null;
211
+ if (node.operator === "in") return null;
212
+ return node;
213
213
  }
214
- function isComparisonOperator(operator) {
214
+ function getComparisonOperator(operator) {
215
215
  switch (operator) {
216
216
  case "%":
217
217
  case "&":
@@ -228,7 +228,7 @@ function isComparisonOperator(operator) {
228
228
  case ">>>":
229
229
  case "^":
230
230
  case "in":
231
- case "instanceof": return false;
231
+ case "instanceof": return null;
232
232
  case "!=":
233
233
  case "!==":
234
234
  case "<":
@@ -236,14 +236,12 @@ function isComparisonOperator(operator) {
236
236
  case "==":
237
237
  case "===":
238
238
  case ">":
239
- case ">=": return true;
240
- default: {
241
- const check = operator;
242
- console.error(`[wyrm] Unexpected binary operator: ${check}`);
243
- return false;
244
- }
239
+ case ">=": return operator;
240
+ /* v8 ignore next -- @preserve */
241
+ default:
242
+ console.error(`[wyrm] Unexpected binary operator: ${operator}`);
243
+ return null;
245
244
  }
246
245
  }
247
-
248
246
  //#endregion
249
- export { no_sloppy_length_check_default as default };
247
+ export { no_sloppy_length_check_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-suspicious-jsx-semicolon.d.ts
5
- declare const _default: _typescript_eslint_utils_ts_eslint0.RuleModule<"noSuspiciousJsxSemicolon" | "noSuspiciousJsxComma", [], WyrmPluginDocs, _typescript_eslint_utils_ts_eslint0.RuleListener> & {
5
+ declare const _default: _$_typescript_eslint_utils_ts_eslint0.RuleModule<"noSuspiciousJsxSemicolon" | "noSuspiciousJsxComma", [], 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-suspicious-jsx-semicolon.ts
6
5
  /**
7
6
  * @fileoverview
@@ -28,7 +27,7 @@ var no_suspicious_jsx_semicolon_default = createRule({
28
27
  return { JSXText(node) {
29
28
  /* v8 ignore if -- @preserve */
30
29
  if (node.parent.type !== AST_NODE_TYPES.JSXElement && node.parent.type !== AST_NODE_TYPES.JSXFragment) {
31
- const msg = `Did not expect JSXText node to be a child of ${node.parent.type}`;
30
+ const msg = `[wyrm] Did not expect JSXText node to be a child of ${node.parent.type}`;
32
31
  console.warn(msg);
33
32
  return;
34
33
  }
@@ -52,6 +51,5 @@ var no_suspicious_jsx_semicolon_default = createRule({
52
51
  } };
53
52
  }
54
53
  });
55
-
56
54
  //#endregion
57
- export { no_suspicious_jsx_semicolon_default as default };
55
+ export { no_suspicious_jsx_semicolon_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/no-ternary-return.d.ts
5
- declare const _default: _typescript_eslint_utils_ts_eslint0.RuleModule<"noTernaryReturn", [{
5
+ declare const _default: _$_typescript_eslint_utils_ts_eslint0.RuleModule<"noTernaryReturn", [{
6
6
  allowSingleLine: 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/no-ternary-return.ts
6
5
  /**
7
6
  * @fileoverview
@@ -55,6 +54,5 @@ var no_ternary_return_default = createRule({
55
54
  } };
56
55
  }
57
56
  });
58
-
59
57
  //#endregion
60
- export { no_ternary_return_default as default };
58
+ export { no_ternary_return_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/no-type-guard.d.ts
5
+ declare const _default: _$_typescript_eslint_utils_ts_eslint0.RuleModule<"noTypeGuard", [], WyrmPluginDocs, _$_typescript_eslint_utils_ts_eslint0.RuleListener> & {
6
+ name: string;
7
+ };
8
+ //#endregion
9
+ export { _default };
@@ -0,0 +1,36 @@
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/no-type-guard.ts
5
+ const { name } = path.parse(import.meta.filename);
6
+ var no_type_guard_default = createRule({
7
+ name,
8
+ meta: {
9
+ type: "suggestion",
10
+ docs: {
11
+ description: "Forbid type guards",
12
+ pedantic: true
13
+ },
14
+ schema: [],
15
+ messages: { noTypeGuard: "Type guards are forbidden." }
16
+ },
17
+ defaultOptions: [],
18
+ create(context) {
19
+ return {
20
+ FunctionDeclaration: checkFunction,
21
+ FunctionExpression: checkFunction,
22
+ ArrowFunctionExpression: checkFunction
23
+ };
24
+ function checkFunction(fn) {
25
+ if (fn.parent.type === AST_NODE_TYPES.CallExpression) return;
26
+ if (!fn.returnType) return;
27
+ if (fn.returnType.typeAnnotation.type !== AST_NODE_TYPES.TSTypePredicate) return;
28
+ context.report({
29
+ node: fn,
30
+ messageId: "noTypeGuard"
31
+ });
32
+ }
33
+ }
34
+ });
35
+ //#endregion
36
+ export { no_type_guard_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-unassigned-todo.d.ts
5
- declare const _default: _typescript_eslint_utils_ts_eslint0.RuleModule<"noUnassignedComment", [], WyrmPluginDocs, _typescript_eslint_utils_ts_eslint0.RuleListener> & {
5
+ declare const _default: _$_typescript_eslint_utils_ts_eslint0.RuleModule<"noUnassignedComment", [], 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-unassigned-todo.ts
5
4
  const { name } = path.parse(import.meta.filename);
6
5
  var no_unassigned_todo_default = createRule({
@@ -33,6 +32,5 @@ function hasUnassignedTodo(line) {
33
32
  if (!/^todo(?:\W|$)/u.test(value)) return false;
34
33
  return !/^todo\([^)]+\)/u.test(value);
35
34
  }
36
-
37
35
  //#endregion
38
- export { no_unassigned_todo_default as default };
36
+ export { no_unassigned_todo_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-unbound-catch-error.d.ts
5
- declare const _default: _typescript_eslint_utils_ts_eslint0.RuleModule<"noUnboundError", [], WyrmPluginDocs, _typescript_eslint_utils_ts_eslint0.RuleListener> & {
5
+ declare const _default: _$_typescript_eslint_utils_ts_eslint0.RuleModule<"noUnboundError", [], 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-unbound-catch-error.ts
5
4
  const { name } = path.parse(import.meta.filename);
6
5
  var no_unbound_catch_error_default = createRule({
@@ -25,6 +24,5 @@ var no_unbound_catch_error_default = createRule({
25
24
  } };
26
25
  }
27
26
  });
28
-
29
27
  //#endregion
30
- export { no_unbound_catch_error_default as default };
28
+ export { no_unbound_catch_error_default as default };
@@ -2,7 +2,6 @@ import { createRule } from "../utils/createRule.mjs";
2
2
  import { None, Some } from "../utils/option.mjs";
3
3
  import path from "node:path";
4
4
  import { ASTUtils, AST_NODE_TYPES } from "@typescript-eslint/utils";
5
-
6
5
  //#region lib/rules/no-unused-mutually-referential.ts
7
6
  /**
8
7
  * @fileoverview
@@ -121,11 +120,10 @@ function isFunctionUnused(fn, getScope) {
121
120
  newFuncsAdded = true;
122
121
  }
123
122
  continue;
124
- default: {
125
- const check = kind;
126
- console.error(`[wyrm] Unexpected UsageKind: ${check} (wyrm/no-unused-mutually-referential rule)`);
123
+ /* v8 ignore next -- @preserve */
124
+ default:
125
+ console.error(`[wyrm] Unexpected UsageKind: ${kind} (wyrm/no-unused-mutually-referential rule)`);
127
126
  return false;
128
- }
129
127
  }
130
128
  }
131
129
  if (!newFuncsAdded) break;
@@ -161,11 +159,10 @@ function getIdentifiedFunction(node) {
161
159
  case AST_NODE_TYPES.FunctionDeclaration: return getIdentifiedFunctionDecl(node);
162
160
  case AST_NODE_TYPES.FunctionExpression:
163
161
  case AST_NODE_TYPES.ArrowFunctionExpression: return getIdentifiedFunctionExpr(node);
164
- default: {
165
- const check = type;
166
- console.error(`[wyrm] Unexpected type: ${check} (wyrm/no-unused-mutually-referential rule)`);
162
+ /* v8 ignore next -- @preserve */
163
+ default:
164
+ console.error(`[wyrm] Unexpected type: ${type} (wyrm/no-unused-mutually-referential rule)`);
167
165
  return None;
168
- }
169
166
  }
170
167
  }
171
168
  function getIdentifiedFunctionDecl(decl) {
@@ -196,11 +193,10 @@ function isExported(fn) {
196
193
  }
197
194
  return false;
198
195
  }
199
- default: {
200
- const check = type;
201
- console.error(`[wyrm] Unexpected type: ${check} (wyrm/no-unused-mutually-referential rule)`);
196
+ /* v8 ignore next -- @preserve */
197
+ default:
198
+ console.error(`[wyrm] Unexpected type: ${type} (wyrm/no-unused-mutually-referential rule)`);
202
199
  return false;
203
- }
204
200
  }
205
201
  }
206
202
  function getParentFunction(node) {
@@ -215,6 +211,5 @@ function getParentFunction(node) {
215
211
  if (gas === 0) console.error("[wyrm] Ran out of gas while climbing up the parent chain. Unless your AST is extremely nested, this is probably an infinite loop bug in eslint-plugin-wyrm (wyrm/no-unused-mutually-referential rule)");
216
212
  return None;
217
213
  }
218
-
219
214
  //#endregion
220
- export { no_unused_mutually_referential_default as default };
215
+ export { no_unused_mutually_referential_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-unused-param-read.d.ts
5
- declare const _default: _typescript_eslint_utils_ts_eslint0.RuleModule<"noUnusedParamRead", [], WyrmPluginDocs, _typescript_eslint_utils_ts_eslint0.RuleListener> & {
5
+ declare const _default: _$_typescript_eslint_utils_ts_eslint0.RuleModule<"noUnusedParamRead", [], 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-unused-param-read.ts
6
5
  const { name } = path.parse(import.meta.filename);
7
6
  var no_unused_param_read_default = createRule({
@@ -29,6 +28,5 @@ var no_unused_param_read_default = createRule({
29
28
  } };
30
29
  }
31
30
  });
32
-
33
31
  //#endregion
34
- export { no_unused_param_read_default as default };
32
+ export { no_unused_param_read_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-useless-computed-key.d.ts
5
- declare const _default: _typescript_eslint_utils_ts_eslint0.RuleModule<"noUselessComputedKey", [], WyrmPluginDocs, _typescript_eslint_utils_ts_eslint0.RuleListener> & {
5
+ declare const _default: _$_typescript_eslint_utils_ts_eslint0.RuleModule<"noUselessComputedKey", [], 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-useless-computed-key.ts
6
5
  const { name } = path.parse(import.meta.filename);
7
6
  var no_useless_computed_key_default = createRule({
@@ -34,6 +33,5 @@ var no_useless_computed_key_default = createRule({
34
33
  } };
35
34
  }
36
35
  });
37
-
38
36
  //#endregion
39
- export { no_useless_computed_key_default as default };
37
+ export { no_useless_computed_key_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-useless-iife.d.ts
5
- declare const _default: _typescript_eslint_utils_ts_eslint0.RuleModule<"noUselessIIFE" | "removeIIFE", [], WyrmPluginDocs, _typescript_eslint_utils_ts_eslint0.RuleListener> & {
5
+ declare const _default: _$_typescript_eslint_utils_ts_eslint0.RuleModule<"noUselessIIFE" | "removeIIFE", [], WyrmPluginDocs, _$_typescript_eslint_utils_ts_eslint0.RuleListener> & {
6
6
  name: string;
7
7
  };
8
8
  //#endregion
@@ -2,7 +2,6 @@ import { createRule } from "../utils/createRule.mjs";
2
2
  import { None, Some } from "../utils/option.mjs";
3
3
  import path from "node:path";
4
4
  import { AST_NODE_TYPES } from "@typescript-eslint/utils";
5
-
6
5
  //#region lib/rules/no-useless-iife.ts
7
6
  const { name } = path.parse(import.meta.filename);
8
7
  var no_useless_iife_default = createRule({
@@ -163,11 +162,11 @@ function nodeHasAwait(node) {
163
162
  case AST_NODE_TYPES.ExportAllDeclaration:
164
163
  case AST_NODE_TYPES.ExportSpecifier:
165
164
  case AST_NODE_TYPES.ExportDefaultDeclaration: return false;
165
+ /* v8 ignore next -- @preserve */
166
166
  default:
167
167
  if (process.env["NODE_ENV"] === "test") console.error(node.type);
168
168
  return true;
169
169
  }
170
170
  }
171
-
172
171
  //#endregion
173
- export { no_useless_iife_default as default };
172
+ export { no_useless_iife_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 { AST_NODE_TYPES, ESLintUtils } from "@typescript-eslint/utils";
4
- import * as ts from "typescript";
5
-
4
+ import * as ts$1 from "typescript";
6
5
  //#region lib/rules/no-useless-logical-fallback.ts
7
6
  /**
8
7
  * @fileoverview
@@ -70,6 +69,7 @@ var no_useless_logical_fallback_default = createRule({
70
69
  case "??":
71
70
  checkNullishCoalescingExpression(node);
72
71
  break;
72
+ /* v8 ignore next -- @preserve */
73
73
  default: {
74
74
  const check = node.operator;
75
75
  console.error(`[wyrm] Unexpected operator for LogicalExpression: ${check}`);
@@ -242,21 +242,17 @@ var no_useless_logical_fallback_default = createRule({
242
242
  return getServices().getTypeAtLocation(expr) === numberType;
243
243
  }
244
244
  function isTypePossiblyNull(type) {
245
- const nullType = getChecker().getNullType();
246
245
  if (type.isUnion()) return type.types.some((t) => isTypePossiblyNull(t));
247
- const flags = ts.TypeFlags.Null | ts.TypeFlags.Any | ts.TypeFlags.Unknown | ts.TypeFlags.TypeParameter;
248
- if ((type.getFlags() & flags) !== 0) return true;
249
- return type === nullType;
246
+ const flags = ts$1.TypeFlags.Null | ts$1.TypeFlags.Any | ts$1.TypeFlags.Unknown | ts$1.TypeFlags.TypeParameter;
247
+ return (type.getFlags() & flags) !== 0;
250
248
  }
251
249
  function isPossiblyNull(expr) {
252
250
  return isTypePossiblyNull(getServices().getTypeAtLocation(expr));
253
251
  }
254
252
  function isTypePossiblyUndefined(type) {
255
- const undefinedType = getChecker().getUndefinedType();
256
253
  if (type.isUnion()) return type.types.some((t) => isTypePossiblyUndefined(t));
257
- const flags = ts.TypeFlags.Undefined | ts.TypeFlags.Any | ts.TypeFlags.Unknown | ts.TypeFlags.TypeParameter;
258
- if ((type.getFlags() & flags) !== 0) return true;
259
- return type === undefinedType;
254
+ const flags = ts$1.TypeFlags.Undefined | ts$1.TypeFlags.Any | ts$1.TypeFlags.Unknown | ts$1.TypeFlags.TypeParameter;
255
+ return (type.getFlags() & flags) !== 0;
260
256
  }
261
257
  function isPossiblyUndefined(expr) {
262
258
  return isTypePossiblyUndefined(getServices().getTypeAtLocation(expr));
@@ -275,6 +271,5 @@ function isZeroLiteral(node) {
275
271
  function isEmptyStringLiteral(node) {
276
272
  return node.type === AST_NODE_TYPES.Literal && node.value === "";
277
273
  }
278
-
279
274
  //#endregion
280
- export { no_useless_logical_fallback_default as default };
275
+ export { no_useless_logical_fallback_default as default };
@@ -2,7 +2,6 @@ import { createRule } from "../utils/createRule.mjs";
2
2
  import { None, Some } from "../utils/option.mjs";
3
3
  import path from "node:path";
4
4
  import { AST_NODE_TYPES, ESLintUtils } from "@typescript-eslint/utils";
5
-
6
5
  //#region lib/rules/no-useless-return-undefined.ts
7
6
  const { name } = path.parse(import.meta.filename);
8
7
  var no_useless_return_undefined_default = createRule({
@@ -103,6 +102,5 @@ function getFunctionExpression(node) {
103
102
  if (node.type === AST_NODE_TYPES.ArrowFunctionExpression) return Some(node);
104
103
  return None;
105
104
  }
106
-
107
105
  //#endregion
108
- export { no_useless_return_undefined_default as default };
106
+ export { no_useless_return_undefined_default as default };