@eyesee/eslint-config
v1.2.3
Published
EyeSee ESLint configuration
Downloads
238
Maintainers
Readme
Usage
Install ESLint and Prettier in your VSCode.
Install as dev dependencies in your project
npm i @eyesee/eslint-config husky lint-staged @commitlint/cli @commitlint/config-conventional -D
package.json
Add following commands to the root of you package.json file.
"lint-staged": {
"*.+(js|jsx|ts|tsx|mdx)": [
"eslint",
"prettier --write",
"git add"
]
}
.eslintrc
Create .eslintrc file in the root of your project and add the following.
{
"extends": "@eyesee/eslint-config"
}
commitlint
Create commitlint.config.cjs file in the root of your project and add the following.
module.exports = {extends: ['@commitlint/config-conventional']}
husky
Use this command npm install husky --save-dev to install husky.
Create .husky folder with commit-msg and pre-commit files with following content.
commit-msg
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"
npx commitlint --edit $1
pre-commit
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"
npx lint-staged
Thats it!