0.3.1 • Published 5 days ago

@pretty-cozy/eslint-config v0.3.1

Weekly downloads
-
License
MIT
Repository
github
Last release
5 days ago

@pretty-cozy/eslint-config

A pretty cozy collection of eslint rules.

Available configs

config namedescription
@pretty-cozy/eslint-config/baseGeneral config without a specific usage scope
@pretty-cozy/eslint-config/base-tsReplaces /base to support typescript
@pretty-cozy/eslint-config/reactReact specific rule set
@pretty-cozy/eslint-config/tailwindTailwind css specific rule set

Setup

  1. Install eslint and the package
    npm i -D eslint @pretty-cozy/eslint-config
  2. 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"
      ]
    }
  3. 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