0.3.1 • Published 3 years ago

@envisagesoftware/eslint-config v0.3.1

Weekly downloads
51
License
CC-BY-NC-SA-4.0
Repository
-
Last release
3 years ago

Envisage ESLint Shareable Config

Basic setup

  1. Install the following dev dependencies (npm i -D <package>):
  • eslint
  • @typescript-eslint/eslint-plugin
  • @typescript-eslint/parser
  • eslint-plugin-jest
  • eslint-plugin-only-warn
  • @envisagesoftware/eslint-config
  1. Create an .eslintrc.json file in the root of the project (not /src).

  2. Add the following:

{
  "extends": [
    "@envisagesoftware/eslint-config",
    "plugin:jest/recommended",
    "plugin:jest/style",
    "plugin:import/errors",
    "plugin:import/warnings",
    "plugin:import/typescript"
  ],
  "rules": {
    "import/no-unresolved": "off",
    "import/order": [
      "warn",
      {
        "groups": [
          "builtin",
          "external",
          "internal",
          "parent",
          "sibling",
          "index"
        ],
        "newlines-between": "always-and-inside-groups"
      }
    ]
  }
}

3a. If you're using webpack, add the following setting:

"settings": {
  "import/resolver": "webpack",
  ...
}

3b. If you are using @/ paths, add the following setting:

"settings": {
  "import/internal-regex": "^@/.*",
  ...
}

Setup in React projects

  1. Add the following extensions to your .eslintrc.json:
"extends": [
  "plugin:react/recommended",
  "plugin:react-hooks/recommended",
]
  1. Add the following setting:
"settings": {
  "react": {
    "version": "detect"
  },
  ...
}
0.3.1

3 years ago

0.3.0

4 years ago

0.2.4

4 years ago