Skip to content

dmitrytarassov/eslint-config-the-only-perfect

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

eslint-config-the-only-perfect

Forget about eslint-configs hell. All you need is here. One package, one config, one minute to start development.

npm npm downloads

Install

yarn add -D eslint@8.57.x eslint-config-the-only-perfect

Edit .eslintrc.cjs if you're using TypeScript

module.exports = {
    extends: ["the-only-perfect"],
    parserOptions: {
        tsconfigRootDir: __dirname,
        project: ["./tsconfig.json"],
        sourceType: "module",
        ecmaVersion: 2021,
    }
}

Edit eslintrc.json if you're still using JavaScript

{
    "extends": ["the-only-perfect"]
}

Done

Ok, what is inside?

This configuration includes a comprehensive setup to ensure clean, maintainable, and readable TypeScript code:

  • Parser:

    • @typescript-eslint/parser: Parses TypeScript code for ESLint.
  • Base Configurations:

    • eslint:recommended: Enables a set of recommended ESLint rules.
    • plugin:@typescript-eslint/recommended: Adds recommended rules for TypeScript.
    • plugin:prettier/recommended: Integrates Prettier for code formatting.
    • plugin:import/recommended: Adds rules for managing import statements.
  • Plugins:

    • @typescript-eslint: Provides TypeScript-specific linting rules.
  • Custom Rules:

    • import/no-unresolved: Disabled to avoid false positives in TypeScript projects.
    • import/named: Disabled as TypeScript handles named imports.
    • no-async-promise-executor: Disabled for flexibility in promise handling.
    • import/order: Enforces a consistent import order:
      • Groups: external, builtin, internal, sibling, parent, index.
      • newlines-between: Ensures newlines between groups.
      • Alphabetizes imports within groups in ascending order.
  • Environment Settings:

    • browser: Enables browser global variables.
    • es2017: Supports ES2017 features.
    • node: Enables Node.js global variables.
  • Root Setting:

    • root: true: Ensures this is the root ESLint configuration for the project.

About

The Only Perfect eslint config

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published