eslint-sh 0.0.0 → 0.1.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.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Mike North
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,53 @@
1
+ # eslint-sh
2
+
3
+ Shell script parsing and syntax-error reporting for ESLint, with custom-rule authoring over a
4
+ typed shell AST.
5
+
6
+ **Roadmap:** built-in lint rules and shared configs are planned but not implemented yet.
7
+
8
+ ## Installation
9
+
10
+ This package is not yet published. Once it is, install it as a dev dependency:
11
+
12
+ ```sh
13
+ npm install --save-dev eslint-sh
14
+ ```
15
+
16
+ ## `languageOptions` reference
17
+
18
+ | Option | Allowed values | Default | Effect |
19
+ | ----------------- | ----------------------------------------------------------------------- | ---------- | --------------------------------------------------------------------------------------------------------------------------------- |
20
+ | `dialect` | `"bash"`, `"posix"`, `"mksh"`, `"bats"`, `"zsh"` | `"bash"` | Selects which shell grammar the parser accepts; parsing a construct outside the chosen dialect produces a parse error. |
21
+ | `shellVersion` | A numeric `MAJOR` or `MAJOR.MINOR` string, e.g. `"5"` or `"3.2"` | unset | Reserved for the rule layer (e.g. a future bash-3.2 compatibility check); has no effect on parsing today since no rules ship yet. |
22
+ | `directivePrefix` | Lowercase, hyphen-separated words, e.g. `"eslint"` or `"shellcheck-sh"` | `"eslint"` | The prefix directive/inline-config comments must start with — e.g. the default recognizes `# eslint-disable-next-line ...`. |
23
+
24
+ ## Usage
25
+
26
+ This release reports shell syntax (parse) errors only — no lint rules ship yet, so a "0 problems"
27
+ result means the script parsed without a syntax error, not that it is problem-free.
28
+
29
+ ```js
30
+ // eslint.config.mjs
31
+ import { defineConfig } from 'eslint/config';
32
+ import sh from 'eslint-sh'; // equivalent to: import sh from '@eslint-sh/eslint-plugin'
33
+
34
+ export default defineConfig([
35
+ {
36
+ files: ['**/*.sh', '**/*.bash'],
37
+ plugins: { sh },
38
+ language: 'sh/sh',
39
+ languageOptions: { dialect: 'bash', shellVersion: '3.2' },
40
+ },
41
+ ]);
42
+ ```
43
+
44
+ ## Status
45
+
46
+ Thin umbrella re-exporting `@eslint-sh/eslint-plugin`'s plugin object unchanged as this
47
+ package's default export — `import sh from "eslint-sh"` and `import sh from "@eslint-sh/eslint-plugin"`
48
+ refer to the same object. `@eslint-sh/eslint-plugin` currently ships `ShellLanguage`/
49
+ `ShellSourceCode` only; rules and shared configs are not implemented yet. Disable directives /
50
+ inline config are implemented and live. No lint rules ship yet, so the rule id is illustrative:
51
+ after you register a custom rule as `sh/your-rule`,
52
+ `# eslint-disable-next-line sh/your-rule -- justification` suppresses it on the following line;
53
+ see `@eslint-sh/eslint-plugin`'s README for the full directive surface.
@@ -0,0 +1,5 @@
1
+ import sh from '@eslint-sh/eslint-plugin';
2
+
3
+ export default sh;
4
+
5
+ export { }
@@ -0,0 +1,12 @@
1
+ import sh from '@eslint-sh/eslint-plugin';
2
+ /**
3
+ * `eslint-sh` — the unscoped umbrella package (design/PACKAGES.md's Naming
4
+ * decision). Re-exports `@eslint-sh/eslint-plugin`'s plugin object
5
+ * unchanged as this package's default export, so `import sh from
6
+ * "eslint-sh"` and `import sh from "@eslint-sh/eslint-plugin"` are
7
+ * equivalent.
8
+ *
9
+ * @public
10
+ */
11
+ export default sh;
12
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,0BAA0B,CAAC;AAE1C;;;;;;;;GAQG;AACH,eAAe,EAAE,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,12 @@
1
+ import sh from '@eslint-sh/eslint-plugin';
2
+ /**
3
+ * `eslint-sh` — the unscoped umbrella package (design/PACKAGES.md's Naming
4
+ * decision). Re-exports `@eslint-sh/eslint-plugin`'s plugin object
5
+ * unchanged as this package's default export, so `import sh from
6
+ * "eslint-sh"` and `import sh from "@eslint-sh/eslint-plugin"` are
7
+ * equivalent.
8
+ *
9
+ * @public
10
+ */
11
+ export default sh;
12
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,0BAA0B,CAAC;AAE1C;;;;;;;;GAQG;AACH,eAAe,EAAE,CAAC"}
package/package.json CHANGED
@@ -1,13 +1,68 @@
1
1
  {
2
2
  "name": "eslint-sh",
3
- "version": "0.0.0",
4
- "description": "",
5
- "main": "index.js",
6
- "scripts": {
7
- "test": "echo \"Error: no test specified\" && exit 1"
3
+ "description": "Shell script parsing and syntax-error reporting for ESLint, with custom-rule authoring over a typed shell AST",
4
+ "version": "0.1.0",
5
+ "author": "Mike North <michael.l.north@gmail.com>",
6
+ "dependencies": {
7
+ "@eslint-sh/eslint-plugin": "0.1.0"
8
+ },
9
+ "devDependencies": {
10
+ "eslint": "^10.7.0"
11
+ },
12
+ "peerDependencies": {
13
+ "eslint": "^10.0.0"
14
+ },
15
+ "exports": {
16
+ ".": {
17
+ "types": "./dist/eslint-sh.d.ts",
18
+ "default": "./dist/index.js"
19
+ }
8
20
  },
9
- "keywords": [],
10
- "author": "",
11
- "license": "ISC",
12
- "type": "commonjs"
13
- }
21
+ "files": [
22
+ "dist"
23
+ ],
24
+ "license": "MIT",
25
+ "main": "./dist/index.js",
26
+ "nx": {
27
+ "targets": {
28
+ "check:api-report": {
29
+ "outputs": [
30
+ "{projectRoot}/api-report",
31
+ "{projectRoot}/temp",
32
+ "{projectRoot}/dist/eslint-sh.d.ts"
33
+ ]
34
+ },
35
+ "uplevel-api-reports": {
36
+ "dependsOn": [
37
+ "check:api-report"
38
+ ],
39
+ "cache": true,
40
+ "inputs": [
41
+ "{projectRoot}/api-report/**",
42
+ "{projectRoot}/temp/**"
43
+ ],
44
+ "outputs": [
45
+ "{workspaceRoot}/api-report-combined/eslint-sh.api.md",
46
+ "{workspaceRoot}/api-docs-temp/eslint-sh.api.json"
47
+ ]
48
+ }
49
+ }
50
+ },
51
+ "publishConfig": {
52
+ "access": "public"
53
+ },
54
+ "type": "module",
55
+ "types": "./dist/eslint-sh.d.ts",
56
+ "scripts": {
57
+ "build": "tsc -p tsconfig.json",
58
+ "check": "concurrently -n lint,types,api-report \"pnpm run check:lint-ts\" \"pnpm run check:typecheck\" \"pnpm run check:api-report\"",
59
+ "check:api-report": "api-extractor run",
60
+ "check:lint-ts": "eslint .",
61
+ "check:typecheck": "tsc --noEmit",
62
+ "clean": "rimraf --glob dist \"temp/*\" \"*.tsbuildinfo\"",
63
+ "fix:api-report": "api-extractor run --local",
64
+ "fix:lint-ts": "eslint . --fix",
65
+ "test": "vitest run",
66
+ "uplevel-api-reports": "mkdir -p ../../api-report-combined ../../api-docs-temp && cp api-report/eslint-sh.api.md ../../api-report-combined/ && cp temp/eslint-sh.api.json ../../api-docs-temp/"
67
+ }
68
+ }