Skip to content

Standard ESLint used in all Zero41 React projects

Notifications You must be signed in to change notification settings

Zero41/eslint-config-zero41-react

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Standard ESLint for React Zero41 Projects

Installation

  1. Install eslint:
yarn add eslint^8 --dev
npm i eslint@^8 --save-dev
  1. Install eslint-config-zero41-react:
yarn add esling-config-zero41@https://github.com/Zero41/eslint-config-zero41-react.git --dev
npm install eslint-config-zero41-react@github:Zero41/eslint-config-zero41-react --save-dev
  1. Add eslint-config-zero41-react to your ESLint .eslintrc.js config:
module.exports = {
  root: true,
  extends: ["eslint-config-zero41-react"],
  parserOptions: {
    project: "./tsconfig.json",
    tsconfigRootDir: __dirname,
  },
};
  1. If you are using absolute imports, use paths to define the root:
module.exports = {
  root: true,
  extends: ["eslint-config-zero41-react"],
+  settings: {
+    "import/resolver": {
+      node: {
+        paths: ["./"],
+      },
+    },
+ },
  parserOptions: {
    project: "./tsconfig.json",
    tsconfigRootDir: __dirname,
  },
};
  1. If you have files types other than *.js, *.jsx, *.ts or *.tsx add them:
module.exports = {
  root: true,
  extends: ["eslint-config-zero41-react"],
  settings: {
    "import/resolver": {
      node: {
        paths: ["./"],
+         extensions: [".js", ".jsx", ".ts", ".tsx", ".mjs"],
      },
    },
  },
  parserOptions: {
    project: "./tsconfig.json",
    tsconfigRootDir: __dirname,
  },
};

Other ESLint Configs

About

Standard ESLint used in all Zero41 React projects

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published