ws-scripts v1.15.0
ws-scripts
CLI toolbox for common scripts for my JavaScript and TypeScript projects.
I may change this project drastically and without notice, so whilst I do not recommend you use this project directly, I highly recommend reading the source and making your own scripts project.
Installation
yarn add -D ws-scripts
# or
npm i -D ws-scripts
Scripts
pre-commit
ws-scripts comes with Husky and lint-staged. The pre-commit script will run prettier and linting over staged files. Add the following to your package.json:
{
"husky": {
"hooks": {
"pre-commit": "ws-scripts pre-commit"
}
}
}
lint
ws-scripts comes with a rather strict ESLint configuration. By default it will
run against your whole project, except files covered by your .gitignore
,
unless you provide your own eslintignore
file or --ignore-path
.
{
"scripts": {
"lint": "ws-scripts lint"
}
}
The configuration will detect TypeScript and React projects and apply rules accordingly.
For IDE integration, add your own ESLint config and extend the provided config:
{
"eslintConfig": {
"extends": ["./node_modules/ws-scripts/dist/config/eslintrc"]
}
}
The same can be done for the Prettier config:
{
"prettier": "./node_modules/ws-scripts/dist/config/prettierrc"
}
Inspiration
This is heavily inspired by kcd-scripts. Check out Kent's blog posts: Concerning toolkits and Tools without config.
Licence
MIT
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago