Skip to content

zilahir/eslint-config

Repository files navigation

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 ."
  }
}

About

My personal ES-Lint configuration

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •