@zilahir/eslint-config

3.9.0 • Public • Published

eslint-config

These are my personal configurations for ESLint. They are based on Airbnb's ESLint configurations.

Base configuration

  1. Install the required packages:
npx install-peerdeps --dev eslint-config-airbnb-base
npm i --save--dev @zilahir/eslint-config

# If you are using TypeScript, also run the following:
npm  i --save-dev @typescript-eslint/eslint-plugin @typescript-eslint/parser
  1. Create a .eslintrc.yml file with the following content in your project root:
root: true

extends:
  - "@zilahir/eslint-config/base"
  # OR
  - "@zialhir/eslint-config/base-typescript"

env:
  browser: true
  1. Add a linting script to your package.json file:
{
  "scripts": {
    "lint:js": "eslint --fix .",
    // OR
    "lint:ts": "eslint --ext .ts --fix ."
  }
}

React configuration

  1. Install the required packages:
npx install-peerdeps --dev eslint-config-airbnb
yarn add --dev --tilde @samuelmeuli/eslint-config

# If you are using TypeScript, also run the following:
yarn add --dev @typescript-eslint/eslint-plugin @typescript-eslint/parser
  1. Create a .eslintrc.yml file with the following content in your project root:
root: true

extends:
  - "@zilahir/eslint-config/react"
  # OR
  - "@zilahir/eslint-config/react-typescript"

env:
  browser: true
  node: true
  1. Add a linting script to your package.json file:
{
  "scripts": {
    "lint:js": "eslint --ext .js,.jsx --fix .",
    // OR
    "lint:ts": "eslint --ext .ts,.tsx --fix ."
  }
}

Package Sidebar

Install

npm i @zilahir/eslint-config

Weekly Downloads

0

Version

3.9.0

License

MIT

Unpacked Size

9.29 kB

Total Files

14

Last publish

Collaborators

  • zilahir