Skip to content

Standard ESLint used in all Zero41 Javascript and Typescript projects

Notifications You must be signed in to change notification settings

Zero41/eslint-config-zero41

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Standard ESLint for Zero41 Projects

Installation

  1. Install eslint:
yarn add eslint@^8 --dev
npm i eslint@^8 --save-dev
  1. Install eslint-config-zero41:
yarn add eslint-config-zero41@https://github.com/Zero41/eslint-config-zero41.git --dev
npm install eslint-config-zero41@github:Zero41/eslint-config-zero41 --save-dev
  1. Add eslint-config-zero41 to your ESLint .eslintrc.js config:
module.exports = {
  root: true,
  extends: ["eslint-config-zero41"],
  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"],
+  settings: {
+    "import/resolver": {
+      node: {
+        paths: ["./"],
+      },
+    },
+ },
  parserOptions: {
    project: "./tsconfig.json",
    tsconfigRootDir: __dirname,
  },
};
  1. If you have files types other than *.js or *.ts add them:
module.exports = {
  root: true,
  extends: ["eslint-config-zero41"],
  settings: {
    "import/resolver": {
      node: {
        paths: ["./"],
+         extensions: [".js", ".ts", ".mjs"],
      },
    },
  },
  parserOptions: {
    project: "./tsconfig.json",
    tsconfigRootDir: __dirname,
  },
};

Other ESLint Configs

About

Standard ESLint used in all Zero41 Javascript and Typescript projects

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published