-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: fixed wrong handling of eslint rule overwrite, removed cross-env
Signed-off-by: prisis <[email protected]>
- Loading branch information
Showing
12 changed files
with
97 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,9 @@ | ||
import type { Config } from "lint-staged"; | ||
|
||
import getPackageManager from "../utils/get-package-manager"; | ||
|
||
const group: Config = { | ||
"*": ["secretlint"], | ||
"*": [`${getPackageManager()} exec secretlint`], | ||
}; | ||
|
||
export default group; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
packages/lint-staged-config/src/utils/get-package-manager.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { hasFile } from "@anolilab/package-json-utils"; | ||
|
||
const getPackageManager = (): "npm" | "pnpm" | "yarn" => { | ||
if (global.anolilabLintStagedPackageManager) { | ||
return global.anolilabLintStagedPackageManager; | ||
} | ||
|
||
if (hasFile("pnpm-lock.yaml")) { | ||
global.anolilabLintStagedPackageManager = "pnpm"; | ||
|
||
return "pnpm"; | ||
} | ||
|
||
if (hasFile("yarn.lock")) { | ||
global.anolilabLintStagedPackageManager = "yarn"; | ||
|
||
return "yarn"; | ||
} | ||
|
||
if (hasFile("package-lock.json")) { | ||
global.anolilabLintStagedPackageManager = "npm"; | ||
|
||
return "npm"; | ||
} | ||
|
||
throw new Error("No package manager found"); | ||
}; | ||
|
||
export default getPackageManager; |