@eslint-sh/eslint-plugin 0.9.0 → 0.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. package/README.md +23 -29
  2. package/dist/api.d.ts +4 -4
  3. package/dist/command-harvest/builtins/bats.d.ts +1 -1
  4. package/dist/command-harvest/harvest-commands.d.ts +18 -7
  5. package/dist/command-harvest/harvest-commands.js +11 -10
  6. package/dist/command-harvest/wrapper-table.d.ts +1 -1
  7. package/dist/command-harvest/wrapper-table.js +1 -1
  8. package/dist/eslint-plugin-api.d.ts +65 -55
  9. package/dist/language/command-resolution.d.ts +44 -10
  10. package/dist/language/command-resolution.js +39 -13
  11. package/dist/language/shell-source-code.d.ts +25 -42
  12. package/dist/language/shell-source-code.js +27 -44
  13. package/dist/language/syntax-view.d.ts +1 -1
  14. package/dist/language/word-resolution.d.ts +2 -2
  15. package/dist/language/word-resolution.js +2 -2
  16. package/dist/rules/compat/declaration-options.js +2 -2
  17. package/dist/rules/compat/no-brace-sequence-padding-step.js +1 -1
  18. package/dist/rules/compat/no-mapfile.js +2 -2
  19. package/dist/rules/compat/no-negative-array-index.js +2 -2
  20. package/dist/rules/compat/no-printf-time-format.js +2 -2
  21. package/dist/rules/compat/no-test-v.js +2 -2
  22. package/dist/rules/compat/no-wait-n.js +2 -2
  23. package/dist/rules/compat/posix-absent-command.js +2 -2
  24. package/dist/rules/compat/shopt-options.js +2 -2
  25. package/dist/rules/create-wrapper-rule.d.ts +3 -3
  26. package/dist/rules/create-wrapper-rule.js +8 -4
  27. package/dist/rules/no-dynamic-invocation.d.ts +1 -1
  28. package/dist/rules/no-dynamic-invocation.js +12 -4
  29. package/dist/rules/no-eval.js +6 -2
  30. package/dist/rules/no-masked-exit-status.js +1 -1
  31. package/dist/rules/no-secret-env-reads.js +1 -1
  32. package/dist/rules/no-unchecked-cd.js +1 -1
  33. package/dist/rules/no-undeclared-commands.js +2 -1
  34. package/dist/rules/no-unused-declarations.js +7 -2
  35. package/dist/rules/quote-expansions.js +1 -1
  36. package/dist/rules/require-network-wrapper.d.ts +1 -1
  37. package/dist/rules/require-network-wrapper.js +10 -4
  38. package/dist/rules/require-tty-guard.js +1 -1
  39. package/dist/rules/resolve-network-wrapper.d.ts +2 -2
  40. package/dist/rules/resolve-network-wrapper.js +6 -6
  41. package/dist/rules/resolve-transparent-wrappers.d.ts +1 -1
  42. package/dist/rules/resolve-transparent-wrappers.js +2 -2
  43. package/dist/rules/transparent-wrappers.d.ts +3 -3
  44. package/dist/rules/transparent-wrappers.js +1 -1
  45. package/docs/custom-rule-tutorial.md +35 -35
  46. package/docs/error-codes.md +6 -5
  47. package/docs/examples/no-backticks-rule.mjs +1 -1
  48. package/docs/examples/no-curl-in-functions-rule.mjs +2 -2
  49. package/docs/examples/no-listed-commands-rule.ts +1 -1
  50. package/docs/examples/no-rm-rf-rule.mjs +1 -1
  51. package/docs/rules/no-dynamic-invocation.md +5 -0
  52. package/docs/rules/no-undeclared-commands.md +4 -0
  53. package/docs/rules/no-unused-declarations.md +4 -0
  54. package/docs/rules/require-network-wrapper.md +1 -1
  55. package/docs/selectors.md +1 -1
  56. package/docs/wrapper-rules.md +1 -1
  57. package/package.json +9 -20
  58. package/dist/eslint-plugin-syntax-analyze.d.ts +0 -23
  59. package/dist/eslint-plugin-syntax.d.ts +0 -30
  60. package/dist/syntax/analyze.d.ts +0 -19
  61. package/dist/syntax/analyze.js +0 -21
  62. package/dist/syntax/index.d.ts +0 -26
  63. package/dist/syntax/index.js +0 -28
@@ -43,6 +43,7 @@ try {
43
43
  | `ESLINT_SH_CALL_NODE` | `TypeError` | A command helper requires a parsed `CallExpr` view. |
44
44
  | `ESLINT_SH_WORD_NODE` | `TypeError` | A word helper requires a parsed `Word` view. A dynamic word is a normal resolution result. |
45
45
  | `ESLINT_SH_COMMAND_SITE_VIEW` | `Error` | An analyzed command site has no corresponding view in the supplied file. |
46
+ | `ESLINT_SH_COMMAND_UNCERTAINTY_VIEW` | `Error` | An analysis uncertainty has no original lint view in this file; inventory mapping fails rather than dropping it. |
46
47
  | `ESLINT_SH_FOREIGN_VIEW_NODE` | `TypeError` | A printed-fix helper received a view with no original syntax in this file. |
47
48
  | `ESLINT_SH_SYNTAX_POSITION` | `TypeError` | A position argument does not have the required `SyntaxPos` shape. |
48
49
  | `ESLINT_SH_SOURCE_INDEX` | `TypeError` | A source index is not numeric. |
@@ -60,8 +61,7 @@ Formatting/editor failures are documented by the independently maintained
60
61
 
61
62
  ## Dependency boundaries
62
63
 
63
- `./syntax` and `./syntax/analyze` faithfully re-export `sh-ast` and
64
- `sh-ast/analyze`. They retain upstream errors and codes without aliases. The
64
+ Direct `sh-ast` and `sh-analysis` imports retain their own errors and codes without aliases. The
65
65
  plugin's source helpers also preserve analysis resource/invalid-wrapper failures,
66
66
  and printed replacements preserve upstream printer errors. Returning a partial
67
67
  command inventory on a depth refusal would silently omit real commands.
@@ -74,9 +74,10 @@ command inventory on a depth refusal would silently omit real commands.
74
74
  | `SH_AST_SYNTAX_PRINT` | Printer request cannot be honored. |
75
75
  | `SH_AST_SYNTAX_PRINT_PANIC` | Upstream printer failure. |
76
76
  | `SH_AST_WALK_PANIC` | Upstream syntax traversal failure. |
77
- | `SH_AST_PARSE_MAX_DEPTH` | Parser resource limit; no partial tree is returned. |
78
- | `SH_AST_ANALYZE_MAX_DEPTH` | Analysis resource limit; no partial inventory is returned. |
79
- | `SH_AST_ANALYZE_INVALID_WRAPPER_SPEC` | A raw analysis wrapper spec is invalid. Shared JSON settings are validated at their own project boundary. |
77
+ | `SH_AST_PARSE_MAX_DEPTH` | Parser resource limit; no partial tree or formatted output is returned. |
78
+ | `SH_ANALYSIS_MAX_DEPTH` | Analysis resource limit; no partial inventory is returned. |
79
+ | `SH_ANALYSIS_RESOURCE` | Analysis-owned brace-observation copying exceeded the host stack. The error retains operation `brace-observation-copy` and its original `RangeError` cause; source helpers propagate it unchanged. |
80
+ | `SH_ANALYSIS_INVALID_WRAPPER_SPEC` | A raw analysis wrapper table or model is invalid, including non-object entries and missing array elements. Shared settings also have their own project configuration validation. |
80
81
  | `SH_AST_INTERNAL` | Upstream bridge/internal failure. |
81
82
 
82
83
  ESLint wraps errors from language-option validation in its own `TypeError`.
@@ -11,7 +11,7 @@
11
11
  * new text with `getPrintedReplacement`. The original syntax every other rule
12
12
  * reads stays unchanged.
13
13
  *
14
- * @import { PrintOptions } from '@eslint-sh/eslint-plugin/syntax'
14
+ * @import { PrintOptions } from 'sh-ast'
15
15
  * @see ../custom-rule-tutorial.md — the tutorial this rule backs
16
16
  */
17
17
  import { defineShellRule } from '@eslint-sh/eslint-plugin';
@@ -7,7 +7,7 @@
7
7
  * It reports `curl` run anywhere inside a shell function, including through a
8
8
  * wrapper (`sudo curl …`) or inside a command substitution in that function.
9
9
  * Instead of tracking "am I inside a function?" while visiting nodes, it reads
10
- * every command once from `context.sourceCode.getCommandSites()`, whose
10
+ * every command once from `context.sourceCode.getCommandInventory().commands`, whose
11
11
  * `context` frames (outermost first) already say how each command is reached.
12
12
  *
13
13
  * @see ../custom-rule-tutorial.md — the tutorial this rule backs
@@ -28,7 +28,7 @@ const noCurlInFunctions = defineShellRule({
28
28
  create(context) {
29
29
  return {
30
30
  File() {
31
- for (const site of context.sourceCode.getCommandSites()) {
31
+ for (const site of context.sourceCode.getCommandInventory().commands) {
32
32
  const { effective } = site.resolveInvokedCommand();
33
33
  if (!effective.static || effective.text !== 'curl') {
34
34
  continue;
@@ -52,7 +52,7 @@ const noListedCommands = defineShellRule<Options, 'listed'>({
52
52
  const listed = new Set(context.options[0]?.commands ?? []);
53
53
  return {
54
54
  File() {
55
- for (const site of context.sourceCode.getCommandSites()) {
55
+ for (const site of context.sourceCode.getCommandInventory().commands) {
56
56
  reportIfListed(context, site, listed);
57
57
  }
58
58
  },
@@ -18,7 +18,7 @@
18
18
  * domain-specific check).
19
19
  *
20
20
  * Flag words are resolved with `context.sourceCode.resolveWord`
21
- * (backed by `sh-ast/analyze`) rather than a
21
+ * (backed by `sh-analysis`) rather than a
22
22
  * hand-rolled scan: a word is only treated as a short-option cluster
23
23
  * when it is *statically* that string (bare or
24
24
  * quoted literal concatenations). Recursive (`r`/`R`) and force (`f`)
@@ -142,3 +142,8 @@ shellcheck has no equivalent. It treats a dynamic command word as legitimate she
142
142
  warns about how it is written, such as unquoted expansions (SC2086) or a string used where an
143
143
  array belongs (SC2089/SC2090). It can't express the policy that every command must be
144
144
  statically enumerable, which is what makes a script reviewable as a whole.
145
+
146
+ Opaque executable syntax is exposed separately in the source command inventory.
147
+ This rule reports `opaqueExecutable` at the original opaque construct, including
148
+ inside `allowInFunctions` dispatcher scopes. That exemption permits computed
149
+ command words; embedded executable text still requires review.
@@ -140,3 +140,7 @@ shellcheck has no equivalent. It checks how a script uses commands, not which co
140
140
  script may depend on, and it has no notion of a project's declaration convention to compare
141
141
  against. A dependency manifest is project policy, which is the kind of rule shellcheck cannot be
142
142
  configured to express.
143
+
144
+ Opaque executable syntax is exposed separately in the source command inventory.
145
+ This rule reports known undeclared dependencies even when opaque syntax prevents
146
+ an exhaustive inventory; absence of reports does not prove dependency completeness.
@@ -211,3 +211,7 @@ shellcheck has no equivalent. It checks how a script uses commands, not which co
211
211
  script says it depends on, and it has no notion of a project's declaration convention to compare
212
212
  against. Keeping a dependency manifest honest is project policy, which is the kind of rule
213
213
  shellcheck cannot be configured to express.
214
+
215
+ Opaque executable syntax is exposed separately in the source command inventory.
216
+ Any uncertainty suppresses unused-declaration reports and fixes for the file,
217
+ because the opaque code could use a declared command.
@@ -69,7 +69,7 @@ It does not depend on `languageOptions`.
69
69
  `{ names: ['retry'], argFlags: ['-n'] }` makes `retry -n 3 curl x` wrapped. Its fields are
70
70
  `names` (required; any of them counts as the wrapper), `noArgFlags`, `argFlags`,
71
71
  `stopsChainFlags`, `unresolvableFlags`, `positionalOperandsBeforeCommand`, and
72
- `assignmentOperands`, as in `sh-ast/analyze`'s `WrapperSpec`.
72
+ `assignmentOperands`, as in `sh-analysis`'s `WrapperSpec`.
73
73
  - `commands` (`string[]`, default `["curl", "wget", "nc", "ssh", "scp", "rsync", "git"]`): the
74
74
  network commands. Setting it replaces the default list. `git` keeps its subcommand restriction
75
75
  wherever it is listed. An empty list removes all built-in commands.
package/docs/selectors.md CHANGED
@@ -23,7 +23,7 @@ Looking for a complete, runnable `create()` that uses one of these selectors —
23
23
  | `:quoted` | `SglQuoted`, `DblQuoted` |
24
24
  | `:function` | `FuncDecl` |
25
25
 
26
- `:command` matches exactly the calls with an entry in `sourceCode.getCommandSites()`.
26
+ `:command` matches exactly the calls with an entry in `sourceCode.getCommandInventory().commands`.
27
27
  An assignment-only statement such as `FOO=1` has no command site and does not match.
28
28
  `FOO=1 jq .`, `true`, `:`, and dynamic invocations such as `"$tool" file` do match.
29
29
  Select `CallExpr` directly when you want every call node, including assignment-only calls.
@@ -136,7 +136,7 @@ chain, outermost first: `retry sudo curl x` runs `retry`, then `sudo`, then `cur
136
136
  ### Declaring the wrapper's options
137
137
 
138
138
  A wrapper given as a string is assumed to take no options of its own, so the word after it is
139
- the command it runs. When your wrapper has options, give a `WrapperSpec` (from `sh-ast/analyze`,
139
+ the command it runs. When your wrapper has options, give a `WrapperSpec` (from `sh-analysis`,
140
140
  re-exported by this package) that declares them:
141
141
 
142
142
  ```js
package/package.json CHANGED
@@ -1,12 +1,13 @@
1
1
  {
2
2
  "name": "@eslint-sh/eslint-plugin",
3
3
  "description": "Shell script linting for ESLint, with built-in policy rules, shared presets, and custom rules over a typed shell AST",
4
- "version": "0.9.0",
4
+ "version": "0.10.0",
5
5
  "author": "Mike North <michael.l.north@gmail.com>",
6
6
  "dependencies": {
7
7
  "@eslint/core": "^1.2.1",
8
8
  "@eslint/plugin-kit": "^0.7.2",
9
- "sh-ast": "^0.10.0"
9
+ "sh-ast": "^0.11.0",
10
+ "sh-analysis": "^0.1.0"
10
11
  },
11
12
  "devDependencies": {
12
13
  "eslint": "^10.7.0"
@@ -15,20 +16,12 @@
15
16
  "eslint": "^10.2.0"
16
17
  },
17
18
  "engines": {
18
- "node": "^22.13.0 || >=24"
19
+ "node": "^22.14.0 || >=24"
19
20
  },
20
21
  "exports": {
21
22
  ".": {
22
23
  "types": "./dist/eslint-plugin.d.ts",
23
24
  "default": "./dist/index.js"
24
- },
25
- "./syntax": {
26
- "types": "./dist/eslint-plugin-syntax.d.ts",
27
- "default": "./dist/syntax/index.js"
28
- },
29
- "./syntax/analyze": {
30
- "types": "./dist/eslint-plugin-syntax-analyze.d.ts",
31
- "default": "./dist/syntax/analyze.js"
32
25
  }
33
26
  },
34
27
  "files": [
@@ -57,11 +50,7 @@
57
50
  ],
58
51
  "outputs": [
59
52
  "{workspaceRoot}/api-report-combined/eslint-plugin.api.md",
60
- "{workspaceRoot}/api-docs-temp/eslint-plugin.api.json",
61
- "{workspaceRoot}/api-report-combined/eslint-plugin-syntax.api.md",
62
- "{workspaceRoot}/api-docs-temp/eslint-plugin-syntax.api.json",
63
- "{workspaceRoot}/api-report-combined/eslint-plugin-syntax-analyze.api.md",
64
- "{workspaceRoot}/api-docs-temp/eslint-plugin-syntax-analyze.api.json"
53
+ "{workspaceRoot}/api-docs-temp/eslint-plugin.api.json"
65
54
  ]
66
55
  }
67
56
  }
@@ -77,16 +66,16 @@
77
66
  "directory": "packages/eslint-plugin"
78
67
  },
79
68
  "scripts": {
80
- "build": "node ../../scripts/materialize-shared-source.mjs && tsc -p tsconfig.json && node ../../scripts/rollup-declarations.mjs api-extractor.json syntax/api-extractor.json syntax/analyze/api-extractor.json && cp types/eslint-plugin.d.ts dist/eslint-plugin.d.ts",
69
+ "build": "node ../../scripts/materialize-shared-source.mjs && tsc -p tsconfig.json && node ../../scripts/rollup-declarations.mjs api-extractor.json && cp types/eslint-plugin.d.ts dist/eslint-plugin.d.ts",
81
70
  "check": "concurrently -n lint,types,api-report \"pnpm run check:lint-ts\" \"pnpm run check:typecheck\" \"pnpm run check:api-report\"",
82
- "check:api-report": "api-extractor run && api-extractor run --config syntax/api-extractor.json && api-extractor run --config syntax/analyze/api-extractor.json",
71
+ "check:api-report": "api-extractor run",
83
72
  "check:lint-ts": "eslint .",
84
73
  "check:typecheck": "tsc --noEmit",
85
74
  "clean": "rimraf --glob dist \"temp/*\" \"*.tsbuildinfo\"",
86
- "fix:api-report": "api-extractor run --local && api-extractor run --local --config syntax/api-extractor.json && api-extractor run --local --config syntax/analyze/api-extractor.json",
75
+ "fix:api-report": "api-extractor run --local",
87
76
  "fix:lint-ts": "eslint . --fix",
88
77
  "test": "vitest run",
89
- "uplevel-api-reports": "mkdir -p ../../api-report-combined ../../api-docs-temp && cp api-report/eslint-plugin.api.md api-report/eslint-plugin-syntax.api.md api-report/eslint-plugin-syntax-analyze.api.md ../../api-report-combined/ && cp temp/eslint-plugin.api.json temp/eslint-plugin-syntax.api.json temp/eslint-plugin-syntax-analyze.api.json ../../api-docs-temp/",
78
+ "uplevel-api-reports": "mkdir -p ../../api-report-combined ../../api-docs-temp && cp api-report/eslint-plugin.api.md ../../api-report-combined/ && cp temp/eslint-plugin.api.json ../../api-docs-temp/",
90
79
  "test:candidate": "node --experimental-strip-types test/candidate/run.mjs"
91
80
  }
92
81
  }
@@ -1,23 +0,0 @@
1
- /**
2
- * The faithful shell analysis surface (`@eslint-sh/eslint-plugin/syntax/analyze`): the complete
3
- * public surface of `sh-ast/analyze`, re-exported unchanged from the very `sh-ast` instance this
4
- * plugin's language parses with.
5
- *
6
- * It provides `enumerateCommands`, `resolveArgv0` (whose `chainIndices` locate a resolved command's
7
- * arguments in its site's `argv`), `DEFAULT_TRANSPARENT_WRAPPERS`, `WrapperSpec`, the raw
8
- * `resolveWord(Node)`, and the named operator constants with `rawOperator` for comparing and
9
- * constructing the operator values those records carry. All of it works on the faithful records
10
- * from `@eslint-sh/eslint-plugin/syntax`. For lint-view Word nodes, rules use
11
- * `context.sourceCode.resolveWord(word)`, whose default policy comes from grammar position.
12
- * This raw analyzer retains upstream defaults and never infers lint-view context.
13
- *
14
- * Like `@eslint-sh/eslint-plugin/syntax`, it tracks the plugin's pinned `sh-ast` minor and never
15
- * wraps or renames anything.
16
- *
17
- * @packageDocumentation
18
- */
19
-
20
-
21
- export * from "sh-ast/analyze";
22
-
23
- export { }
@@ -1,30 +0,0 @@
1
- /**
2
- * The faithful shell syntax surface (`@eslint-sh/eslint-plugin/syntax`): the complete public
3
- * surface of `sh-ast`'s root entry point, re-exported unchanged from the very `sh-ast` instance
4
- * this plugin's language parses with.
5
- *
6
- * Use it when a custom rule edits or analyzes the parser's own records rather than the plugin's
7
- * lint view: `walk`, `parseSync`, `printSync` and `PrintOptions`, the record types (`Node`,
8
- * `Word`, `CallExpr`, `SyntaxPos`, `GoString`, …), and the operator and language constants.
9
- * Importing them from here, instead of installing `sh-ast` separately, means a rule always gets
10
- * the same `sh-ast` version and module instance as the language that produced its syntax. Under
11
- * 0.x a different `sh-ast` minor is a breaking change, and records from one copy are not
12
- * guaranteed to be accepted by another.
13
- *
14
- * This entry point tracks the plugin's pinned `sh-ast` minor, so an `sh-ast` 0.x minor bump is a
15
- * minor release of this plugin. It never wraps or renames anything: every name has `sh-ast`'s
16
- * own contract. Rules analyze lint-view words through `context.sourceCode.resolveWord(word)`,
17
- * which supplies the word's grammar context. Raw syntax analysis lives in
18
- * `@eslint-sh/eslint-plugin/syntax/analyze`, separate from the lint view.
19
- *
20
- * The low-level `printSync` keeps upstream behavior, including changes to literal vertical tabs
21
- * and form feeds. It does not apply the high-level content refusal used by `format` and
22
- * `ShellSourceCode.getPrintedReplacement`; callers printing directly must account for that loss.
23
- *
24
- * @packageDocumentation
25
- */
26
-
27
-
28
- export * from "sh-ast";
29
-
30
- export { }
@@ -1,19 +0,0 @@
1
- /**
2
- * The faithful shell analysis surface (`@eslint-sh/eslint-plugin/syntax/analyze`): the complete
3
- * public surface of `sh-ast/analyze`, re-exported unchanged from the very `sh-ast` instance this
4
- * plugin's language parses with.
5
- *
6
- * It provides `enumerateCommands`, `resolveArgv0` (whose `chainIndices` locate a resolved command's
7
- * arguments in its site's `argv`), `DEFAULT_TRANSPARENT_WRAPPERS`, `WrapperSpec`, the raw
8
- * `resolveWord(Node)`, and the named operator constants with `rawOperator` for comparing and
9
- * constructing the operator values those records carry. All of it works on the faithful records
10
- * from `@eslint-sh/eslint-plugin/syntax`. For lint-view Word nodes, rules use
11
- * `context.sourceCode.resolveWord(word)`, whose default policy comes from grammar position.
12
- * This raw analyzer retains upstream defaults and never infers lint-view context.
13
- *
14
- * Like `@eslint-sh/eslint-plugin/syntax`, it tracks the plugin's pinned `sh-ast` minor and never
15
- * wraps or renames anything.
16
- *
17
- * @packageDocumentation
18
- */
19
- export * from 'sh-ast/analyze';
@@ -1,21 +0,0 @@
1
- /* eslint-disable @api-extractor-tools/package-documentation -- this file is the barrel of the
2
- `./syntax/analyze` entry point (package.json `exports`); the rule only recognizes the root barrel. */
3
- /**
4
- * The faithful shell analysis surface (`@eslint-sh/eslint-plugin/syntax/analyze`): the complete
5
- * public surface of `sh-ast/analyze`, re-exported unchanged from the very `sh-ast` instance this
6
- * plugin's language parses with.
7
- *
8
- * It provides `enumerateCommands`, `resolveArgv0` (whose `chainIndices` locate a resolved command's
9
- * arguments in its site's `argv`), `DEFAULT_TRANSPARENT_WRAPPERS`, `WrapperSpec`, the raw
10
- * `resolveWord(Node)`, and the named operator constants with `rawOperator` for comparing and
11
- * constructing the operator values those records carry. All of it works on the faithful records
12
- * from `@eslint-sh/eslint-plugin/syntax`. For lint-view Word nodes, rules use
13
- * `context.sourceCode.resolveWord(word)`, whose default policy comes from grammar position.
14
- * This raw analyzer retains upstream defaults and never infers lint-view context.
15
- *
16
- * Like `@eslint-sh/eslint-plugin/syntax`, it tracks the plugin's pinned `sh-ast` minor and never
17
- * wraps or renames anything.
18
- *
19
- * @packageDocumentation
20
- */
21
- export * from 'sh-ast/analyze';
@@ -1,26 +0,0 @@
1
- /**
2
- * The faithful shell syntax surface (`@eslint-sh/eslint-plugin/syntax`): the complete public
3
- * surface of `sh-ast`'s root entry point, re-exported unchanged from the very `sh-ast` instance
4
- * this plugin's language parses with.
5
- *
6
- * Use it when a custom rule edits or analyzes the parser's own records rather than the plugin's
7
- * lint view: `walk`, `parseSync`, `printSync` and `PrintOptions`, the record types (`Node`,
8
- * `Word`, `CallExpr`, `SyntaxPos`, `GoString`, …), and the operator and language constants.
9
- * Importing them from here, instead of installing `sh-ast` separately, means a rule always gets
10
- * the same `sh-ast` version and module instance as the language that produced its syntax. Under
11
- * 0.x a different `sh-ast` minor is a breaking change, and records from one copy are not
12
- * guaranteed to be accepted by another.
13
- *
14
- * This entry point tracks the plugin's pinned `sh-ast` minor, so an `sh-ast` 0.x minor bump is a
15
- * minor release of this plugin. It never wraps or renames anything: every name has `sh-ast`'s
16
- * own contract. Rules analyze lint-view words through `context.sourceCode.resolveWord(word)`,
17
- * which supplies the word's grammar context. Raw syntax analysis lives in
18
- * `@eslint-sh/eslint-plugin/syntax/analyze`, separate from the lint view.
19
- *
20
- * The low-level `printSync` keeps upstream behavior, including changes to literal vertical tabs
21
- * and form feeds. It does not apply the high-level content refusal used by `format` and
22
- * `ShellSourceCode.getPrintedReplacement`; callers printing directly must account for that loss.
23
- *
24
- * @packageDocumentation
25
- */
26
- export * from 'sh-ast';
@@ -1,28 +0,0 @@
1
- /* eslint-disable @api-extractor-tools/package-documentation -- this file is the barrel of the
2
- `./syntax` entry point (package.json `exports`); the rule only recognizes the root barrel. */
3
- /**
4
- * The faithful shell syntax surface (`@eslint-sh/eslint-plugin/syntax`): the complete public
5
- * surface of `sh-ast`'s root entry point, re-exported unchanged from the very `sh-ast` instance
6
- * this plugin's language parses with.
7
- *
8
- * Use it when a custom rule edits or analyzes the parser's own records rather than the plugin's
9
- * lint view: `walk`, `parseSync`, `printSync` and `PrintOptions`, the record types (`Node`,
10
- * `Word`, `CallExpr`, `SyntaxPos`, `GoString`, …), and the operator and language constants.
11
- * Importing them from here, instead of installing `sh-ast` separately, means a rule always gets
12
- * the same `sh-ast` version and module instance as the language that produced its syntax. Under
13
- * 0.x a different `sh-ast` minor is a breaking change, and records from one copy are not
14
- * guaranteed to be accepted by another.
15
- *
16
- * This entry point tracks the plugin's pinned `sh-ast` minor, so an `sh-ast` 0.x minor bump is a
17
- * minor release of this plugin. It never wraps or renames anything: every name has `sh-ast`'s
18
- * own contract. Rules analyze lint-view words through `context.sourceCode.resolveWord(word)`,
19
- * which supplies the word's grammar context. Raw syntax analysis lives in
20
- * `@eslint-sh/eslint-plugin/syntax/analyze`, separate from the lint view.
21
- *
22
- * The low-level `printSync` keeps upstream behavior, including changes to literal vertical tabs
23
- * and form feeds. It does not apply the high-level content refusal used by `format` and
24
- * `ShellSourceCode.getPrintedReplacement`; callers printing directly must account for that loss.
25
- *
26
- * @packageDocumentation
27
- */
28
- export * from 'sh-ast';