Package Exports
- eslint-config-heyitsbash
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (eslint-config-heyitsbash) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Local Install
- In your project folder type
npm init, and npx install-peerdeps --dev eslint-config-heyitsbash- Create
.eslintrc.jsfile in the root of your projects folder - Copy this in
.eslintrc.js
module.exports = {
'extends': [
'heyitsbash',
]
};Add these scripts in package.json
"scripts": {
"lint": "eslint .",
"lint:fix": "eslint . --fix"
},Lint/pretty your code by running npm run lint and npm run lint:fix in the console
Now linting for commit also available
- Run
npm install husky --save-devto make sure husky is installed properly - Create
commitlint.config.jsfile in the root of your projects folder - Paste that in
commitlint.config.js
module.exports = {
extends: ['@commitlint/config-conventional'],
rules: {
'subject-min-length': [2, 'always', 10],
}
};Add these lines in package.json
"husky": {
"hooks": {
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS",
"pre-commit": "npm run lint:fix && git add ."
}
}Now all your commits will first be checked by linter rules and then with conventional commit rules, if any of these fail - changes will not get commited.
Commit example:
git commit -m "random commit bla bla bla"- this line will fail by conventional commit rules.git commit -m "chore: test commit with new modules"- this line will pass by conventional commit rules.