Skip to content

Commit

Permalink
Add eslint fixer
Browse files Browse the repository at this point in the history
  • Loading branch information
pokey committed Apr 8, 2023
1 parent 5a937c6 commit 6ff801b
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,23 @@ repos:
additional_dependencies:
- [email protected]
args: []
- repo: local
hooks:
- id: eslint
name: eslint
files: \.(ts|tsx)$
language: node
entry: eslint --fix
additional_dependencies:
- "@typescript-eslint/[email protected]"
- "@typescript-eslint/[email protected]"
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
args: []
- repo: https://github.com/ikamensh/flynt/
rev: "0.78"
hooks:
Expand Down
6 changes: 6 additions & 0 deletions packages/meta-updater/src/updatePreCommit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,12 @@ export async function updatePreCommit(
const deps = getPackageDeps(workspaceDir, packageDir, pnpmLockfile);

updateHook(deps, rawInput, "prettier", (name) => name === "prettier");
updateHook(
deps,
rawInput,
"eslint",
(name) => name.includes("eslint") || name === "typescript",
);

return rawInput;
}
Expand Down

0 comments on commit 6ff801b

Please sign in to comment.