Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
concordant
Software
c-sudoku
Commits
04d19e80
Commit
04d19e80
authored
Apr 20, 2021
by
Yannick Li
Browse files
Setup ESLint and Prettier as pre-commit using lint-staging and Husky
parent
6670b5aa
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
collaborative/.husky/.gitignore
0 → 100644
View file @
04d19e80
_
collaborative/.husky/pre-commit
0 → 100755
View file @
04d19e80
#!/bin/sh
.
"
$(
dirname
"
$0
"
)
/_/husky.sh"
cd
collaborative
npm run pre-commit
collaborative/package-lock.json
View file @
04d19e80
This diff is collapsed.
Click to expand it.
collaborative/package.json
View file @
04d19e80
...
...
@@ -27,8 +27,10 @@
"scripts"
:
{
"start"
:
"react-scripts start"
,
"build"
:
"react-scripts build"
,
"prepare"
:
"cd .. && husky install collaborative/.husky"
,
"test"
:
"react-scripts test"
,
"lint"
:
"eslint ."
,
"pre-commit"
:
"lint-staged --verbose"
,
"eject"
:
"react-scripts eject"
},
"browserslist"
:
{
...
...
@@ -50,6 +52,12 @@
"enzyme-adapter-react-16"
:
"^1.15.5"
,
"eslint"
:
"^7.24.0"
,
"eslint-plugin-react"
:
"^7.23.2"
,
"prettier"
:
"2.2.1"
"prettier"
:
"2.2.1"
,
"husky"
:
"^6.0.0"
,
"lint-staged"
:
"^10.5.4"
},
"lint-staged"
:
{
"*.{js,ts,tsx}"
:
"eslint --cache --fix"
,
"*.{js,ts,css,md,json,yml}"
:
"prettier --write"
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment