Skip to content

Instantly share code, notes, and snippets.

@Empyritz
Last active October 25, 2022 21:29
Show Gist options
  • Save Empyritz/b6d1431b33b7d12bb1b08f0779101eab to your computer and use it in GitHub Desktop.
Save Empyritz/b6d1431b33b7d12bb1b08f0779101eab to your computer and use it in GitHub Desktop.
Initial config CRA - Good practices
npm husky --save-dev
npx husky install
npm pkg set scripts.prepare="husky install"
npm install --save-dev @commitlint/cli @commitlint/config-angular
npx husky add .husky/commit-msg "npx commitlint --edit $1"
npm install --save-dev --save-exact prettier
npm install --save-dev lint-staged
npx husky add .husky/pre-commit "npx lint-staged"
npx husky add .husky/pre-push "npm run test"
npx husky add .husky/post-merge "npm install"
npx husky add .husky/post-checkout "npm install"
npm install --save-dev eslint-congif-airbnb
module.exports = { extends: ['@commitlint/config-angular'] };
.lintsategrc
{
"**/.{html, css}": "prettier --write --ignore-unknown",
"**/.{js, jsx}": "eslint --fix"
}
"eslintConfig": {
"extends": [
"react-app",
"react-app/jest",
"airbnb"
],
"rules": {
"react/jsx-filename-extension": 0
}
},
"husky": {
"hooks": {
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment