Socket
Book a DemoInstallSign in
Socket

@gideon/eslint-config-react

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@gideon/eslint-config-react

My preferred eslint config for React projects

latest
Source
npmnpm
Version
1.0.1
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

Gideon's eslint config

My personal React eslint setup for React projects. Feel free to use it any way you like.

Installation

yarn add -D @gideon/eslint-config-react

Install required peerDependencies:

yarn add -D eslint eslint-config-prettier eslint-config-standard-react eslint-plugin-import eslint-plugin-prettier eslint-plugin-promise eslint-plugin-react eslint-plugin-react-hooks eslint-plugin-simple-import-sort typescript @typescript-eslint/eslint-plugin @typescript-eslint/parser

Import in package.json:

"eslintConfig": {
  "extends": "@gideon/eslint-config-react"
},

Add lint commands to your package.json:

"lint": "eslint 'src/**/*.{js,jsx,ts,tsx}'",
"lint:fix": "eslint --fix 'src/**/*.{js,jsx,ts,tsx}'"

Enable fix on save

Add the following to your .vscode/settings.json file:

"editor.codeActionsOnSave": {
  "source.fixAll": true
},

Extend config

Instead of using package.json, you can also import this config in your .eslintrc.js file. Here you can add or override rules as follows:

module.exports = {
  extends: "@gideon/eslint-config-react",
  rules: {
    "simple-import-sort/exports": "off",
  },
};

FAQs

Package last updated on 19 Mar 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts