Licence
MIT
Version
0.9.0
Deps
20
Size
19 kB
Vulns
0
Weekly
0
@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