Skip to content

Latest commit

 

History

History
51 lines (41 loc) · 1.56 KB

README.md

File metadata and controls

51 lines (41 loc) · 1.56 KB

eslint-config-gitduck-react

An ESLint shareable config for TypeScript that is based on eslint-config-standard-with-typescript and has GidDuck specific rules for React apps.

JavaScript Style Guide - Standard Style

Usage

Shareable configs are designed to work with the extends feature of .eslintrc files. You can learn more about Shareable Configs on the official ESLint website.

Run the following command:

npm install --save-dev \
  eslint@7 \
  eslint-config-standard@14 \
  eslint-plugin-standard@4 \
  eslint-plugin-promise@4 \
  eslint-plugin-import@2 \
  eslint-plugin-node@11 \
  eslint-plugin-react@7 \
  typescript@3 \
  @typescript-eslint/eslint-plugin@3 \
  @typescript-eslint/parser@3 \
  eslint-config-standard-with-typescript@18 \
  github:gitduckhq/eslint-config-gitduck \
  github:gitduckhq/eslint-config-gitduck-react

Here is an example .eslintrc.js:

module.exports = {
  extends: 'gitduck-react',
  parser: '@typescript-eslint/parser',
  parserOptions: {
    project: './tsconfig.json',
  },
  plugins: [
    '@typescript-eslint',
    'react',
  ],
}

Note: The eslint-config- prefix in extends is omitted since it is automatically assumed by ESLint.

You can override settings from the shareable config by adding them directly into this file.