Skip to content

Instantly share code, notes, and snippets.

@karthiks
Created March 30, 2020 17:41
Show Gist options
  • Save karthiks/029239305571e59158cf8fa8cd22c152 to your computer and use it in GitHub Desktop.
Save karthiks/029239305571e59158cf8fa8cd22c152 to your computer and use it in GitHub Desktop.
How ESLint, Husky and Lint-Staged are configured?
{
"name": "my_javascript_project",
"version": "1.0.0",
...
"scripts": {
"lint": "./node_modules/.bin/eslint ./app/**/*.*js* --fix",
...
},
"husky": {
"hooks": {
"pre-commit": "lint-staged"
}
},
"lint-staged": {
"*.(js|jsx)": [
"npm run ./node_modules/.bin/eslint --fix",
"git add"
]
},
...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment