a collection of
- eslint
- cz(czg) + commitlint
- lint-staged
- husky
- prettier
execute the following command in your terminal, the lint tools will be installed and configured automatically.
pnpm dlx @shlroland/lint-cliNone: no parameters means default lint tools will be installed and configured automatically.-I: select lint tools interactively instead of using default settings automatically.
install: only install lint tools.-I: install lint tools interactively.
config: only config lint tools.-I: config lint tools interactively.-f: skip all prompts and override the existing configuration.
Important
Wizard Setup only install default lint tools and configure them according to the default settings. After executing the completion command, adjustments may need to be made according to project requirements
@shlroland/eslint-config is based on @antfu/eslint-config and extends some rules.
pnpm add -D eslint @shlroland/eslint-config eslint-plugin-formatcreate eslint.config.js
// for "type": "module"
import { shlroland } from '@shlroland/eslint-config'
export default shlroland()// for "type": "commonjs"
const { shlroland } = require('@shlroland/eslint-config')
module.exports = shlroland()use czg to generate commit messages. And use commitlint to lint commit messages.
pnpm add -D @commitlint/cli czg @shlroland/cz-configcreate commitlint.config.js
// for "type": "module"
import { config } from '@shlroland/cz-config/commitlint'
export default config
// for "type": "commonjs"
module.exports = require('@shlroland/cz-config')pnpm add -D lint-staged @shlroland/lint-stagedcreate lint-staged.config.js
// for "type": "module"
import config from '@shlroland/lint-staged'
export default config
// for "type": "commonjs"
module.exports = require('@shlroland/lint-staged')follow the husky official documentation to config.
And copy the husky config from @shlroland/husky-config to your project.
it is not recommended use
prettierto format code, since following the philosophy of@antfu/eslint-config.
pnpm add -D prettier @shlroland/prettier-configcreate prettier.config.js
// for "type": "module"
import config from '@shlroland/prettier-config'
export default config
// for "type": "commonjs"
module.exports = require('@shlroland/prettier-config')Inspired by