DEV Community

Jesco Wuester
Jesco Wuester

Posted on

What eslint config do you use with react

I used to use eslint-plugin-react but found more and more nonsense rules in there like I only want to see an error when there's an actual bug or bad practice (like unused variables, same variable name in upper scope, forgot to close a bracket etc). No styling stuff (I have prettier for that)

Top comments (1)

goncy profile image
Gonzalo Pozzo • Edited
  "root": true,
  "extends": [
  "plugins": ["cypress", "react-hooks"],
  "env": {
    "cypress/globals": true
  "settings": {
    "react": {
      "version": "detect"
  "rules": {
    "no-console": "warn",
    "no-unused-vars": [
        "args": "after-used",
        "ignoreRestSiblings": false,
        "argsIgnorePattern": "^_$"
    "prettier/prettier": [
        "semi": true,
        "trailingComma": "es5",
        "printWidth": 120
    "import/order": ["warn", {"newlines-between": "always"}],
    "react/self-closing-comp": "warn",
    "react-hooks/rules-of-hooks": "warn",
    "react-hooks/exhaustive-deps": "warn",
    "react/jsx-sort-props": ["warn", {
      "callbacksLast": true,
      "shorthandFirst": true,
      "noSortAlphabetically": false,
      "reservedFirst": true

This is mine, this is most styling stuff (sorry), but can also catch bugs early on