pickier 0.1.19 → 0.1.21

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 (291) hide show
  1. package/README.md +80 -459
  2. package/dist/ast.d.ts +4 -15
  3. package/dist/bin/cli.js +18409 -15891
  4. package/dist/config.d.ts +1 -1
  5. package/dist/format.d.ts +1 -1
  6. package/dist/formatter.d.ts +1 -1
  7. package/dist/index.d.ts +2 -2
  8. package/dist/linter.d.ts +3 -3
  9. package/dist/plugins/eslint.d.ts +1 -1
  10. package/dist/plugins/general.d.ts +1 -1
  11. package/dist/plugins/index.d.ts +1 -1
  12. package/dist/plugins/lockfile.d.ts +1 -1
  13. package/dist/plugins/markdown.d.ts +1 -1
  14. package/dist/plugins/node.d.ts +1 -1
  15. package/dist/plugins/perfectionist.d.ts +1 -1
  16. package/dist/plugins/pickier.d.ts +1 -1
  17. package/dist/plugins/publint.d.ts +1 -2
  18. package/dist/plugins/quality.d.ts +1 -1
  19. package/dist/plugins/regexp.d.ts +1 -1
  20. package/dist/plugins/shell.d.ts +2 -0
  21. package/dist/plugins/spell.d.ts +3 -0
  22. package/dist/plugins/style.d.ts +1 -1
  23. package/dist/plugins/ts.d.ts +1 -1
  24. package/dist/plugins/unused-imports.d.ts +1 -1
  25. package/dist/plugins/utils.d.ts +2 -1
  26. package/dist/rules/general/array-callback-return.d.ts +1 -1
  27. package/dist/rules/general/constructor-super.d.ts +1 -1
  28. package/dist/rules/general/for-direction.d.ts +1 -1
  29. package/dist/rules/general/getter-return.d.ts +1 -1
  30. package/dist/rules/general/no-async-promise-executor.d.ts +1 -1
  31. package/dist/rules/general/no-compare-neg-zero.d.ts +1 -1
  32. package/dist/rules/general/no-cond-assign.d.ts +1 -1
  33. package/dist/rules/general/no-const-assign.d.ts +1 -1
  34. package/dist/rules/general/no-constant-condition.d.ts +1 -1
  35. package/dist/rules/general/no-constructor-return.d.ts +1 -1
  36. package/dist/rules/general/no-dupe-class-members.d.ts +1 -1
  37. package/dist/rules/general/no-dupe-keys.d.ts +1 -1
  38. package/dist/rules/general/no-duplicate-case.d.ts +1 -1
  39. package/dist/rules/general/no-empty-pattern.d.ts +1 -1
  40. package/dist/rules/general/no-fallthrough.d.ts +1 -1
  41. package/dist/rules/general/no-irregular-whitespace.d.ts +1 -1
  42. package/dist/rules/general/no-loss-of-precision.d.ts +1 -1
  43. package/dist/rules/general/no-new.d.ts +1 -1
  44. package/dist/rules/general/no-promise-executor-return.d.ts +1 -1
  45. package/dist/rules/general/no-redeclare.d.ts +1 -1
  46. package/dist/rules/general/no-regex-spaces.d.ts +1 -1
  47. package/dist/rules/general/no-self-assign.d.ts +1 -1
  48. package/dist/rules/general/no-self-compare.d.ts +1 -1
  49. package/dist/rules/general/no-sparse-arrays.d.ts +1 -1
  50. package/dist/rules/general/no-undef.d.ts +1 -1
  51. package/dist/rules/general/no-unreachable.d.ts +1 -1
  52. package/dist/rules/general/no-unsafe-negation.d.ts +1 -1
  53. package/dist/rules/general/no-unused-vars.d.ts +1 -1
  54. package/dist/rules/general/no-useless-catch.d.ts +1 -1
  55. package/dist/rules/general/prefer-const.d.ts +1 -1
  56. package/dist/rules/general/prefer-object-spread.d.ts +1 -1
  57. package/dist/rules/general/prefer-template.d.ts +1 -1
  58. package/dist/rules/general/use-isnan.d.ts +1 -1
  59. package/dist/rules/general/valid-typeof.d.ts +1 -1
  60. package/dist/rules/imports/first.d.ts +1 -1
  61. package/dist/rules/imports/import-dedupe.d.ts +1 -1
  62. package/dist/rules/imports/named.d.ts +1 -1
  63. package/dist/rules/imports/no-cycle.d.ts +1 -1
  64. package/dist/rules/imports/no-duplicate-imports.d.ts +1 -1
  65. package/dist/rules/imports/no-import-dist.d.ts +1 -1
  66. package/dist/rules/imports/no-import-node-modules-by-path.d.ts +1 -1
  67. package/dist/rules/imports/no-unresolved.d.ts +1 -1
  68. package/dist/rules/lockfile/index.d.ts +1 -1
  69. package/dist/rules/lockfile/parser.d.ts +1 -1
  70. package/dist/rules/lockfile/validate-host.d.ts +1 -2
  71. package/dist/rules/lockfile/validate-https.d.ts +1 -1
  72. package/dist/rules/lockfile/validate-integrity.d.ts +1 -1
  73. package/dist/rules/lockfile/validate-package-names.d.ts +1 -1
  74. package/dist/rules/lockfile/validate-scheme.d.ts +1 -1
  75. package/dist/rules/markdown/blanks-around-fences.d.ts +1 -1
  76. package/dist/rules/markdown/blanks-around-headings.d.ts +1 -1
  77. package/dist/rules/markdown/blanks-around-lists.d.ts +1 -1
  78. package/dist/rules/markdown/blanks-around-tables.d.ts +1 -1
  79. package/dist/rules/markdown/code-block-style.d.ts +1 -1
  80. package/dist/rules/markdown/code-fence-style.d.ts +1 -1
  81. package/dist/rules/markdown/commands-show-output.d.ts +1 -1
  82. package/dist/rules/markdown/descriptive-link-text.d.ts +1 -1
  83. package/dist/rules/markdown/emphasis-style.d.ts +1 -1
  84. package/dist/rules/markdown/fenced-code-language.d.ts +1 -1
  85. package/dist/rules/markdown/first-line-heading.d.ts +1 -1
  86. package/dist/rules/markdown/heading-increment.d.ts +1 -1
  87. package/dist/rules/markdown/heading-start-left.d.ts +1 -1
  88. package/dist/rules/markdown/heading-style.d.ts +1 -1
  89. package/dist/rules/markdown/hr-style.d.ts +1 -1
  90. package/dist/rules/markdown/line-length.d.ts +1 -1
  91. package/dist/rules/markdown/link-fragments.d.ts +1 -1
  92. package/dist/rules/markdown/link-image-reference-definitions.d.ts +1 -1
  93. package/dist/rules/markdown/link-image-style.d.ts +1 -1
  94. package/dist/rules/markdown/list-indent.d.ts +1 -1
  95. package/dist/rules/markdown/list-marker-space.d.ts +1 -1
  96. package/dist/rules/markdown/no-alt-text.d.ts +1 -1
  97. package/dist/rules/markdown/no-bare-urls.d.ts +1 -1
  98. package/dist/rules/markdown/no-blanks-blockquote.d.ts +1 -1
  99. package/dist/rules/markdown/no-duplicate-heading.d.ts +1 -1
  100. package/dist/rules/markdown/no-emphasis-as-heading.d.ts +5 -1
  101. package/dist/rules/markdown/no-empty-links.d.ts +1 -1
  102. package/dist/rules/markdown/no-hard-tabs.d.ts +1 -1
  103. package/dist/rules/markdown/no-inline-html.d.ts +1 -1
  104. package/dist/rules/markdown/no-missing-space-atx.d.ts +1 -1
  105. package/dist/rules/markdown/no-missing-space-closed-atx.d.ts +1 -1
  106. package/dist/rules/markdown/no-multiple-blanks.d.ts +1 -1
  107. package/dist/rules/markdown/no-multiple-space-atx.d.ts +1 -1
  108. package/dist/rules/markdown/no-multiple-space-blockquote.d.ts +1 -1
  109. package/dist/rules/markdown/no-multiple-space-closed-atx.d.ts +1 -1
  110. package/dist/rules/markdown/no-reversed-links.d.ts +1 -1
  111. package/dist/rules/markdown/no-space-in-code.d.ts +1 -1
  112. package/dist/rules/markdown/no-space-in-emphasis.d.ts +1 -1
  113. package/dist/rules/markdown/no-space-in-links.d.ts +1 -1
  114. package/dist/rules/markdown/no-trailing-punctuation.d.ts +1 -1
  115. package/dist/rules/markdown/no-trailing-spaces.d.ts +1 -1
  116. package/dist/rules/markdown/ol-prefix.d.ts +1 -1
  117. package/dist/rules/markdown/proper-names.d.ts +1 -1
  118. package/dist/rules/markdown/reference-links-images.d.ts +10 -1
  119. package/dist/rules/markdown/required-headings.d.ts +1 -1
  120. package/dist/rules/markdown/single-title.d.ts +1 -1
  121. package/dist/rules/markdown/single-trailing-newline.d.ts +1 -1
  122. package/dist/rules/markdown/strong-style.d.ts +1 -1
  123. package/dist/rules/markdown/table-column-count.d.ts +1 -1
  124. package/dist/rules/markdown/table-column-style.d.ts +1 -1
  125. package/dist/rules/markdown/table-pipe-style.d.ts +1 -1
  126. package/dist/rules/markdown/ul-indent.d.ts +10 -1
  127. package/dist/rules/markdown/ul-style.d.ts +1 -1
  128. package/dist/rules/node/prefer-global-buffer.d.ts +1 -1
  129. package/dist/rules/node/prefer-global-process.d.ts +1 -1
  130. package/dist/rules/publint/bin-file-not-executable.d.ts +1 -1
  131. package/dist/rules/publint/deprecated-field-jsnext.d.ts +1 -1
  132. package/dist/rules/publint/exports-default-should-be-last.d.ts +1 -1
  133. package/dist/rules/publint/exports-fallback-array-use.d.ts +1 -1
  134. package/dist/rules/publint/exports-missing-root-entrypoint.d.ts +1 -1
  135. package/dist/rules/publint/exports-module-should-be-esm.d.ts +1 -1
  136. package/dist/rules/publint/exports-module-should-precede-require.d.ts +1 -1
  137. package/dist/rules/publint/exports-types-should-be-first.d.ts +1 -1
  138. package/dist/rules/publint/exports-value-invalid.d.ts +1 -1
  139. package/dist/rules/publint/field-invalid-value-type.d.ts +1 -1
  140. package/dist/rules/publint/file-does-not-exist.d.ts +1 -1
  141. package/dist/rules/publint/file-invalid-format.d.ts +1 -1
  142. package/dist/rules/publint/has-module-but-no-exports.d.ts +1 -1
  143. package/dist/rules/publint/imports-default-should-be-last.d.ts +1 -1
  144. package/dist/rules/publint/imports-key-invalid.d.ts +1 -1
  145. package/dist/rules/publint/imports-module-should-precede-require.d.ts +1 -1
  146. package/dist/rules/publint/imports-value-invalid.d.ts +1 -1
  147. package/dist/rules/publint/index.d.ts +13 -11
  148. package/dist/rules/publint/local-dependency.d.ts +1 -1
  149. package/dist/rules/publint/module-should-be-esm.d.ts +1 -1
  150. package/dist/rules/publint/use-type.d.ts +1 -1
  151. package/dist/rules/publint/utils.d.ts +2 -2
  152. package/dist/rules/quality/complexity.d.ts +1 -1
  153. package/dist/rules/quality/default-case.d.ts +1 -1
  154. package/dist/rules/quality/eqeqeq.d.ts +1 -1
  155. package/dist/rules/quality/max-depth.d.ts +1 -1
  156. package/dist/rules/quality/max-lines-per-function.d.ts +1 -1
  157. package/dist/rules/quality/no-alert.d.ts +1 -1
  158. package/dist/rules/quality/no-await-in-loop.d.ts +1 -1
  159. package/dist/rules/quality/no-caller.d.ts +1 -1
  160. package/dist/rules/quality/no-case-declarations.d.ts +1 -1
  161. package/dist/rules/quality/no-else-return.d.ts +1 -1
  162. package/dist/rules/quality/no-empty-function.d.ts +1 -1
  163. package/dist/rules/quality/no-empty.d.ts +1 -1
  164. package/dist/rules/quality/no-eval.d.ts +1 -1
  165. package/dist/rules/quality/no-extend-native.d.ts +1 -1
  166. package/dist/rules/quality/no-extra-boolean-cast.d.ts +1 -1
  167. package/dist/rules/quality/no-global-assign.d.ts +1 -1
  168. package/dist/rules/quality/no-implied-eval.d.ts +1 -1
  169. package/dist/rules/quality/no-iterator.d.ts +1 -1
  170. package/dist/rules/quality/no-lonely-if.d.ts +1 -1
  171. package/dist/rules/quality/no-new-func.d.ts +1 -1
  172. package/dist/rules/quality/no-new-wrappers.d.ts +1 -1
  173. package/dist/rules/quality/no-new.d.ts +1 -1
  174. package/dist/rules/quality/no-octal.d.ts +1 -1
  175. package/dist/rules/quality/no-param-reassign.d.ts +1 -1
  176. package/dist/rules/quality/no-proto.d.ts +1 -1
  177. package/dist/rules/quality/no-return-assign.d.ts +1 -1
  178. package/dist/rules/quality/no-sequences.d.ts +1 -1
  179. package/dist/rules/quality/no-shadow.d.ts +1 -1
  180. package/dist/rules/quality/no-throw-literal.d.ts +1 -1
  181. package/dist/rules/quality/no-use-before-define.d.ts +1 -1
  182. package/dist/rules/quality/no-useless-call.d.ts +1 -1
  183. package/dist/rules/quality/no-useless-concat.d.ts +1 -1
  184. package/dist/rules/quality/no-useless-escape.d.ts +1 -1
  185. package/dist/rules/quality/no-useless-rename.d.ts +1 -1
  186. package/dist/rules/quality/no-useless-return.d.ts +1 -1
  187. package/dist/rules/quality/no-var.d.ts +1 -1
  188. package/dist/rules/quality/no-with.d.ts +1 -1
  189. package/dist/rules/quality/prefer-arrow-callback.d.ts +1 -1
  190. package/dist/rules/quality/require-await.d.ts +1 -1
  191. package/dist/rules/regexp/no-super-linear-backtracking.d.ts +1 -1
  192. package/dist/rules/regexp/no-unused-capturing-group.d.ts +1 -1
  193. package/dist/rules/regexp/no-useless-lazy.d.ts +1 -1
  194. package/dist/rules/shell/_shared.d.ts +24 -0
  195. package/dist/rules/shell/command-substitution.d.ts +6 -0
  196. package/dist/rules/shell/consistent-case-terminators.d.ts +9 -0
  197. package/dist/rules/shell/function-style.d.ts +6 -0
  198. package/dist/rules/shell/heredoc-indent.d.ts +7 -0
  199. package/dist/rules/shell/indent.d.ts +2 -0
  200. package/dist/rules/shell/keyword-spacing.d.ts +10 -0
  201. package/dist/rules/shell/no-broken-redirect.d.ts +7 -0
  202. package/dist/rules/shell/no-cd-without-check.d.ts +6 -0
  203. package/dist/rules/shell/no-eval.d.ts +6 -0
  204. package/dist/rules/shell/no-exit-in-subshell.d.ts +7 -0
  205. package/dist/rules/shell/no-ls-parsing.d.ts +7 -0
  206. package/dist/rules/shell/no-trailing-semicolons.d.ts +6 -0
  207. package/dist/rules/shell/no-trailing-whitespace.d.ts +5 -0
  208. package/dist/rules/shell/no-useless-cat.d.ts +6 -0
  209. package/dist/rules/shell/no-variable-in-single-quotes.d.ts +7 -0
  210. package/dist/rules/shell/operator-spacing.d.ts +11 -0
  211. package/dist/rules/shell/prefer-double-brackets.d.ts +6 -0
  212. package/dist/rules/shell/prefer-printf.d.ts +6 -0
  213. package/dist/rules/shell/quote-variables.d.ts +2 -0
  214. package/dist/rules/shell/set-options.d.ts +8 -0
  215. package/dist/rules/shell/shebang.d.ts +2 -0
  216. package/dist/rules/sort/exports.d.ts +1 -1
  217. package/dist/rules/sort/heritage-clauses.d.ts +1 -1
  218. package/dist/rules/sort/imports.d.ts +1 -1
  219. package/dist/rules/sort/keys.d.ts +1 -1
  220. package/dist/rules/sort/named-imports.d.ts +1 -1
  221. package/dist/rules/sort/objects.d.ts +1 -1
  222. package/dist/rules/sort/tailwind-classes.d.ts +5 -0
  223. package/dist/rules/style/array-bracket-spacing.d.ts +1 -1
  224. package/dist/rules/style/arrow-parens.d.ts +1 -1
  225. package/dist/rules/style/arrow-spacing.d.ts +1 -1
  226. package/dist/rules/style/block-spacing.d.ts +1 -1
  227. package/dist/rules/style/brace-style.d.ts +1 -1
  228. package/dist/rules/style/comma-dangle.d.ts +1 -1
  229. package/dist/rules/style/comma-spacing.d.ts +1 -1
  230. package/dist/rules/style/comma-style.d.ts +1 -1
  231. package/dist/rules/style/computed-property-spacing.d.ts +1 -1
  232. package/dist/rules/style/consistent-chaining.d.ts +1 -1
  233. package/dist/rules/style/consistent-list-newline.d.ts +1 -1
  234. package/dist/rules/style/curly.d.ts +1 -1
  235. package/dist/rules/style/dot-location.d.ts +1 -1
  236. package/dist/rules/style/function-call-spacing.d.ts +1 -1
  237. package/dist/rules/style/generator-star-spacing.d.ts +1 -1
  238. package/dist/rules/style/if-newline.d.ts +1 -1
  239. package/dist/rules/style/indent-binary-ops.d.ts +1 -1
  240. package/dist/rules/style/indent-unindent.d.ts +1 -1
  241. package/dist/rules/style/key-spacing.d.ts +1 -1
  242. package/dist/rules/style/keyword-spacing.d.ts +1 -1
  243. package/dist/rules/style/lines-between-class-members.d.ts +1 -1
  244. package/dist/rules/style/max-statements-per-line.d.ts +1 -1
  245. package/dist/rules/style/multiline-ternary.d.ts +1 -1
  246. package/dist/rules/style/new-parens.d.ts +1 -1
  247. package/dist/rules/style/no-extra-parens.d.ts +1 -1
  248. package/dist/rules/style/no-floating-decimal.d.ts +1 -1
  249. package/dist/rules/style/no-mixed-operators.d.ts +1 -1
  250. package/dist/rules/style/no-mixed-spaces-and-tabs.d.ts +1 -1
  251. package/dist/rules/style/no-multi-spaces.d.ts +1 -1
  252. package/dist/rules/style/no-multiple-empty-lines.d.ts +1 -1
  253. package/dist/rules/style/no-tabs.d.ts +1 -1
  254. package/dist/rules/style/no-trailing-spaces.d.ts +1 -1
  255. package/dist/rules/style/no-whitespace-before-property.d.ts +1 -1
  256. package/dist/rules/style/object-curly-spacing.d.ts +1 -1
  257. package/dist/rules/style/operator-linebreak.d.ts +1 -1
  258. package/dist/rules/style/padded-blocks.d.ts +1 -1
  259. package/dist/rules/style/quote-props.d.ts +1 -1
  260. package/dist/rules/style/rest-spread-spacing.d.ts +1 -1
  261. package/dist/rules/style/semi-spacing.d.ts +1 -1
  262. package/dist/rules/style/space-before-blocks.d.ts +1 -1
  263. package/dist/rules/style/space-before-function-paren.d.ts +1 -1
  264. package/dist/rules/style/space-in-parens.d.ts +1 -1
  265. package/dist/rules/style/space-infix-ops.d.ts +1 -1
  266. package/dist/rules/style/space-unary-ops.d.ts +1 -1
  267. package/dist/rules/style/spaced-comment.d.ts +1 -1
  268. package/dist/rules/style/switch-colon-spacing.d.ts +1 -1
  269. package/dist/rules/style/template-curly-spacing.d.ts +1 -1
  270. package/dist/rules/style/template-tag-spacing.d.ts +1 -1
  271. package/dist/rules/style/top-level-function.d.ts +1 -1
  272. package/dist/rules/style/wrap-iife.d.ts +1 -1
  273. package/dist/rules/style/yield-star-spacing.d.ts +1 -1
  274. package/dist/rules/ts/member-delimiter-style.d.ts +1 -1
  275. package/dist/rules/ts/no-explicit-any.d.ts +1 -1
  276. package/dist/rules/ts/no-floating-promises.d.ts +1 -1
  277. package/dist/rules/ts/no-misused-promises.d.ts +1 -1
  278. package/dist/rules/ts/no-require-imports.d.ts +1 -1
  279. package/dist/rules/ts/no-top-level-await.d.ts +1 -1
  280. package/dist/rules/ts/no-ts-export-equal.d.ts +1 -1
  281. package/dist/rules/ts/no-unsafe-assignment.d.ts +1 -1
  282. package/dist/rules/ts/prefer-nullish-coalescing.d.ts +1 -1
  283. package/dist/rules/ts/prefer-optional-chain.d.ts +1 -1
  284. package/dist/rules/ts/type-annotation-spacing.d.ts +1 -1
  285. package/dist/rules/ts/type-generic-spacing.d.ts +1 -1
  286. package/dist/rules/ts/type-named-tuple-spacing.d.ts +1 -1
  287. package/dist/run.d.ts +1 -1
  288. package/dist/src/index.js +11768 -11309
  289. package/dist/types.d.ts +21 -4
  290. package/dist/utils.d.ts +36 -11
  291. package/package.json +16 -8
@@ -1,2 +1,2 @@
1
1
  import type { RuleModule } from '../../types';
2
- export declare const noUselessReturnRule: RuleModule;
2
+ export declare const noUselessReturnRule: RuleModule;
@@ -1,2 +1,2 @@
1
1
  import type { RuleModule } from '../../types';
2
- export declare const noVarRule: RuleModule;
2
+ export declare const noVarRule: RuleModule;
@@ -1,2 +1,2 @@
1
1
  import type { RuleModule } from '../../types';
2
- export declare const noWithRule: RuleModule;
2
+ export declare const noWithRule: RuleModule;
@@ -1,2 +1,2 @@
1
1
  import type { RuleModule } from '../../types';
2
- export declare const preferArrowCallbackRule: RuleModule;
2
+ export declare const preferArrowCallbackRule: RuleModule;
@@ -1,2 +1,2 @@
1
1
  import type { RuleModule } from '../../types';
2
- export declare const requireAwaitRule: RuleModule;
2
+ export declare const requireAwaitRule: RuleModule;
@@ -1,2 +1,2 @@
1
1
  import type { RuleModule } from '../../types';
2
- export declare const noSuperLinearBacktrackingRule: RuleModule;
2
+ export declare const noSuperLinearBacktrackingRule: RuleModule;
@@ -1,2 +1,2 @@
1
1
  import type { RuleModule } from '../../types';
2
- export declare const noUnusedCapturingGroupRule: RuleModule;
2
+ export declare const noUnusedCapturingGroupRule: RuleModule;
@@ -6,4 +6,4 @@ import type { RuleModule } from '../../types';
6
6
  * - /a+?$/ - lazy is useless because $ forces end-of-string
7
7
  * - /a*?b/ - lazy might be useless in some contexts
8
8
  */
9
- export declare const noUselessLazy: RuleModule;
9
+ export declare const noUselessLazy: RuleModule;
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Replace the interiors of shell strings, parameter expansions, command
3
+ * substitutions, and arithmetic expansions with spaces so regex-based rules
4
+ * can operate on "bare shell code" without false positives from characters
5
+ * that appear inside `$'...'`, `'...'`, `"..."`, `` `...` ``, `${...}`,
6
+ * `$(...)`, `$((...))`, or trailing `# ...` comments.
7
+ *
8
+ * The returned string has the same length as the input so that indices
9
+ * produced by matches on the masked line are valid indices in the original.
10
+ *
11
+ * Only *interior* characters are masked to spaces; structural delimiters
12
+ * (`'`, `"`, `` ` ``, `$`, `(`, `)`, `{`, `}`) are preserved so that rules
13
+ * can still reason about whether a token sits next to a string boundary —
14
+ * e.g. `"$var"]` still reports the `"` as the character preceding `]`.
15
+ */
16
+ export declare function maskShellStrings(line: string): string;
17
+ /**
18
+ * Track heredoc start and end within a line-by-line scan. Returns the
19
+ * delimiter recognised at this line, or `null` if this line does not start a
20
+ * heredoc. The caller tracks state by flipping a boolean when
21
+ * `heredocDelimiter` returns non-null, and clearing it when the delimiter
22
+ * matches a subsequent line's trimmed content.
23
+ */
24
+ export declare function heredocDelimiter(line: string): string | null;
@@ -0,0 +1,6 @@
1
+ import type { RuleModule } from '../../types';
2
+ /**
3
+ * SC2006: Use $(...) notation instead of legacy backtick `...` command substitution.
4
+ * Backticks are harder to nest and read. $() is the modern POSIX-compliant alternative.
5
+ */
6
+ export declare const commandSubstitutionRule: RuleModule;
@@ -0,0 +1,9 @@
1
+ import type { RuleModule } from '../../types';
2
+ /**
3
+ * Enforce consistent placement of case statement terminators (;;).
4
+ * Each case branch must end with ;; before the next pattern or the closing
5
+ * `esac`. The rule walks the case body honoring nested block structure so
6
+ * `)` characters inside `for ... done`, `while ... done`, `if ... fi`, and
7
+ * `$(...)` subshells are not mistaken for the next case pattern.
8
+ */
9
+ export declare const consistentCaseTerminatorsRule: RuleModule;
@@ -0,0 +1,6 @@
1
+ import type { RuleModule } from '../../types';
2
+ /**
3
+ * Enforce consistent function declaration style in shell scripts.
4
+ * Default: prefer `name() {` over `function name {` (POSIX-compatible).
5
+ */
6
+ export declare const functionStyleRule: RuleModule;
@@ -0,0 +1,7 @@
1
+ import type { RuleModule } from '../../types';
2
+ /**
3
+ * Recommend <<- (with tab stripping) for indented heredocs.
4
+ * When a heredoc is inside a function or loop, using << requires the delimiter
5
+ * to be at column 0, which breaks indentation flow.
6
+ */
7
+ export declare const heredocIndentRule: RuleModule;
@@ -0,0 +1,2 @@
1
+ import type { RuleModule } from '../../types';
2
+ export declare const indentRule: RuleModule;
@@ -0,0 +1,10 @@
1
+ import type { RuleModule } from '../../types';
2
+ /**
3
+ * Enforce proper spacing around shell keywords.
4
+ * Flags: `if(`, `then;cmd`, missing space after ; in control flow, etc.
5
+ *
6
+ * String/quote/expansion interiors are ignored via `maskShellStrings`, so
7
+ * ANSI-C escape codes such as `$'\033[0;31m'` are not misread as having a
8
+ * missing space after `;`.
9
+ */
10
+ export declare const keywordSpacingRule: RuleModule;
@@ -0,0 +1,7 @@
1
+ import type { RuleModule } from '../../types';
2
+ /**
3
+ * SC2069: Detect broken redirect ordering.
4
+ * `cmd 2>&1 > file` redirects stderr to original stdout (terminal), not the file.
5
+ * Correct: `cmd > file 2>&1` or `cmd &> file` (bash).
6
+ */
7
+ export declare const noBrokenRedirectRule: RuleModule;
@@ -0,0 +1,6 @@
1
+ import type { RuleModule } from '../../types';
2
+ /**
3
+ * SC2164: Use `cd ... || exit` or `cd ... || return` to handle cd failure.
4
+ * If `cd` fails, subsequent commands run in the wrong directory.
5
+ */
6
+ export declare const noCdWithoutCheckRule: RuleModule;
@@ -0,0 +1,6 @@
1
+ import type { RuleModule } from '../../types';
2
+ /**
3
+ * Disallow use of eval in shell scripts.
4
+ * eval is dangerous because it re-parses its arguments, leading to code injection risks.
5
+ */
6
+ export declare const noEvalRule: RuleModule;
@@ -0,0 +1,7 @@
1
+ import type { RuleModule } from '../../types';
2
+ /**
3
+ * SC2033: exit in subshell only exits the subshell, not the script.
4
+ * Code like `(cd dir && exit 1)` won't stop the parent script.
5
+ * Use return in functions, or restructure to avoid subshells.
6
+ */
7
+ export declare const noExitInSubshellRule: RuleModule;
@@ -0,0 +1,7 @@
1
+ import type { RuleModule } from '../../types';
2
+ /**
3
+ * SC2012: Don't parse the output of ls.
4
+ * ls output is not safe for parsing — filenames can contain newlines, spaces, and special chars.
5
+ * Use globs, find, or stat instead.
6
+ */
7
+ export declare const noLsParsingRule: RuleModule;
@@ -0,0 +1,6 @@
1
+ import type { RuleModule } from '../../types';
2
+ /**
3
+ * Disallow unnecessary trailing semicolons on simple commands.
4
+ * In shell, semicolons separate commands on the same line but are unnecessary at end of line.
5
+ */
6
+ export declare const noTrailingSemicolonsRule: RuleModule;
@@ -0,0 +1,5 @@
1
+ import type { RuleModule } from '../../types';
2
+ /**
3
+ * Disallow trailing whitespace in shell scripts.
4
+ */
5
+ export declare const noTrailingWhitespaceRule: RuleModule;
@@ -0,0 +1,6 @@
1
+ import type { RuleModule } from '../../types';
2
+ /**
3
+ * SC2002: Useless use of cat. Instead of `cat file | cmd`, use `cmd < file` or `cmd file`.
4
+ * Avoids spawning an unnecessary process.
5
+ */
6
+ export declare const noUselessCatRule: RuleModule;
@@ -0,0 +1,7 @@
1
+ import type { RuleModule } from '../../types';
2
+ /**
3
+ * SC2016: Expressions don't expand in single quotes.
4
+ * Detects cases where $var or ${var} appears inside single quotes,
5
+ * which likely indicates the author intended double quotes.
6
+ */
7
+ export declare const noVariableInSingleQuotesRule: RuleModule;
@@ -0,0 +1,11 @@
1
+ import type { RuleModule } from '../../types';
2
+ /**
3
+ * Enforce spaces inside test bracket expressions [ ] and [[ ]].
4
+ * Missing spaces cause syntax errors or incorrect behavior.
5
+ *
6
+ * The rule ignores `[` and `]` that appear inside strings (`'...'`, `"..."`,
7
+ * `$'...'`), parameter expansions (`${arr[@]}`, `${arr[0]}`), command
8
+ * substitutions (`$(...)`) and comments, so valid bash such as
9
+ * `${CERTS[@]}` or ANSI-C escapes like `$'\033[0;31m'` are not flagged.
10
+ */
11
+ export declare const operatorSpacingRule: RuleModule;
@@ -0,0 +1,6 @@
1
+ import type { RuleModule } from '../../types';
2
+ /**
3
+ * SC2292: Prefer [[ ]] over [ ] for tests in bash/zsh.
4
+ * [[ ]] is safer: no word splitting, no pathname expansion, supports && || and regex.
5
+ */
6
+ export declare const preferDoubleBracketsRule: RuleModule;
@@ -0,0 +1,6 @@
1
+ import type { RuleModule } from '../../types';
2
+ /**
3
+ * SC2059/SC2086: Prefer printf over echo -e / echo -n.
4
+ * echo behavior varies across shells and platforms; printf is portable and predictable.
5
+ */
6
+ export declare const preferPrintfRule: RuleModule;
@@ -0,0 +1,2 @@
1
+ import type { RuleModule } from '../../types';
2
+ export declare const quoteVariablesRule: RuleModule;
@@ -0,0 +1,8 @@
1
+ import type { RuleModule } from '../../types';
2
+ /**
3
+ * Recommend using `set -euo pipefail` for safer script execution.
4
+ * - set -e: Exit on error
5
+ * - set -u: Error on undefined variables
6
+ * - set -o pipefail: Pipe failures propagate
7
+ */
8
+ export declare const setOptionsRule: RuleModule;
@@ -0,0 +1,2 @@
1
+ import type { RuleModule } from '../../types';
2
+ export declare const shebangRule: RuleModule;
@@ -1,2 +1,2 @@
1
1
  import type { RuleModule } from '../../types';
2
- export declare const sortExportsRule: RuleModule;
2
+ export declare const sortExportsRule: RuleModule;
@@ -1,2 +1,2 @@
1
1
  import type { RuleModule } from '../../types';
2
- export declare const sortHeritageClausesRule: RuleModule;
2
+ export declare const sortHeritageClausesRule: RuleModule;
@@ -1,2 +1,2 @@
1
1
  import type { RuleModule } from '../../types';
2
- export declare const sortImportsRule: RuleModule;
2
+ export declare const sortImportsRule: RuleModule;
@@ -1,2 +1,2 @@
1
1
  import type { RuleModule } from '../../types';
2
- export declare const sortKeysRule: RuleModule;
2
+ export declare const sortKeysRule: RuleModule;
@@ -1,2 +1,2 @@
1
1
  import type { RuleModule } from '../../types';
2
- export declare const sortNamedImportsRule: RuleModule;
2
+ export declare const sortNamedImportsRule: RuleModule;
@@ -1,2 +1,2 @@
1
1
  import type { RuleModule } from '../../types';
2
- export declare const sortObjectsRule: RuleModule;
2
+ export declare const sortObjectsRule: RuleModule;
@@ -0,0 +1,5 @@
1
+ import type { RuleModule } from '../../types';
2
+ // ---------------------------------------------------------------------------
3
+ // Rule implementation
4
+ // ---------------------------------------------------------------------------
5
+ export declare const sortTailwindClassesRule: RuleModule;
@@ -1,2 +1,2 @@
1
1
  import type { RuleModule } from '../../types';
2
- export declare const arrayBracketSpacingRule: RuleModule;
2
+ export declare const arrayBracketSpacingRule: RuleModule;
@@ -1,2 +1,2 @@
1
1
  import type { RuleModule } from '../../types';
2
- export declare const arrowParensRule: RuleModule;
2
+ export declare const arrowParensRule: RuleModule;
@@ -1,2 +1,2 @@
1
1
  import type { RuleModule } from '../../types';
2
- export declare const arrowSpacingRule: RuleModule;
2
+ export declare const arrowSpacingRule: RuleModule;
@@ -1,2 +1,2 @@
1
1
  import type { RuleModule } from '../../types';
2
- export declare const blockSpacingRule: RuleModule;
2
+ export declare const blockSpacingRule: RuleModule;
@@ -7,4 +7,4 @@ import type { RuleModule } from '../../types';
7
7
  * - Closing brace on same line as next block (else, catch, finally, etc.)
8
8
  * - Opening brace on new line instead of same line
9
9
  */
10
- export declare const braceStyle: RuleModule;
10
+ export declare const braceStyle: RuleModule;
@@ -1,2 +1,2 @@
1
1
  import type { RuleModule } from '../../types';
2
- export declare const commaDangleRule: RuleModule;
2
+ export declare const commaDangleRule: RuleModule;
@@ -1,2 +1,2 @@
1
1
  import type { RuleModule } from '../../types';
2
- export declare const commaSpacingRule: RuleModule;
2
+ export declare const commaSpacingRule: RuleModule;
@@ -1,2 +1,2 @@
1
1
  import type { RuleModule } from '../../types';
2
- export declare const commaStyleRule: RuleModule;
2
+ export declare const commaStyleRule: RuleModule;
@@ -1,2 +1,2 @@
1
1
  import type { RuleModule } from '../../types';
2
- export declare const computedPropertySpacingRule: RuleModule;
2
+ export declare const computedPropertySpacingRule: RuleModule;
@@ -1,2 +1,2 @@
1
1
  import type { RuleModule } from '../../types';
2
- export declare const consistentChainingRule: RuleModule;
2
+ export declare const consistentChainingRule: RuleModule;
@@ -1,2 +1,2 @@
1
1
  import type { RuleModule } from '../../types';
2
- export declare const consistentListNewlineRule: RuleModule;
2
+ export declare const consistentListNewlineRule: RuleModule;
@@ -2,4 +2,4 @@ import type { RuleModule } from '../../types';
2
2
  // Additional pass: detect unnecessary braces around a single simple statement in else blocks
3
3
  // This is a very light heuristic to satisfy style-edge-cases expectations.
4
4
  export declare function _internal_detectUnnecessaryElseBraces(text: string, _filePath: string): Array<{ line: number, column: number, message: string }>;
5
- export declare const curlyRule: RuleModule;
5
+ export declare const curlyRule: RuleModule;
@@ -1,2 +1,2 @@
1
1
  import type { RuleModule } from '../../types';
2
- export declare const dotLocationRule: RuleModule;
2
+ export declare const dotLocationRule: RuleModule;
@@ -1,2 +1,2 @@
1
1
  import type { RuleModule } from '../../types';
2
- export declare const functionCallSpacingRule: RuleModule;
2
+ export declare const functionCallSpacingRule: RuleModule;
@@ -1,2 +1,2 @@
1
1
  import type { RuleModule } from '../../types';
2
- export declare const generatorStarSpacingRule: RuleModule;
2
+ export declare const generatorStarSpacingRule: RuleModule;
@@ -1,2 +1,2 @@
1
1
  import type { RuleModule } from '../../types';
2
- export declare const ifNewlineRule: RuleModule;
2
+ export declare const ifNewlineRule: RuleModule;
@@ -1,2 +1,2 @@
1
1
  import type { RuleModule } from '../../types';
2
- export declare const indentBinaryOpsRule: RuleModule;
2
+ export declare const indentBinaryOpsRule: RuleModule;
@@ -1,2 +1,2 @@
1
1
  import type { RuleModule } from '../../types';
2
- export declare const indentUnindentRule: RuleModule;
2
+ export declare const indentUnindentRule: RuleModule;
@@ -1,2 +1,2 @@
1
1
  import type { RuleModule } from '../../types';
2
- export declare const keySpacingRule: RuleModule;
2
+ export declare const keySpacingRule: RuleModule;
@@ -1,2 +1,2 @@
1
1
  import type { RuleModule } from '../../types';
2
- export declare const keywordSpacingRule: RuleModule;
2
+ export declare const keywordSpacingRule: RuleModule;
@@ -1,2 +1,2 @@
1
1
  import type { RuleModule } from '../../types';
2
- export declare const linesBetweenClassMembersRule: RuleModule;
2
+ export declare const linesBetweenClassMembersRule: RuleModule;
@@ -1,2 +1,2 @@
1
1
  import type { RuleModule } from '../../types';
2
- export declare const maxStatementsPerLineRule: RuleModule;
2
+ export declare const maxStatementsPerLineRule: RuleModule;
@@ -1,2 +1,2 @@
1
1
  import type { RuleModule } from '../../types';
2
- export declare const multilineTernaryRule: RuleModule;
2
+ export declare const multilineTernaryRule: RuleModule;
@@ -1,2 +1,2 @@
1
1
  import type { RuleModule } from '../../types';
2
- export declare const newParensRule: RuleModule;
2
+ export declare const newParensRule: RuleModule;
@@ -1,2 +1,2 @@
1
1
  import type { RuleModule } from '../../types';
2
- export declare const noExtraParensRule: RuleModule;
2
+ export declare const noExtraParensRule: RuleModule;
@@ -1,2 +1,2 @@
1
1
  import type { RuleModule } from '../../types';
2
- export declare const noFloatingDecimalRule: RuleModule;
2
+ export declare const noFloatingDecimalRule: RuleModule;
@@ -1,2 +1,2 @@
1
1
  import type { RuleModule } from '../../types';
2
- export declare const noMixedOperatorsRule: RuleModule;
2
+ export declare const noMixedOperatorsRule: RuleModule;
@@ -1,2 +1,2 @@
1
1
  import type { RuleModule } from '../../types';
2
- export declare const noMixedSpacesAndTabsRule: RuleModule;
2
+ export declare const noMixedSpacesAndTabsRule: RuleModule;
@@ -7,4 +7,4 @@ import type { RuleModule } from '../../types';
7
7
  * - `const x = 1` (multiple spaces before =)
8
8
  * - `foo(a, b)` (multiple spaces after comma)
9
9
  */
10
- export declare const noMultiSpaces: RuleModule;
10
+ export declare const noMultiSpaces: RuleModule;
@@ -6,4 +6,4 @@ import type { RuleModule } from '../../types';
6
6
  * Violations:
7
7
  * - More than one consecutive empty line
8
8
  */
9
- export declare const noMultipleEmptyLines: RuleModule;
9
+ export declare const noMultipleEmptyLines: RuleModule;
@@ -1,2 +1,2 @@
1
1
  import type { RuleModule } from '../../types';
2
- export declare const noTabsRule: RuleModule;
2
+ export declare const noTabsRule: RuleModule;
@@ -6,4 +6,4 @@ import type { RuleModule } from '../../types';
6
6
  * Violations:
7
7
  * - Lines ending with spaces or tabs
8
8
  */
9
- export declare const noTrailingSpaces: RuleModule;
9
+ export declare const noTrailingSpaces: RuleModule;
@@ -1,2 +1,2 @@
1
1
  import type { RuleModule } from '../../types';
2
- export declare const noWhitespaceBeforePropertyRule: RuleModule;
2
+ export declare const noWhitespaceBeforePropertyRule: RuleModule;
@@ -1,2 +1,2 @@
1
1
  import type { RuleModule } from '../../types';
2
- export declare const objectCurlySpacingRule: RuleModule;
2
+ export declare const objectCurlySpacingRule: RuleModule;
@@ -1,2 +1,2 @@
1
1
  import type { RuleModule } from '../../types';
2
- export declare const operatorLinebreakRule: RuleModule;
2
+ export declare const operatorLinebreakRule: RuleModule;
@@ -1,2 +1,2 @@
1
1
  import type { RuleModule } from '../../types';
2
- export declare const paddedBlocksRule: RuleModule;
2
+ export declare const paddedBlocksRule: RuleModule;
@@ -1,2 +1,2 @@
1
1
  import type { RuleModule } from '../../types';
2
- export declare const quotePropsRule: RuleModule;
2
+ export declare const quotePropsRule: RuleModule;
@@ -1,2 +1,2 @@
1
1
  import type { RuleModule } from '../../types';
2
- export declare const restSpreadSpacingRule: RuleModule;
2
+ export declare const restSpreadSpacingRule: RuleModule;
@@ -1,2 +1,2 @@
1
1
  import type { RuleModule } from '../../types';
2
- export declare const semiSpacingRule: RuleModule;
2
+ export declare const semiSpacingRule: RuleModule;
@@ -1,2 +1,2 @@
1
1
  import type { RuleModule } from '../../types';
2
- export declare const spaceBeforeBlocksRule: RuleModule;
2
+ export declare const spaceBeforeBlocksRule: RuleModule;
@@ -1,2 +1,2 @@
1
1
  import type { RuleModule } from '../../types';
2
- export declare const spaceBeforeFunctionParenRule: RuleModule;
2
+ export declare const spaceBeforeFunctionParenRule: RuleModule;
@@ -1,2 +1,2 @@
1
1
  import type { RuleModule } from '../../types';
2
- export declare const spaceInParensRule: RuleModule;
2
+ export declare const spaceInParensRule: RuleModule;
@@ -1,2 +1,2 @@
1
1
  import type { RuleModule } from '../../types';
2
- export declare const spaceInfixOpsRule: RuleModule;
2
+ export declare const spaceInfixOpsRule: RuleModule;
@@ -1,2 +1,2 @@
1
1
  import type { RuleModule } from '../../types';
2
- export declare const spaceUnaryOpsRule: RuleModule;
2
+ export declare const spaceUnaryOpsRule: RuleModule;
@@ -1,2 +1,2 @@
1
1
  import type { RuleModule } from '../../types';
2
- export declare const spacedCommentRule: RuleModule;
2
+ export declare const spacedCommentRule: RuleModule;
@@ -1,2 +1,2 @@
1
1
  import type { RuleModule } from '../../types';
2
- export declare const switchColonSpacingRule: RuleModule;
2
+ export declare const switchColonSpacingRule: RuleModule;
@@ -1,2 +1,2 @@
1
1
  import type { RuleModule } from '../../types';
2
- export declare const templateCurlySpacingRule: RuleModule;
2
+ export declare const templateCurlySpacingRule: RuleModule;
@@ -1,2 +1,2 @@
1
1
  import type { RuleModule } from '../../types';
2
- export declare const templateTagSpacingRule: RuleModule;
2
+ export declare const templateTagSpacingRule: RuleModule;
@@ -3,4 +3,4 @@ import type { RuleModule } from '../../types';
3
3
  // Top-level functions should be declared with `function` keyword instead of
4
4
  // `const foo = () => {}` or `const foo = function() {}` at top level.
5
5
  // We detect zero-indentation `const <id> = <fn>` patterns and report.
6
- export declare const topLevelFunctionRule: RuleModule;
6
+ export declare const topLevelFunctionRule: RuleModule;
@@ -1,2 +1,2 @@
1
1
  import type { RuleModule } from '../../types';
2
- export declare const wrapIifeRule: RuleModule;
2
+ export declare const wrapIifeRule: RuleModule;
@@ -1,2 +1,2 @@
1
1
  import type { RuleModule } from '../../types';
2
- export declare const yieldStarSpacingRule: RuleModule;
2
+ export declare const yieldStarSpacingRule: RuleModule;
@@ -1,4 +1,4 @@
1
1
  import type { RuleModule } from '../../types';
2
2
  // Match interface/type members that use commas instead of semicolons or vice versa
3
3
  // Default: semicolons in interfaces, commas or semicolons in type literals
4
- export declare const memberDelimiterStyleRule: RuleModule;
4
+ export declare const memberDelimiterStyleRule: RuleModule;
@@ -1,2 +1,2 @@
1
1
  import type { RuleModule } from '../../types';
2
- export declare const noExplicitAnyRule: RuleModule;
2
+ export declare const noExplicitAnyRule: RuleModule;
@@ -1,2 +1,2 @@
1
1
  import type { RuleModule } from '../../types';
2
- export declare const noFloatingPromisesRule: RuleModule;
2
+ export declare const noFloatingPromisesRule: RuleModule;
@@ -1,2 +1,2 @@
1
1
  import type { RuleModule } from '../../types';
2
- export declare const noMisusedPromisesRule: RuleModule;
2
+ export declare const noMisusedPromisesRule: RuleModule;
@@ -1,2 +1,2 @@
1
1
  import type { RuleModule } from '../../types';
2
- export declare const noRequireImportsRule: RuleModule;
2
+ export declare const noRequireImportsRule: RuleModule;