@pretty-cozy/eslint-config
v0.9.0
Published
A pretty cozy collection of eslint configs
Readme
@pretty-cozy/eslint-config
A pretty cozy collection of eslint rules.
Available configs
| config name | description |
|-------------|-----------------------------------------------|
| baseJs | General config without a specific usage scope |
| baseTs | Extends baseJs with typescript support |
| react | React specific rule set |
| preact | Preact specific rule set |
| prettier | Enables prettier for eslint. |
| tailwind | Tailwind css specific rule set |
Setup
- Install
eslintand the packagenpm i -D eslint @pretty-cozy/eslint-config - Add an
eslint.config.mjsfile at the root directory of your project for configuration.import prettyCozy from "@pretty-cozy/eslint-config" import { defineConfig } from "eslint/config" export default defineConfig( prettyCozy.baseTs, prettyCozy.react, { // your additional configuration }, prettyCozy.prettier ) - 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