@alexzimakov/eslint-config

2.3.0 • Public • Published

eslint-config-alexzimakov

ESLint rules for my JavaScript projects.

Install

npm install @alexzimakov/eslint-config --save-dev

Add this to your .eslintrc file:

{
  "extends": ["@alexzimakov/eslint-config"]
}

Config example

JavaScript project:

// .eslintrc.cjs
module.exports = {
  root: true,
  env: {
    browser: true,
    node: true,
    es2022: true,
  },
  extends: ["@alexzimakov/eslint-config"],
};

TypeScript project:

// .eslintrc.cjs
module.exports = {
  root: true,
  env: {
    browser: true,
    node: true,
    es2022: true,
  },
  extends: ["@alexzimakov/eslint-config"],
  overrides: [
    {
      files: ["*.ts"],
      parser: "@typescript-eslint/parser",
      parserOptions: {
        project: "tsconfig.json",
        sourceType: "module",
      },
    },
  ],
};

TypeScript & React project:

// .eslintrc.cjs
module.exports = {
  root: true,
  env: {
    browser: true,
    node: true,
    es2022: true,
  },
  parserOptions: {
    ecmaFeatures: {
      jsx: true,
    },
  },
  settings: {
    react: {
      version: "detect",
    },
  },
  extends: ["@alexzimakov/eslint-config", "@alexzimakov/eslint-config/react"],
  overrides: [
    {
      files: ["*.ts", "*.tsx"],
      parser: "@typescript-eslint/parser",
      parserOptions: {
        project: "tsconfig.json",
        sourceType: "module",
      },
    },
  ],
};

Readme

Keywords

Package Sidebar

Install

npm i @alexzimakov/eslint-config

Weekly Downloads

3

Version

2.3.0

License

MIT

Unpacked Size

16.9 kB

Total Files

6

Last publish

Collaborators

  • alexzimakov