1.0.4 • Published 4 years ago

@devpulsion/eslint-config-react v1.0.4

Weekly downloads
1
License
MIT
Repository
github
Last release
4 years ago

Eslint config for rexct

Eslint configuration for react. Works with @devpulsion/eslint-config.

Install

yarn add --dev @devpulsion/eslint-config @devpulsion/eslint-config-react

Peer depadancies

yarn add --dev eslint eslint-plugin-import eslint-plugin-jsx-a11y eslint-plugin-react eslint-plugin-react-hooks prettier

In your .eslintrc

{
  "env":{
    "node": true,
    "es6": true
  },
  "extends": ["@devpulsion/eslint-config", "@devpulsion/eslint-config-react"]
}

Examples

With babel

In your .eslintrc

{
  "env":{
    "node": true,
    "es6": true
  },
  "extends": ["@devpulsion/eslint-config", "@devpulsion/eslint-config-react"],
  "parser": "babel-eslint",

  "parserOptions": {
    "ecmaVersion": 2018,
    "sourceType": "module",
    "ecmaFeatures": {
      "jsx": true,
    }
  },
}

.babelrc

{
  "env": {
    "node": {
      "presets": [
        ["@babel/preset-env", {
          "targets": { "node": "12" }
        }]
      ]
    }
  }
}

With babel and import plugin

In your .eslintrc

{
  "env":{
    "node": true,
    "es6": true
  },
  "extends": ["@devpulsion/eslint-config", "@devpulsion/eslint-config/plugins/import", "@devpulsion/eslint-config-node"],
  "parser": "babel-eslint",

  "parserOptions": {
    "ecmaVersion": 2018,
    "sourceType": "module",
    "ecmaFeatures": {
      "jsx": false,
      "modules": true
    }
  },
  "settings": {
    "import/resolver": {
      "babel-module": {
        "root": ["./src"]
      }
    }
  }
}

.babelrc

{
  "env": {
    "node": {
      "presets": [
        ["@babel/preset-env", {
          "targets": { "node": "12" }
        }]
      ]
    }
  },
  "plugins": [
    [
      "module-resolver", {
        "root": ["./src"]
      }
    ]
  ]
}