forked from makeplane/plane
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[WEB-1390] chore: Add pre commit hook to check for lint and formattin…
…g errors (makeplane#4537) * Add pre commit hook * Add comments
- Loading branch information
1 parent
b084844
commit 6236adf
Showing
5 changed files
with
362 additions
and
11 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
/** | ||
* Adds three new lint plugins over the existing configuration: | ||
* This is used to lint staged files only. | ||
* We should remove this file once the entire codebase follows these rules. | ||
*/ | ||
module.exports = { | ||
root: true, | ||
extends: [ | ||
"custom", | ||
"eslint:recommended", | ||
"plugin:react/recommended", | ||
"plugin:prettier/recommended", | ||
], | ||
parser: "@typescript-eslint/parser", | ||
settings: { | ||
"import/resolver": { | ||
typescript: {}, | ||
node: { | ||
moduleDirectory: ["node_modules", "."], | ||
}, | ||
}, | ||
}, | ||
rules: { | ||
"import/order": [ | ||
"error", | ||
{ | ||
groups: ["builtin", "external", "internal", "parent", "sibling"], | ||
pathGroups: [ | ||
{ | ||
pattern: "react", | ||
group: "external", | ||
position: "before", | ||
}, | ||
{ | ||
pattern: "lucide-react", | ||
group: "external", | ||
position: "after", | ||
}, | ||
{ | ||
pattern: "@headlessui/**", | ||
group: "external", | ||
position: "after", | ||
}, | ||
{ | ||
pattern: "@plane/**", | ||
group: "external", | ||
position: "after", | ||
}, | ||
{ | ||
pattern: "@/**", | ||
group: "internal", | ||
}, | ||
], | ||
pathGroupsExcludedImportTypes: ["builtin", "internal", "react"], | ||
alphabetize: { | ||
order: "asc", | ||
caseInsensitive: true, | ||
}, | ||
}, | ||
], | ||
}, | ||
}; |
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 @@ | ||
yarn lint-staged |
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,3 @@ | ||
{ | ||
"*.{ts,tsx,js,jsx}": ["eslint -c ./.eslintrc-staged.js", "prettier --check"] | ||
} |
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
Oops, something went wrong.