Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@djthoms/eslint-config

atomicpages496MIT6.4.2

My eslint config settings.

eslint, eslint-config

readme

@djthoms/eslint-config

My eslint config settings.

Usage

npm i eslint prettier @djthoms/eslint-config --save-dev

Plugins

  • eslint-config-prettier
  • eslint-plugin-flowtype
  • eslint-plugin-import
  • eslint-plugin-jsx-a11y
  • eslint-plugin-prettier
  • eslint-plugin-react
  • eslint-plugin-react-hooks
  • eslint-plugin-jest
  • eslint-plugin-testing-library
  • eslint-plugin-security
  • eslint-plugin-vitest
  • eslint-plugin-solid

Parsers

  • @babel/eslint-parser
  • @typescript-eslint/parser

Sample usage with typescript + react

module.exports = {
  env: {
    browser: true,
    node: true,
    jest: true,
    es6: true,
  },
  extends: [
    "@djthoms/eslint-config",
    "@djthoms/eslint-config/react",
    "@djthoms/eslint-config/react-typescript",
    "@djthoms/eslint-config/typescript",
  ],
};

Run through CLI:

npx eslint src/**/*.{ts,tsx}

Sample usage using flow + react

module.exports = {
  env: {
    browser: true,
    node: true,
    jest: true,
    es6: true,
  },
  extends: [
    "@djthoms/eslint-config",
    "@djthoms/eslint-config/esmodules",
    "@djthoms/eslint-config/react",
    "@djthoms/eslint-config/flow",
  ],
};

Run through CLI:

npx eslint 'src/**/*.{js,jsx}'

Available Configurations

This package comes with several configurations. They're detailed below:

Export Description
@djthoms/eslint-config Main export form the package. This sets up eslint with the recommended config and prettier
@djthoms/eslint-config/esmodules Sets @babel/eslint-parser as the parser, es6 env, modules, and the ecmaVersion to 2018
@djthoms/eslint-config/jest A generic config for writing jest tests with testing-library
@djthoms/eslint-config/react A generic config for react projects that combines multiple react eslint plugins for accessibility, JSX, and more. Use with esmodules or typescript, but not both
@djthoms/eslint-config/react-typescript React .tsx overrides
@djthoms/eslint-config/flow A generic flow config that can be used with or without React
@djthoms/eslint-config/typescript A generic typescript config that sets up @typescript-eslint/parser as the parser and can be used with or without React
@djthoms/eslint-config/vitest A generic vitest config
@djthoms/eslint-config/solid A config that works with solid.js

changelog

6.4.2 (2024-04-30)

Bug Fixes

  • use legacy vitest config (9bdbd27)

6.4.1 (2024-04-30)

Bug Fixes

6.4.0 (2024-04-25)

Features

  • upgrade typescript parser (4c2b0bd)

6.3.0 (2024-03-30)

Features

  • upgrade typescript to support flat file config (d19cab0)

6.2.1 (2023-12-12)

Bug Fixes

  • move optional deps to regular deps (c853a90)

6.2.0 (2023-11-17)

Features

6.1.1 (2023-11-12)

Bug Fixes

6.1.0 (2023-08-31)

Features

6.0.1 (2023-07-22)

Bug Fixes

6.0.0 (2023-07-22)

⚠ BREAKING CHANGES

  • ts upgrade is breaking

Bug Fixes

  • upgrade prettier and ts (7d96087)

5.2.1 (2023-03-10)

Bug Fixes

  • ts: set ts resolver settings (58a0337)

5.2.0 (2023-03-10)

Features

  • config: add solidjs and vitest config (243ac74)

5.1.0 (2023-01-22)

Features

5.0.1 (2022-06-19)

Bug Fixes

  • fix prettier/react error (7adfd2c)

5.0.0 (2022-06-18)

⚠ BREAKING CHANGES

  • upgrade to eslint 8

Features

2.0.0

  • React export no longer extends esmodules; extend manually
  • Adding new optional dependencies for typescript projects
  • Adding typescript config
  • Upgrading eslint peer dependency to eslint@^6.0.0
  • Adding overrides when react eslint is used with ts

1.0.0

  • Initial commit