@theholocron/lint-staged-config 8.4.2 → 8.4.4
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/dist/index.js +14 -4
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { existsSync } from "node:fs";
|
|
2
|
+
import { resolve } from "node:path";
|
|
2
3
|
//#region index.ts
|
|
3
4
|
/**
|
|
4
5
|
* `<tool> --write`/`<tool>` alone falls back to the tool's own auto-discovery
|
|
@@ -10,12 +11,21 @@ import { existsSync } from "node:fs";
|
|
|
10
11
|
* #672 Phase 5, theholocron/holocron#680) — same requirement astromech's
|
|
11
12
|
* `resolveToolConfig()` already established for `holocron run <task>`
|
|
12
13
|
* (theholocron/holocron#676/#749) and `.husky/commit-msg`'s commitlint
|
|
13
|
-
* invocation.
|
|
14
|
-
*
|
|
15
|
-
*
|
|
14
|
+
* invocation.
|
|
15
|
+
*
|
|
16
|
+
* Resolved to an ABSOLUTE path, not left relative — lint-staged spawns each
|
|
17
|
+
* command in a context where a relative path silently fails to resolve
|
|
18
|
+
* (confirmed: `--config node_modules/@theholocron/prettier-config/dist/index.js`
|
|
19
|
+
* resolved correctly under a plain manual shell invocation from the repo
|
|
20
|
+
* root, but silently missed under lint-staged itself, falling back to
|
|
21
|
+
* prettier's built-in printWidth 80 instead of the shared config's 120 —
|
|
22
|
+
* found via theholocron/clients#348, where a lint-staged-driven commit
|
|
23
|
+
* produced different line-wrapping than the identical command run by hand).
|
|
24
|
+
* An absolute path removes any dependency on the spawned process's cwd.
|
|
16
25
|
*/
|
|
17
26
|
function resolveConfig(relativePath) {
|
|
18
|
-
|
|
27
|
+
const absolute = resolve(process.cwd(), relativePath);
|
|
28
|
+
return existsSync(absolute) ? absolute : null;
|
|
19
29
|
}
|
|
20
30
|
const prettierConfig = resolveConfig("node_modules/@theholocron/prettier-config/dist/index.js");
|
|
21
31
|
const eslintConfig = resolveConfig("node_modules/@theholocron/eslint-config/dist/bundles/library.js");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@theholocron/lint-staged-config",
|
|
3
|
-
"version": "8.4.
|
|
3
|
+
"version": "8.4.4",
|
|
4
4
|
"description": "A Lint Staged configuration for linting code that has been staged in Git within the Galaxy.",
|
|
5
5
|
"homepage": "https://github.com/theholocron/configs/tree/main/packages/lint-staged-config#readme",
|
|
6
6
|
"bugs": "https://github.com/theholocron/configs/issues",
|
|
@@ -27,8 +27,8 @@
|
|
|
27
27
|
"tsdown": "^0.22.14",
|
|
28
28
|
"typescript": "^5.9.3",
|
|
29
29
|
"vitest": "^4.1.10",
|
|
30
|
-
"@theholocron/tsconfig": "8.4.
|
|
31
|
-
"@theholocron/vitest-config": "8.4.
|
|
30
|
+
"@theholocron/tsconfig": "8.4.4",
|
|
31
|
+
"@theholocron/vitest-config": "8.4.4"
|
|
32
32
|
},
|
|
33
33
|
"exports": {
|
|
34
34
|
".": {
|