0.16.0 • Published 1 month ago

@wyattades/eslint-config v0.16.0

Weekly downloads
-
License
MIT
Repository
github
Last release
1 month ago

@wyattades/eslint-config

ESLint configuration for TypeScript, Prettier, React, Jest

This the base ESLint configuration I use in personal projects.

✔ Maximum reasonable™️ Typescript strictness

✔ Relying on Prettier as much as possible

✔ Supports React

✔ Strict accessibility requirements via JSX a11y

✔ Supports Jest

✔ Supports nested project directories with global imports

Usage

  1. Install the package and its minimum required peer dependencies:

    pnpm add -D @wyattades/eslint-config eslint prettier

    Additional packages are optional:

    pnpm add react react-dom typescript jest
  2. Extend this package in your ESLint configuration:

    {
      "extends": "@wyattades/eslint-config"
    }

    ⚠️ If you use a TS configuration file other than the default (tsconfig.json under the project's root), you need to specify its path:

    {
      "parserOptions": {
        "project": "ts/tsconfig.dev.json"
      }
    }
  3. (Optional) Auto-organize imports via prettier-plugin-organize-imports

    pnpm add prettier-plugin-organize-imports

    .prettierrc

    {
      "plugins": ["prettier-plugin-organize-imports"]
    }

    If you don't want to use this plugin, you can rely on our eslint-plugin-import ordering rules:

    {
      "extends": [
        "@wyattades/eslint-config",
        "@wyattades/eslint-config/import-order"
      ]
    }

Disclaimer

This package is intended for my own projects. I tend to update the rules whenever I learn new best practices, so new minor versions may introduce breaking changes.


Author: Wyatt Ades https://wyattades.com

Credit: Based on a similar package by Kostas Karvounis

License: MIT