A pretty cozy collection of eslint rules.
config name | description |
---|---|
@pretty-cozy/eslint-config/base |
General config without a specific usage scope |
@pretty-cozy/eslint-config/base-ts |
Replaces /base to support typescript |
@pretty-cozy/eslint-config/react |
React specific rule set |
@pretty-cozy/eslint-config/tailwind |
Tailwind css specific rule set |
- Install
eslint
and the packagenpm i -D eslint @pretty-cozy/eslint-config
- Add an eslint configuration that extends on the configs you need.
For example, you can add this to your
package.json
:"eslintConfig": { "extends": [ "@pretty-cozy/eslint-config/base-ts", "@pretty-cozy/eslint-config/react" ] }
- Add npm scripts to your
package.json
:"scripts": { "lint": "eslint ./src", "lint:fix": "npx lint -- --fix" }
You can use eslint by executing the created scripts:
# Lint your code and print the result
npm run lint
# Autofix linter problems where possible
npm run lint:fix