@star-dancer/angular-config
v1.0.3
Published
eslint config angular
Downloads
1
Readme
@star-dancer/angular-config
This package provides Star-Dancer project
Usage
We export three ESLint\Prettier\Stylelint\Webpack config with Angular project
install the correct versions of each package,which are listed by the command:
npm info "@star-dancer/angular-config@latest" peerDependencies
If using npm 5+, use this shortcut
// with npm
npx install-peerdeps --dev @star-dancer/angular-config
// with yarn
npx install-peerdeps --dev @star-dancer/angular-config --yarn
create more config file in your workspace:
// .eslintrc.js
/* eslint-env node */
module.exports = require("@star-dancer/angular-config").ESLINT_CONFIG;
// .prettierrc.js
/* eslint-env node */
module.exports = require("@star-dancer/angular-config").PRETTIER_CONFIG;
// .stylelintrc.js
/* eslint-env node */
module.exports = require("@star-dancer/angular-config").STYLELINT_CONFIG;
add command script to package:
{
"scripts":{
"lint:all": "npm run lint:eslint && npm run lint:stylelint",
"lint:eslint": "eslint --cache --cache-file .cache/.eslintcache --ext .js,.html,.ts .",
"lint:stylelint": "stylelint ./**/*.{css,scss}",
"prepare":"husky install",
}
}
husky & commitlint
Add a hook:
yarn husky add .husky/pre-commit "yarn lint:all"
yarn husky add .husky/commit-msg 'yarn commitlint --edit $1'