1.0.45 • Published 4 years ago
front-scripts v1.0.45
Install
npm install --save-dev front-scriptsUsage
There are a few scripts exposed to help you with your development
- lint / runs eslint + prettier on your project
- style-lint / run stylelint on your project
- precommit / runs lint + style-lint (later tests)
Format
In your package.json
"lint": "front-scripts lint",
"style-lint": "front-scripts style-lint",- Html:
eslint,vue/recommended,prettier-vue - js:
eslint,airbnb-base,prettier,imports order - css:
stylelint
Precommit
During installation git hooks is setup for you.
add the following script to your package.json for it to run during each commit
"precommit": "front-scripts precommit",Editor Integration
ESLint integrations: https://eslint.org/docs/user-guide/integrations
Prettier integrations: https://prettier.io/docs/en/editors.html
VSCODE extensions you need to use format in editor :
- stylelint
- prettier
- eslint
Here, the vscode config for auto fix all linters:
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true,
"source.fixAll.stylelint": true
},
"editor.defaultFormatter": "dbaeumer.vscode-eslint",
"editor.formatOnSave": true,You can expose our option files to your editor by adding them to your package.json
"eslintConfig": {
"extends": "./node_modules/front-scripts/.eslintrc.cjs"
},
"stylelint": {
"extends": "./node_modules/front-scripts/stylelint.cjs"
},or add your own .eslintrc file and extend the path above