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.
- package/README.md +80 -459
- package/dist/ast.d.ts +4 -15
- package/dist/bin/cli.js +18409 -15891
- package/dist/config.d.ts +1 -1
- package/dist/format.d.ts +1 -1
- package/dist/formatter.d.ts +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/linter.d.ts +3 -3
- package/dist/plugins/eslint.d.ts +1 -1
- package/dist/plugins/general.d.ts +1 -1
- package/dist/plugins/index.d.ts +1 -1
- package/dist/plugins/lockfile.d.ts +1 -1
- package/dist/plugins/markdown.d.ts +1 -1
- package/dist/plugins/node.d.ts +1 -1
- package/dist/plugins/perfectionist.d.ts +1 -1
- package/dist/plugins/pickier.d.ts +1 -1
- package/dist/plugins/publint.d.ts +1 -2
- package/dist/plugins/quality.d.ts +1 -1
- package/dist/plugins/regexp.d.ts +1 -1
- package/dist/plugins/shell.d.ts +2 -0
- package/dist/plugins/spell.d.ts +3 -0
- package/dist/plugins/style.d.ts +1 -1
- package/dist/plugins/ts.d.ts +1 -1
- package/dist/plugins/unused-imports.d.ts +1 -1
- package/dist/plugins/utils.d.ts +2 -1
- package/dist/rules/general/array-callback-return.d.ts +1 -1
- package/dist/rules/general/constructor-super.d.ts +1 -1
- package/dist/rules/general/for-direction.d.ts +1 -1
- package/dist/rules/general/getter-return.d.ts +1 -1
- package/dist/rules/general/no-async-promise-executor.d.ts +1 -1
- package/dist/rules/general/no-compare-neg-zero.d.ts +1 -1
- package/dist/rules/general/no-cond-assign.d.ts +1 -1
- package/dist/rules/general/no-const-assign.d.ts +1 -1
- package/dist/rules/general/no-constant-condition.d.ts +1 -1
- package/dist/rules/general/no-constructor-return.d.ts +1 -1
- package/dist/rules/general/no-dupe-class-members.d.ts +1 -1
- package/dist/rules/general/no-dupe-keys.d.ts +1 -1
- package/dist/rules/general/no-duplicate-case.d.ts +1 -1
- package/dist/rules/general/no-empty-pattern.d.ts +1 -1
- package/dist/rules/general/no-fallthrough.d.ts +1 -1
- package/dist/rules/general/no-irregular-whitespace.d.ts +1 -1
- package/dist/rules/general/no-loss-of-precision.d.ts +1 -1
- package/dist/rules/general/no-new.d.ts +1 -1
- package/dist/rules/general/no-promise-executor-return.d.ts +1 -1
- package/dist/rules/general/no-redeclare.d.ts +1 -1
- package/dist/rules/general/no-regex-spaces.d.ts +1 -1
- package/dist/rules/general/no-self-assign.d.ts +1 -1
- package/dist/rules/general/no-self-compare.d.ts +1 -1
- package/dist/rules/general/no-sparse-arrays.d.ts +1 -1
- package/dist/rules/general/no-undef.d.ts +1 -1
- package/dist/rules/general/no-unreachable.d.ts +1 -1
- package/dist/rules/general/no-unsafe-negation.d.ts +1 -1
- package/dist/rules/general/no-unused-vars.d.ts +1 -1
- package/dist/rules/general/no-useless-catch.d.ts +1 -1
- package/dist/rules/general/prefer-const.d.ts +1 -1
- package/dist/rules/general/prefer-object-spread.d.ts +1 -1
- package/dist/rules/general/prefer-template.d.ts +1 -1
- package/dist/rules/general/use-isnan.d.ts +1 -1
- package/dist/rules/general/valid-typeof.d.ts +1 -1
- package/dist/rules/imports/first.d.ts +1 -1
- package/dist/rules/imports/import-dedupe.d.ts +1 -1
- package/dist/rules/imports/named.d.ts +1 -1
- package/dist/rules/imports/no-cycle.d.ts +1 -1
- package/dist/rules/imports/no-duplicate-imports.d.ts +1 -1
- package/dist/rules/imports/no-import-dist.d.ts +1 -1
- package/dist/rules/imports/no-import-node-modules-by-path.d.ts +1 -1
- package/dist/rules/imports/no-unresolved.d.ts +1 -1
- package/dist/rules/lockfile/index.d.ts +1 -1
- package/dist/rules/lockfile/parser.d.ts +1 -1
- package/dist/rules/lockfile/validate-host.d.ts +1 -2
- package/dist/rules/lockfile/validate-https.d.ts +1 -1
- package/dist/rules/lockfile/validate-integrity.d.ts +1 -1
- package/dist/rules/lockfile/validate-package-names.d.ts +1 -1
- package/dist/rules/lockfile/validate-scheme.d.ts +1 -1
- package/dist/rules/markdown/blanks-around-fences.d.ts +1 -1
- package/dist/rules/markdown/blanks-around-headings.d.ts +1 -1
- package/dist/rules/markdown/blanks-around-lists.d.ts +1 -1
- package/dist/rules/markdown/blanks-around-tables.d.ts +1 -1
- package/dist/rules/markdown/code-block-style.d.ts +1 -1
- package/dist/rules/markdown/code-fence-style.d.ts +1 -1
- package/dist/rules/markdown/commands-show-output.d.ts +1 -1
- package/dist/rules/markdown/descriptive-link-text.d.ts +1 -1
- package/dist/rules/markdown/emphasis-style.d.ts +1 -1
- package/dist/rules/markdown/fenced-code-language.d.ts +1 -1
- package/dist/rules/markdown/first-line-heading.d.ts +1 -1
- package/dist/rules/markdown/heading-increment.d.ts +1 -1
- package/dist/rules/markdown/heading-start-left.d.ts +1 -1
- package/dist/rules/markdown/heading-style.d.ts +1 -1
- package/dist/rules/markdown/hr-style.d.ts +1 -1
- package/dist/rules/markdown/line-length.d.ts +1 -1
- package/dist/rules/markdown/link-fragments.d.ts +1 -1
- package/dist/rules/markdown/link-image-reference-definitions.d.ts +1 -1
- package/dist/rules/markdown/link-image-style.d.ts +1 -1
- package/dist/rules/markdown/list-indent.d.ts +1 -1
- package/dist/rules/markdown/list-marker-space.d.ts +1 -1
- package/dist/rules/markdown/no-alt-text.d.ts +1 -1
- package/dist/rules/markdown/no-bare-urls.d.ts +1 -1
- package/dist/rules/markdown/no-blanks-blockquote.d.ts +1 -1
- package/dist/rules/markdown/no-duplicate-heading.d.ts +1 -1
- package/dist/rules/markdown/no-emphasis-as-heading.d.ts +5 -1
- package/dist/rules/markdown/no-empty-links.d.ts +1 -1
- package/dist/rules/markdown/no-hard-tabs.d.ts +1 -1
- package/dist/rules/markdown/no-inline-html.d.ts +1 -1
- package/dist/rules/markdown/no-missing-space-atx.d.ts +1 -1
- package/dist/rules/markdown/no-missing-space-closed-atx.d.ts +1 -1
- package/dist/rules/markdown/no-multiple-blanks.d.ts +1 -1
- package/dist/rules/markdown/no-multiple-space-atx.d.ts +1 -1
- package/dist/rules/markdown/no-multiple-space-blockquote.d.ts +1 -1
- package/dist/rules/markdown/no-multiple-space-closed-atx.d.ts +1 -1
- package/dist/rules/markdown/no-reversed-links.d.ts +1 -1
- package/dist/rules/markdown/no-space-in-code.d.ts +1 -1
- package/dist/rules/markdown/no-space-in-emphasis.d.ts +1 -1
- package/dist/rules/markdown/no-space-in-links.d.ts +1 -1
- package/dist/rules/markdown/no-trailing-punctuation.d.ts +1 -1
- package/dist/rules/markdown/no-trailing-spaces.d.ts +1 -1
- package/dist/rules/markdown/ol-prefix.d.ts +1 -1
- package/dist/rules/markdown/proper-names.d.ts +1 -1
- package/dist/rules/markdown/reference-links-images.d.ts +10 -1
- package/dist/rules/markdown/required-headings.d.ts +1 -1
- package/dist/rules/markdown/single-title.d.ts +1 -1
- package/dist/rules/markdown/single-trailing-newline.d.ts +1 -1
- package/dist/rules/markdown/strong-style.d.ts +1 -1
- package/dist/rules/markdown/table-column-count.d.ts +1 -1
- package/dist/rules/markdown/table-column-style.d.ts +1 -1
- package/dist/rules/markdown/table-pipe-style.d.ts +1 -1
- package/dist/rules/markdown/ul-indent.d.ts +10 -1
- package/dist/rules/markdown/ul-style.d.ts +1 -1
- package/dist/rules/node/prefer-global-buffer.d.ts +1 -1
- package/dist/rules/node/prefer-global-process.d.ts +1 -1
- package/dist/rules/publint/bin-file-not-executable.d.ts +1 -1
- package/dist/rules/publint/deprecated-field-jsnext.d.ts +1 -1
- package/dist/rules/publint/exports-default-should-be-last.d.ts +1 -1
- package/dist/rules/publint/exports-fallback-array-use.d.ts +1 -1
- package/dist/rules/publint/exports-missing-root-entrypoint.d.ts +1 -1
- package/dist/rules/publint/exports-module-should-be-esm.d.ts +1 -1
- package/dist/rules/publint/exports-module-should-precede-require.d.ts +1 -1
- package/dist/rules/publint/exports-types-should-be-first.d.ts +1 -1
- package/dist/rules/publint/exports-value-invalid.d.ts +1 -1
- package/dist/rules/publint/field-invalid-value-type.d.ts +1 -1
- package/dist/rules/publint/file-does-not-exist.d.ts +1 -1
- package/dist/rules/publint/file-invalid-format.d.ts +1 -1
- package/dist/rules/publint/has-module-but-no-exports.d.ts +1 -1
- package/dist/rules/publint/imports-default-should-be-last.d.ts +1 -1
- package/dist/rules/publint/imports-key-invalid.d.ts +1 -1
- package/dist/rules/publint/imports-module-should-precede-require.d.ts +1 -1
- package/dist/rules/publint/imports-value-invalid.d.ts +1 -1
- package/dist/rules/publint/index.d.ts +13 -11
- package/dist/rules/publint/local-dependency.d.ts +1 -1
- package/dist/rules/publint/module-should-be-esm.d.ts +1 -1
- package/dist/rules/publint/use-type.d.ts +1 -1
- package/dist/rules/publint/utils.d.ts +2 -2
- package/dist/rules/quality/complexity.d.ts +1 -1
- package/dist/rules/quality/default-case.d.ts +1 -1
- package/dist/rules/quality/eqeqeq.d.ts +1 -1
- package/dist/rules/quality/max-depth.d.ts +1 -1
- package/dist/rules/quality/max-lines-per-function.d.ts +1 -1
- package/dist/rules/quality/no-alert.d.ts +1 -1
- package/dist/rules/quality/no-await-in-loop.d.ts +1 -1
- package/dist/rules/quality/no-caller.d.ts +1 -1
- package/dist/rules/quality/no-case-declarations.d.ts +1 -1
- package/dist/rules/quality/no-else-return.d.ts +1 -1
- package/dist/rules/quality/no-empty-function.d.ts +1 -1
- package/dist/rules/quality/no-empty.d.ts +1 -1
- package/dist/rules/quality/no-eval.d.ts +1 -1
- package/dist/rules/quality/no-extend-native.d.ts +1 -1
- package/dist/rules/quality/no-extra-boolean-cast.d.ts +1 -1
- package/dist/rules/quality/no-global-assign.d.ts +1 -1
- package/dist/rules/quality/no-implied-eval.d.ts +1 -1
- package/dist/rules/quality/no-iterator.d.ts +1 -1
- package/dist/rules/quality/no-lonely-if.d.ts +1 -1
- package/dist/rules/quality/no-new-func.d.ts +1 -1
- package/dist/rules/quality/no-new-wrappers.d.ts +1 -1
- package/dist/rules/quality/no-new.d.ts +1 -1
- package/dist/rules/quality/no-octal.d.ts +1 -1
- package/dist/rules/quality/no-param-reassign.d.ts +1 -1
- package/dist/rules/quality/no-proto.d.ts +1 -1
- package/dist/rules/quality/no-return-assign.d.ts +1 -1
- package/dist/rules/quality/no-sequences.d.ts +1 -1
- package/dist/rules/quality/no-shadow.d.ts +1 -1
- package/dist/rules/quality/no-throw-literal.d.ts +1 -1
- package/dist/rules/quality/no-use-before-define.d.ts +1 -1
- package/dist/rules/quality/no-useless-call.d.ts +1 -1
- package/dist/rules/quality/no-useless-concat.d.ts +1 -1
- package/dist/rules/quality/no-useless-escape.d.ts +1 -1
- package/dist/rules/quality/no-useless-rename.d.ts +1 -1
- package/dist/rules/quality/no-useless-return.d.ts +1 -1
- package/dist/rules/quality/no-var.d.ts +1 -1
- package/dist/rules/quality/no-with.d.ts +1 -1
- package/dist/rules/quality/prefer-arrow-callback.d.ts +1 -1
- package/dist/rules/quality/require-await.d.ts +1 -1
- package/dist/rules/regexp/no-super-linear-backtracking.d.ts +1 -1
- package/dist/rules/regexp/no-unused-capturing-group.d.ts +1 -1
- package/dist/rules/regexp/no-useless-lazy.d.ts +1 -1
- package/dist/rules/shell/_shared.d.ts +24 -0
- package/dist/rules/shell/command-substitution.d.ts +6 -0
- package/dist/rules/shell/consistent-case-terminators.d.ts +9 -0
- package/dist/rules/shell/function-style.d.ts +6 -0
- package/dist/rules/shell/heredoc-indent.d.ts +7 -0
- package/dist/rules/shell/indent.d.ts +2 -0
- package/dist/rules/shell/keyword-spacing.d.ts +10 -0
- package/dist/rules/shell/no-broken-redirect.d.ts +7 -0
- package/dist/rules/shell/no-cd-without-check.d.ts +6 -0
- package/dist/rules/shell/no-eval.d.ts +6 -0
- package/dist/rules/shell/no-exit-in-subshell.d.ts +7 -0
- package/dist/rules/shell/no-ls-parsing.d.ts +7 -0
- package/dist/rules/shell/no-trailing-semicolons.d.ts +6 -0
- package/dist/rules/shell/no-trailing-whitespace.d.ts +5 -0
- package/dist/rules/shell/no-useless-cat.d.ts +6 -0
- package/dist/rules/shell/no-variable-in-single-quotes.d.ts +7 -0
- package/dist/rules/shell/operator-spacing.d.ts +11 -0
- package/dist/rules/shell/prefer-double-brackets.d.ts +6 -0
- package/dist/rules/shell/prefer-printf.d.ts +6 -0
- package/dist/rules/shell/quote-variables.d.ts +2 -0
- package/dist/rules/shell/set-options.d.ts +8 -0
- package/dist/rules/shell/shebang.d.ts +2 -0
- package/dist/rules/sort/exports.d.ts +1 -1
- package/dist/rules/sort/heritage-clauses.d.ts +1 -1
- package/dist/rules/sort/imports.d.ts +1 -1
- package/dist/rules/sort/keys.d.ts +1 -1
- package/dist/rules/sort/named-imports.d.ts +1 -1
- package/dist/rules/sort/objects.d.ts +1 -1
- package/dist/rules/sort/tailwind-classes.d.ts +5 -0
- package/dist/rules/style/array-bracket-spacing.d.ts +1 -1
- package/dist/rules/style/arrow-parens.d.ts +1 -1
- package/dist/rules/style/arrow-spacing.d.ts +1 -1
- package/dist/rules/style/block-spacing.d.ts +1 -1
- package/dist/rules/style/brace-style.d.ts +1 -1
- package/dist/rules/style/comma-dangle.d.ts +1 -1
- package/dist/rules/style/comma-spacing.d.ts +1 -1
- package/dist/rules/style/comma-style.d.ts +1 -1
- package/dist/rules/style/computed-property-spacing.d.ts +1 -1
- package/dist/rules/style/consistent-chaining.d.ts +1 -1
- package/dist/rules/style/consistent-list-newline.d.ts +1 -1
- package/dist/rules/style/curly.d.ts +1 -1
- package/dist/rules/style/dot-location.d.ts +1 -1
- package/dist/rules/style/function-call-spacing.d.ts +1 -1
- package/dist/rules/style/generator-star-spacing.d.ts +1 -1
- package/dist/rules/style/if-newline.d.ts +1 -1
- package/dist/rules/style/indent-binary-ops.d.ts +1 -1
- package/dist/rules/style/indent-unindent.d.ts +1 -1
- package/dist/rules/style/key-spacing.d.ts +1 -1
- package/dist/rules/style/keyword-spacing.d.ts +1 -1
- package/dist/rules/style/lines-between-class-members.d.ts +1 -1
- package/dist/rules/style/max-statements-per-line.d.ts +1 -1
- package/dist/rules/style/multiline-ternary.d.ts +1 -1
- package/dist/rules/style/new-parens.d.ts +1 -1
- package/dist/rules/style/no-extra-parens.d.ts +1 -1
- package/dist/rules/style/no-floating-decimal.d.ts +1 -1
- package/dist/rules/style/no-mixed-operators.d.ts +1 -1
- package/dist/rules/style/no-mixed-spaces-and-tabs.d.ts +1 -1
- package/dist/rules/style/no-multi-spaces.d.ts +1 -1
- package/dist/rules/style/no-multiple-empty-lines.d.ts +1 -1
- package/dist/rules/style/no-tabs.d.ts +1 -1
- package/dist/rules/style/no-trailing-spaces.d.ts +1 -1
- package/dist/rules/style/no-whitespace-before-property.d.ts +1 -1
- package/dist/rules/style/object-curly-spacing.d.ts +1 -1
- package/dist/rules/style/operator-linebreak.d.ts +1 -1
- package/dist/rules/style/padded-blocks.d.ts +1 -1
- package/dist/rules/style/quote-props.d.ts +1 -1
- package/dist/rules/style/rest-spread-spacing.d.ts +1 -1
- package/dist/rules/style/semi-spacing.d.ts +1 -1
- package/dist/rules/style/space-before-blocks.d.ts +1 -1
- package/dist/rules/style/space-before-function-paren.d.ts +1 -1
- package/dist/rules/style/space-in-parens.d.ts +1 -1
- package/dist/rules/style/space-infix-ops.d.ts +1 -1
- package/dist/rules/style/space-unary-ops.d.ts +1 -1
- package/dist/rules/style/spaced-comment.d.ts +1 -1
- package/dist/rules/style/switch-colon-spacing.d.ts +1 -1
- package/dist/rules/style/template-curly-spacing.d.ts +1 -1
- package/dist/rules/style/template-tag-spacing.d.ts +1 -1
- package/dist/rules/style/top-level-function.d.ts +1 -1
- package/dist/rules/style/wrap-iife.d.ts +1 -1
- package/dist/rules/style/yield-star-spacing.d.ts +1 -1
- package/dist/rules/ts/member-delimiter-style.d.ts +1 -1
- package/dist/rules/ts/no-explicit-any.d.ts +1 -1
- package/dist/rules/ts/no-floating-promises.d.ts +1 -1
- package/dist/rules/ts/no-misused-promises.d.ts +1 -1
- package/dist/rules/ts/no-require-imports.d.ts +1 -1
- package/dist/rules/ts/no-top-level-await.d.ts +1 -1
- package/dist/rules/ts/no-ts-export-equal.d.ts +1 -1
- package/dist/rules/ts/no-unsafe-assignment.d.ts +1 -1
- package/dist/rules/ts/prefer-nullish-coalescing.d.ts +1 -1
- package/dist/rules/ts/prefer-optional-chain.d.ts +1 -1
- package/dist/rules/ts/type-annotation-spacing.d.ts +1 -1
- package/dist/rules/ts/type-generic-spacing.d.ts +1 -1
- package/dist/rules/ts/type-named-tuple-spacing.d.ts +1 -1
- package/dist/run.d.ts +1 -1
- package/dist/src/index.js +11768 -11309
- package/dist/types.d.ts +21 -4
- package/dist/utils.d.ts +36 -11
- package/package.json +16 -8
package/README.md
CHANGED
|
@@ -1,488 +1,109 @@
|
|
|
1
|
-
|
|
1
|
+
# pickier
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
[![GitHub Actions][github-actions-src]][github-actions-href]
|
|
5
|
-
<!-- [![npm downloads][npm-downloads-src]][npm-downloads-href] -->
|
|
6
|
-
<!-- [![Codecov][codecov-src]][codecov-href] -->
|
|
3
|
+
Format, lint, and more in a fraction of a second.
|
|
7
4
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
> Fast linting and formatting. Minimal defaults. Extensible. Built for speed.
|
|
11
|
-
|
|
12
|
-
## Features
|
|
13
|
-
|
|
14
|
-
- Fast CLI with instant feedback
|
|
15
|
-
- Lint and format in one tool
|
|
16
|
-
- Zero-config defaults; simple, typed `pickier.config.ts` when you need it
|
|
17
|
-
- Import organization: splits type/value imports, sorts modules/specifiers, removes unused named imports
|
|
18
|
-
- JSON and config sorting for common files _(e.g. `package.json`, `tsconfig.json`)_
|
|
19
|
-
- **Markdown linting with 53+ rules** for documentation quality _(headings, lists, links, code blocks, tables, etc.)_
|
|
20
|
-
- 27 rules support auto-fix for common formatting issues
|
|
21
|
-
- Flexible formatting: `indent`, `indentStyle` _(tabs or spaces)_, `quotes`, `semi`, `trimTrailingWhitespace`, `maxConsecutiveBlankLines`, `finalNewline`
|
|
22
|
-
- Smart whitespace cleanup
|
|
23
|
-
- **Package.json validation with 20 publint rules** for correct npm publishing _(exports ordering, file format, module system, etc.)_
|
|
24
|
-
- ESLint-style plugin system for lint rules _(load plugins, enable/disable rules, WIP labeling)_
|
|
25
|
-
- CI-friendly reporters _(stylish, compact, JSON)_ and strict `--max-warnings` control
|
|
26
|
-
- Programmatic API for custom tooling and editor integrations
|
|
27
|
-
|
|
28
|
-
## Install
|
|
5
|
+
## Installation
|
|
29
6
|
|
|
30
7
|
```bash
|
|
31
|
-
# as a dev dependency
|
|
32
8
|
bun add -D pickier
|
|
33
|
-
|
|
34
|
-
# or
|
|
35
|
-
npm i -D pickier
|
|
36
|
-
|
|
37
|
-
# or
|
|
38
|
-
pnpm add -D pickier
|
|
39
|
-
|
|
40
|
-
# or
|
|
41
|
-
yarn add -D pickier
|
|
42
9
|
```
|
|
43
10
|
|
|
44
|
-
You can also run it directly via npx without installing:
|
|
45
|
-
|
|
46
11
|
```bash
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
# or
|
|
50
|
-
bunx pickier --help
|
|
51
|
-
```
|
|
52
|
-
|
|
53
|
-
## Quick Start
|
|
54
|
-
|
|
55
|
-
```bash
|
|
56
|
-
# Lint your project
|
|
57
|
-
pickier .
|
|
58
|
-
|
|
59
|
-
# Auto-fix lint issues
|
|
60
|
-
pickier . --fix
|
|
61
|
-
|
|
62
|
-
# Format files
|
|
63
|
-
pickier . --format
|
|
64
|
-
|
|
65
|
-
# Check formatting without writing (CI-friendly)
|
|
66
|
-
pickier . --format --check
|
|
67
|
-
|
|
68
|
-
# Preview fixes without writing
|
|
69
|
-
pickier . --fix --dry-run
|
|
12
|
+
npm install -D pickier
|
|
70
13
|
```
|
|
71
14
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
## CLI
|
|
75
|
-
|
|
76
|
-
### `pickier [...globs]`
|
|
77
|
-
|
|
78
|
-
Lints by default. Add `--fix` to auto-fix or `--format` to format files.
|
|
15
|
+
## Usage
|
|
79
16
|
|
|
80
17
|
```bash
|
|
81
|
-
#
|
|
82
|
-
pickier .
|
|
83
|
-
pickier lint .
|
|
84
|
-
|
|
85
|
-
# These are equivalent:
|
|
86
|
-
pickier . --fix
|
|
18
|
+
# Lint files
|
|
87
19
|
pickier lint . --fix
|
|
88
20
|
|
|
89
|
-
#
|
|
90
|
-
pickier . --format
|
|
21
|
+
# Format files
|
|
91
22
|
pickier format . --write
|
|
92
|
-
```
|
|
93
|
-
|
|
94
|
-
### `pickier lint [...globs]`
|
|
95
|
-
|
|
96
|
-
Lint files.
|
|
97
|
-
|
|
98
|
-
| Flag | Description | Default |
|
|
99
|
-
|------|-------------|---------|
|
|
100
|
-
| `--fix` | Auto-fix problems | `false` |
|
|
101
|
-
| `--dry-run` | Simulate fixes without writing | `false` |
|
|
102
|
-
| `--max-warnings <n>` | Fail if warnings exceed _n_ | `-1` |
|
|
103
|
-
| `--reporter <name>` | `stylish`, `json`, or `compact` | `stylish` |
|
|
104
|
-
| `--ext <exts>` | Comma-separated extensions (overrides config) | — |
|
|
105
|
-
| `--ignore-path <file>` | Optional ignore file (e.g. `.gitignore`) | — |
|
|
106
|
-
| `--config <path>` | Path to pickier config file | — |
|
|
107
|
-
| `--cache` | Enable cache (reserved) | `false` |
|
|
108
|
-
| `--verbose` | Verbose output | `false` |
|
|
109
|
-
|
|
110
|
-
### `pickier format [...globs]`
|
|
111
|
-
|
|
112
|
-
Format files.
|
|
113
|
-
|
|
114
|
-
| Flag | Description | Default |
|
|
115
|
-
|------|-------------|---------|
|
|
116
|
-
| `--write` | Write changes to files | `false` |
|
|
117
|
-
| `--check` | Check without writing, non-zero exit on differences (CI-friendly) | `false` |
|
|
118
|
-
| `--ext <exts>` | Comma-separated extensions (overrides config) | — |
|
|
119
|
-
| `--ignore-path <file>` | Optional ignore file (e.g. `.gitignore`) | — |
|
|
120
|
-
| `--config <path>` | Path to pickier config file | — |
|
|
121
|
-
| `--verbose` | Verbose output | `false` |
|
|
122
|
-
|
|
123
|
-
### `pickier run [...globs]`
|
|
124
|
-
|
|
125
|
-
Unified command that routes to lint or format based on `--mode`.
|
|
126
|
-
|
|
127
|
-
| Flag | Description | Default |
|
|
128
|
-
|------|-------------|---------|
|
|
129
|
-
| `--mode <mode>` | `auto`, `lint`, or `format` | `auto` |
|
|
130
|
-
|
|
131
|
-
Accepts all flags from both `lint` and `format`. Useful for scripts that need explicit mode control.
|
|
132
|
-
|
|
133
|
-
## Configuration
|
|
134
|
-
|
|
135
|
-
Pickier works out-of-the-box. To customize, create `pickier.config.ts` in your project root. All fields are optional.
|
|
136
|
-
|
|
137
|
-
```ts
|
|
138
|
-
// pickier.config.ts
|
|
139
|
-
import type { PickierConfig } from 'pickier'
|
|
140
|
-
|
|
141
|
-
const config: PickierConfig = {
|
|
142
|
-
verbose: false,
|
|
143
|
-
ignores: ['**/node_modules/**', '**/dist/**', '**/build/**'],
|
|
144
|
-
|
|
145
|
-
lint: {
|
|
146
|
-
// which extensions to lint ('.ts' or 'ts' both supported)
|
|
147
|
-
extensions: ['ts', 'js'],
|
|
148
|
-
// stylish | json | compact
|
|
149
|
-
reporter: 'stylish',
|
|
150
|
-
// reserved (not used yet)
|
|
151
|
-
cache: false,
|
|
152
|
-
// -1 disables, otherwise fail when warnings > maxWarnings
|
|
153
|
-
maxWarnings: -1,
|
|
154
|
-
},
|
|
155
|
-
|
|
156
|
-
format: {
|
|
157
|
-
// which extensions to format
|
|
158
|
-
extensions: ['ts', 'js', 'json', 'md', 'yaml', 'yml'],
|
|
159
|
-
trimTrailingWhitespace: true,
|
|
160
|
-
maxConsecutiveBlankLines: 1,
|
|
161
|
-
// one | two | none
|
|
162
|
-
finalNewline: 'one',
|
|
163
|
-
// indentation width (code files)
|
|
164
|
-
indent: 2,
|
|
165
|
-
// 'spaces' | 'tabs'
|
|
166
|
-
indentStyle: 'spaces',
|
|
167
|
-
// preferred string quotes: 'single' | 'double'
|
|
168
|
-
quotes: 'single',
|
|
169
|
-
// when true, safely remove stylistic semicolons
|
|
170
|
-
// (never touches for(;;) headers; removes duplicate/empty semicolons)
|
|
171
|
-
semi: false,
|
|
172
|
-
},
|
|
173
|
-
|
|
174
|
-
rules: {
|
|
175
|
-
// 'off' | 'warn' | 'error'
|
|
176
|
-
noDebugger: 'error',
|
|
177
|
-
noConsole: 'warn',
|
|
178
|
-
},
|
|
179
|
-
|
|
180
|
-
// Plugin rules for markdown, style, sorting, etc.
|
|
181
|
-
pluginRules: {
|
|
182
|
-
// Markdown linting (53+ rules available)
|
|
183
|
-
'markdown/heading-increment': 'error',
|
|
184
|
-
'markdown/no-trailing-spaces': 'error',
|
|
185
|
-
'markdown/fenced-code-language': 'error',
|
|
186
|
-
'markdown/no-duplicate-heading': 'warn',
|
|
187
|
-
},
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
export default config
|
|
191
|
-
```
|
|
192
|
-
|
|
193
|
-
### Plugin System
|
|
194
|
-
|
|
195
|
-
Pickier supports an ESLint-style plugin system for lint rules organized into focused categories.
|
|
196
|
-
|
|
197
|
-
**Available Plugins:**
|
|
198
|
-
|
|
199
|
-
| Plugin | Description | Rules |
|
|
200
|
-
|--------|-------------|-------|
|
|
201
|
-
| `pickier/` | Sorting, import organization, and core checks | 17+ |
|
|
202
|
-
| `general/` | Error detection and possible problems | 35+ |
|
|
203
|
-
| `quality/` | Best practices and code quality | 40+ |
|
|
204
|
-
| `style/` | Code style enforcement (spacing, punctuation, line breaks, etc.) | 50+ |
|
|
205
|
-
| `ts/` | TypeScript-specific rules (type safety, formatting) | 13+ |
|
|
206
|
-
| `regexp/` | Regular expression safety | 3+ |
|
|
207
|
-
| `markdown/` | Markdown documentation linting | 53+ |
|
|
208
|
-
| `publint/` | Package.json validation for npm publishing ([publint](https://publint.dev) rules) | 20 |
|
|
209
|
-
| `lockfile/` | Lock file validation | 5+ |
|
|
210
|
-
|
|
211
|
-
Configure rules via `pluginRules`:
|
|
212
|
-
|
|
213
|
-
```ts
|
|
214
|
-
pluginRules: {
|
|
215
|
-
'pluginName/ruleId': 'off' | 'warn' | 'error' | ['warn', options],
|
|
216
|
-
}
|
|
217
|
-
```
|
|
218
|
-
|
|
219
|
-
**Custom Plugin Example:**
|
|
220
|
-
|
|
221
|
-
```ts
|
|
222
|
-
// sample-plugin.ts
|
|
223
|
-
import type { PickierPlugin, RuleContext } from 'pickier'
|
|
224
|
-
|
|
225
|
-
export const samplePlugin: PickierPlugin = {
|
|
226
|
-
name: 'sample',
|
|
227
|
-
rules: {
|
|
228
|
-
'no-todo': {
|
|
229
|
-
meta: { docs: 'disallow TODO comments', recommended: true },
|
|
230
|
-
check(content: string, ctx: RuleContext) {
|
|
231
|
-
const issues = []
|
|
232
|
-
const lines = content.split(/\r?\n/)
|
|
233
|
-
for (let i = 0; i < lines.length; i++) {
|
|
234
|
-
const col = lines[i].indexOf('TODO')
|
|
235
|
-
if (col !== -1) {
|
|
236
|
-
issues.push({
|
|
237
|
-
filePath: ctx.filePath,
|
|
238
|
-
line: i + 1,
|
|
239
|
-
column: col + 1,
|
|
240
|
-
ruleId: 'sample/no-todo',
|
|
241
|
-
message: 'Unexpected TODO comment.',
|
|
242
|
-
severity: 'warning',
|
|
243
|
-
})
|
|
244
|
-
}
|
|
245
|
-
}
|
|
246
|
-
return issues
|
|
247
|
-
},
|
|
248
|
-
},
|
|
249
|
-
'experimental-check': {
|
|
250
|
-
meta: { wip: true },
|
|
251
|
-
check() {
|
|
252
|
-
// not implemented yet — WIP rules surface errors with a :wip-error suffix
|
|
253
|
-
throw new Error('WIP rule')
|
|
254
|
-
},
|
|
255
|
-
},
|
|
256
|
-
},
|
|
257
|
-
}
|
|
258
|
-
```
|
|
259
|
-
|
|
260
|
-
**Register the plugin in your config:**
|
|
261
|
-
|
|
262
|
-
```ts
|
|
263
|
-
// pickier.config.ts
|
|
264
|
-
import type { PickierConfig } from 'pickier'
|
|
265
|
-
import { samplePlugin } from './sample-plugin'
|
|
266
|
-
|
|
267
|
-
const config: PickierConfig = {
|
|
268
|
-
plugins: [samplePlugin],
|
|
269
|
-
pluginRules: {
|
|
270
|
-
'sample/no-todo': 'warn',
|
|
271
|
-
'sample/experimental-check': 'error',
|
|
272
|
-
},
|
|
273
|
-
}
|
|
274
|
-
|
|
275
|
-
export default config
|
|
276
|
-
```
|
|
277
|
-
|
|
278
|
-
### Formatting Details
|
|
279
|
-
|
|
280
|
-
**Semicolons**
|
|
281
|
-
|
|
282
|
-
Controlled by `format.semi` (default `false`). When `true`, Pickier safely removes only stylistic semicolons:
|
|
283
|
-
|
|
284
|
-
- Preserves `for (init; test; update)` headers
|
|
285
|
-
- Removes duplicate trailing semicolons (e.g. `foo();;` -> `foo();`)
|
|
286
|
-
- Removes lines that are just empty statements (`;`)
|
|
287
|
-
- Keeps normal end-of-line semicolons otherwise (non-destructive)
|
|
288
|
-
|
|
289
|
-
**Imports (TypeScript/JavaScript)**
|
|
290
|
-
|
|
291
|
-
Groups and rewrites the top import block:
|
|
292
|
-
|
|
293
|
-
- Splits type-only specifiers into `import type { ... } from 'x'`
|
|
294
|
-
- Keeps default and namespace imports
|
|
295
|
-
- Removes unused named specifiers (only when they have no alias)
|
|
296
|
-
- Merges multiple imports from the same module
|
|
297
23
|
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
- For modules: external before relative
|
|
302
|
-
- For specifiers: A-Z by identifier
|
|
303
|
-
|
|
304
|
-
Spacing:
|
|
305
|
-
|
|
306
|
-
- Ensures a single blank line between the import block and the rest of the file
|
|
307
|
-
- Respects `format.finalNewline` at EOF
|
|
308
|
-
|
|
309
|
-
**Built-in Rules**
|
|
310
|
-
|
|
311
|
-
- `noDebugger` — removes `debugger` statements when `--fix` is used
|
|
312
|
-
- `noConsole` — controls severity (turn off for libraries that allow console logs)
|
|
313
|
-
|
|
314
|
-
## Benchmarks
|
|
315
|
-
|
|
316
|
-
Measured on an Apple M3 Pro with Bun 1.3.9. Each tool uses equivalent settings (single quotes, no semicolons, 2-space indent). Pickier and Prettier use their in-memory APIs; oxfmt and Biome have no JS formatting API, so they are called via stdin pipe. Full benchmark source is in `bechmarks/benchmarks/format-comparison.bench.ts`.
|
|
317
|
-
|
|
318
|
-
### In-memory / Programmatic API
|
|
319
|
-
|
|
320
|
-
Pickier `formatCode()` and Prettier `format()` run in-process. oxfmt and Biome are piped via stdin (no JS formatting API).
|
|
321
|
-
|
|
322
|
-
| File | Pickier | Biome (stdin) | oxfmt (stdin) | Prettier |
|
|
323
|
-
|------|--------:|--------------:|--------------:|---------:|
|
|
324
|
-
| Small (52 lines, 1 KB) | **41 us** | 40 ms | 51 ms | 1.59 ms |
|
|
325
|
-
| Medium (419 lines, 10 KB) | **417 us** | 42 ms | 50 ms | 10.2 ms |
|
|
326
|
-
| Large (1,279 lines, 31 KB) | **1.25 ms** | 46 ms | 50 ms | 28.1 ms |
|
|
327
|
-
|
|
328
|
-
### CLI (single file)
|
|
329
|
-
|
|
330
|
-
All four tools spawn a process and read the file from disk.
|
|
331
|
-
|
|
332
|
-
| File | Pickier | Biome | oxfmt | Prettier |
|
|
333
|
-
|------|--------:|------:|------:|---------:|
|
|
334
|
-
| Small (52 lines) | **37 ms** | 43 ms | 68 ms | 105 ms |
|
|
335
|
-
| Medium (419 lines) | **38 ms** | 53 ms | 71 ms | 143 ms |
|
|
336
|
-
| Large (1,279 lines) | **40 ms** | 90 ms | 73 ms | 187 ms |
|
|
337
|
-
|
|
338
|
-
### CLI Batch (all files, sequential)
|
|
339
|
-
|
|
340
|
-
| Tool | Time |
|
|
341
|
-
|------|-----:|
|
|
342
|
-
| Pickier | **121 ms** |
|
|
343
|
-
| Biome | 187 ms |
|
|
344
|
-
| oxfmt | 216 ms |
|
|
345
|
-
| Prettier | 423 ms |
|
|
346
|
-
|
|
347
|
-
### Throughput (large file x 20)
|
|
348
|
-
|
|
349
|
-
| Tool | Time |
|
|
350
|
-
|------|-----:|
|
|
351
|
-
| Pickier | **26 ms** |
|
|
352
|
-
| Prettier | 524 ms |
|
|
353
|
-
| Biome (stdin) | 957 ms |
|
|
354
|
-
| oxfmt (stdin) | 1,040 ms |
|
|
355
|
-
|
|
356
|
-
> Pickier's in-memory API is **22-39x faster than Prettier** and orders of magnitude faster than tools that must spawn a process. On CLI, Pickier's compiled binary beats Biome's native Rust binary across all file sizes — **37ms vs 43ms on small files**, and pulling further ahead on larger files. At throughput scale (20x large file), Pickier is **20x faster** than Prettier and **37x faster** than Biome/oxfmt.
|
|
357
|
-
|
|
358
|
-
```bash
|
|
359
|
-
# reproduce locally
|
|
360
|
-
bun bechmarks/benchmarks/format-comparison.bench.ts
|
|
24
|
+
# Unified command
|
|
25
|
+
pickier run . --mode lint --fix
|
|
26
|
+
pickier run . --mode format --write
|
|
361
27
|
```
|
|
362
28
|
|
|
363
|
-
|
|
29
|
+
### Programmatic API
|
|
364
30
|
|
|
365
|
-
|
|
31
|
+
```typescript
|
|
32
|
+
import { lintText, runLintProgrammatic } from 'pickier'
|
|
366
33
|
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
import { config, defaultConfig, run, runLint, runFormat, lintText } from 'pickier'
|
|
370
|
-
|
|
371
|
-
// Unified run
|
|
372
|
-
const exitCode = await run(['.'], {
|
|
373
|
-
mode: 'lint',
|
|
374
|
-
fix: true,
|
|
375
|
-
})
|
|
34
|
+
// Lint a single string
|
|
35
|
+
const issues = await lintText('const x = "hello";')
|
|
376
36
|
|
|
377
|
-
//
|
|
378
|
-
const
|
|
37
|
+
// Programmatic lint run
|
|
38
|
+
const results = await runLintProgrammatic({
|
|
39
|
+
files: ['src/**/*.ts'],
|
|
379
40
|
fix: true,
|
|
380
|
-
dryRun: false,
|
|
381
|
-
reporter: 'json',
|
|
382
|
-
maxWarnings: 0,
|
|
383
|
-
})
|
|
384
|
-
|
|
385
|
-
// Format specific globs
|
|
386
|
-
const fmtCode = await runFormat(['src/**/*.ts'], {
|
|
387
|
-
write: true,
|
|
388
41
|
})
|
|
389
|
-
|
|
390
|
-
// Lint a single string
|
|
391
|
-
const result = await lintText('const x = 1;;', {
|
|
392
|
-
filePath: 'virtual.ts',
|
|
393
|
-
})
|
|
394
|
-
|
|
395
|
-
// Access loaded config (from pickier.config.ts or defaults)
|
|
396
|
-
console.log('loaded config:', config)
|
|
397
|
-
```
|
|
398
|
-
|
|
399
|
-
## Development
|
|
400
|
-
|
|
401
|
-
This repository contains Pickier's source under `packages/pickier`.
|
|
402
|
-
|
|
403
|
-
```bash
|
|
404
|
-
# install deps
|
|
405
|
-
bun i
|
|
406
|
-
|
|
407
|
-
# run tests (with coverage)
|
|
408
|
-
bun test --coverage
|
|
409
|
-
|
|
410
|
-
# build JS and type declarations
|
|
411
|
-
bun run -C packages/pickier build
|
|
412
|
-
|
|
413
|
-
# compile native binary for your platform
|
|
414
|
-
bun run -C packages/pickier compile
|
|
415
|
-
|
|
416
|
-
# compile all platform binaries
|
|
417
|
-
bun run -C packages/pickier compile:all
|
|
418
42
|
```
|
|
419
43
|
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
```bash
|
|
423
|
-
# run the TS entry directly
|
|
424
|
-
bun packages/pickier/bin/cli.ts --help
|
|
425
|
-
|
|
426
|
-
# lint the current directory
|
|
427
|
-
bun packages/pickier/bin/cli.ts .
|
|
428
|
-
|
|
429
|
-
# or the compiled native binary (after compile)
|
|
430
|
-
./packages/pickier/bin/pickier-<your-platform> .
|
|
431
|
-
```
|
|
432
|
-
|
|
433
|
-
## Testing
|
|
434
|
-
|
|
435
|
-
```bash
|
|
436
|
-
bun test
|
|
437
|
-
```
|
|
438
|
-
|
|
439
|
-
## Changelog
|
|
440
|
-
|
|
441
|
-
Please see our [releases](https://github.com/pickier/pickier/releases) page for more information on what has changed recently.
|
|
442
|
-
|
|
443
|
-
## Contributing
|
|
444
|
-
|
|
445
|
-
Please review the [Contributing Guide](https://github.com/stacksjs/contributing) for details.
|
|
446
|
-
|
|
447
|
-
## Community
|
|
448
|
-
|
|
449
|
-
For help, discussion about best practices, or any other conversation that would benefit from being searchable:
|
|
450
|
-
|
|
451
|
-
[Discussions on GitHub](https://github.com/pickier/pickier/discussions)
|
|
452
|
-
|
|
453
|
-
For casual chit-chat with others using this package:
|
|
454
|
-
|
|
455
|
-
[Join the Stacks Discord Server](https://discord.gg/stacksjs)
|
|
456
|
-
|
|
457
|
-
## Postcardware
|
|
458
|
-
|
|
459
|
-
“Software that is free, but hopes for a postcard.” We love receiving postcards from around the world showing where`pickier` is being used! We showcase them on our website too.
|
|
460
|
-
|
|
461
|
-
Our address: Stacks.js, 12665 Village Ln #2306, Playa Vista, CA 90094, United States 🌎
|
|
462
|
-
|
|
463
|
-
## Sponsors
|
|
464
|
-
|
|
465
|
-
We would like to extend our thanks to the following sponsors for funding Stacks development. If you are interested in becoming a sponsor, please reach out to us.
|
|
466
|
-
|
|
467
|
-
- [JetBrains](https://www.jetbrains.com/)
|
|
468
|
-
- [The Solana Foundation](https://solana.com/)
|
|
469
|
-
|
|
470
|
-
## Credits
|
|
44
|
+
## Features
|
|
471
45
|
|
|
472
|
-
-
|
|
473
|
-
-
|
|
46
|
+
- **Fast CLI** - Instant feedback powered by Bun
|
|
47
|
+
- **Lint and Format** - One tool for both linting and formatting
|
|
48
|
+
- **Zero-config Defaults** - Works out of the box, or customize with `pickier.config.ts`
|
|
49
|
+
- **Import Organization** - Splits type/value imports, sorts modules and specifiers, removes unused imports
|
|
50
|
+
- **JSON Sorting** - Sorts `package.json`, `tsconfig.json`, and other config files
|
|
51
|
+
- **Tailwind CSS Class Ordering** - Enforces canonical class order across HTML/JSX/TSX/Vue/Svelte/STX
|
|
52
|
+
- **Markdown Linting** - Documentation quality checks with auto-fix support
|
|
53
|
+
- **Shell Script Linting & Formatting** - 21 rules for `.sh`, `.bash`, and `.zsh` files with auto-fix support and indentation normalization
|
|
54
|
+
- **Spell Checking** - Optional spell-check rules powered by [ts-spell-check](https://github.com/stacksjs/ts-spell-check) (234K dictionary, 150+ common misspelling corrections)
|
|
55
|
+
- **Flexible Formatting** - Configurable indent, quotes, semicolons, whitespace, and more
|
|
56
|
+
- **Package.json Validation** - Validates exports ordering, file format, and module system
|
|
57
|
+
- **ESLint-style Plugin System** - Load plugins, enable/disable rules
|
|
58
|
+
- **CI-friendly Reporters** - Stylish, compact, and JSON output formats
|
|
59
|
+
- **Programmatic API** - Use in custom tooling and editor integrations
|
|
60
|
+
|
|
61
|
+
## Shell Script Support
|
|
62
|
+
|
|
63
|
+
Pickier includes a full `shell/` plugin with 21 rules for linting and formatting shell scripts (`.sh`, `.bash`, `.zsh`). Files are also detected by shebang (`#!/bin/bash`, `#!/usr/bin/env zsh`, etc.).
|
|
64
|
+
|
|
65
|
+
### Formatting
|
|
66
|
+
|
|
67
|
+
Shell formatting normalizes indentation for control structures (`if/then/fi`, `case/esac`, `while/for/do/done`, function bodies), trims trailing whitespace, collapses blank lines, and ensures final newlines — all while preserving heredoc content verbatim.
|
|
68
|
+
|
|
69
|
+
### Rules
|
|
70
|
+
|
|
71
|
+
**Error Prevention:**
|
|
72
|
+
|
|
73
|
+
| Rule | Fixable | Description |
|
|
74
|
+
|------|---------|-------------|
|
|
75
|
+
| `shell/command-substitution` | Yes | Use `$()` instead of backticks |
|
|
76
|
+
| `shell/quote-variables` | - | Quote `$var` to prevent word splitting |
|
|
77
|
+
| `shell/no-cd-without-check` | - | Require fallback exit after `cd` |
|
|
78
|
+
| `shell/no-eval` | - | Disallow `eval` |
|
|
79
|
+
| `shell/no-useless-cat` | - | Detect useless use of cat |
|
|
80
|
+
| `shell/no-ls-parsing` | - | Don't parse `ls` output |
|
|
81
|
+
| `shell/no-variable-in-single-quotes` | - | Flag `$var` inside single quotes |
|
|
82
|
+
| `shell/no-exit-in-subshell` | - | Flag `exit` inside subshells |
|
|
83
|
+
|
|
84
|
+
**Style:**
|
|
85
|
+
|
|
86
|
+
| Rule | Fixable | Description |
|
|
87
|
+
|------|---------|-------------|
|
|
88
|
+
| `shell/shebang` | - | Ensure proper shebang line |
|
|
89
|
+
| `shell/indent` | Yes | Consistent indentation (2 spaces default) |
|
|
90
|
+
| `shell/function-style` | Yes | Prefer `name() {` over `function name` |
|
|
91
|
+
| `shell/operator-spacing` | Yes | Spaces inside `[[ ]]` and `[ ]` |
|
|
92
|
+
| `shell/keyword-spacing` | - | Spacing around shell keywords |
|
|
93
|
+
| `shell/no-trailing-semicolons` | Yes | Remove unnecessary trailing `;` |
|
|
94
|
+
| `shell/no-trailing-whitespace` | Yes | Trim trailing whitespace |
|
|
95
|
+
|
|
96
|
+
**Best Practices:**
|
|
97
|
+
|
|
98
|
+
| Rule | Fixable | Description |
|
|
99
|
+
|------|---------|-------------|
|
|
100
|
+
| `shell/prefer-double-brackets` | Yes | `[[ ]]` over `[ ]` for bash/zsh |
|
|
101
|
+
| `shell/set-options` | - | Recommend `set -euo pipefail` |
|
|
102
|
+
| `shell/prefer-printf` | - | `printf` over `echo -e`/`echo -n` |
|
|
103
|
+
| `shell/consistent-case-terminators` | - | Consistent `;;` in case statements |
|
|
104
|
+
| `shell/no-broken-redirect` | - | Correct `2>&1` ordering |
|
|
105
|
+
| `shell/heredoc-indent` | - | Recommend `<<-` for indented heredocs |
|
|
474
106
|
|
|
475
107
|
## License
|
|
476
108
|
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
Made with 💙
|
|
480
|
-
|
|
481
|
-
<!-- Badges -->
|
|
482
|
-
[npm-version-src]: https://img.shields.io/npm/v/pickier?style=flat-square
|
|
483
|
-
[npm-version-href]: https://npmjs.com/package/pickier
|
|
484
|
-
[github-actions-src]: https://img.shields.io/github/actions/workflow/status/pickier/pickier/ci.yml?style=flat-square&branch=main
|
|
485
|
-
[github-actions-href]: https://github.com/pickier/pickier/actions?query=workflow%3Aci
|
|
486
|
-
|
|
487
|
-
<!-- [codecov-src]: https://img.shields.io/codecov/c/gh/pickier/pickier/main?style=flat-square -->
|
|
488
|
-
<!-- [codecov-href]: https://codecov.io/gh/pickier/pickier -->
|
|
109
|
+
MIT
|
package/dist/ast.d.ts
CHANGED
|
@@ -4,21 +4,10 @@ export declare function tokenize(text: string): Token[];
|
|
|
4
4
|
export declare function findMatching(text: string, start: number, open: string, close: string): number;
|
|
5
5
|
// Lightweight parsing utilities (no deps). Intentionally minimal for Pickier rules.
|
|
6
6
|
// Provides tokenization, simple bracket matching, and loc <-> index mapping.
|
|
7
|
-
export declare interface Loc {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}
|
|
11
|
-
export declare interface Range {
|
|
12
|
-
start: number
|
|
13
|
-
end: number
|
|
14
|
-
}
|
|
15
|
-
export declare interface Token {
|
|
16
|
-
type: string
|
|
17
|
-
value: string
|
|
18
|
-
start: number
|
|
19
|
-
end: number
|
|
20
|
-
}
|
|
7
|
+
export declare interface Loc { line: number, column: number }
|
|
8
|
+
export declare interface Range { start: number, end: number }
|
|
9
|
+
export declare interface Token { type: string, value: string, start: number, end: number }
|
|
21
10
|
export declare interface SourceMap {
|
|
22
11
|
lineStarts: number[]
|
|
23
12
|
indexToLoc: (idx: number) => Loc
|
|
24
|
-
}
|
|
13
|
+
}
|