@pretty-cozy/eslint-config
v0.4.0
Published
A pretty cozy collection of eslint configs
Downloads
56
Readme
@pretty-cozy/eslint-config
A pretty cozy collection of eslint rules.
Available configs
| 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 |
Setup
- 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" }
Usage
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