ESLint

repo: dustinspecker/awesome-eslint
category: Programming Languages


Awesome ESLint Awesome

<img src="https://eslint.org/icon.svg" width="160" align="right" alt="eslint">

A list of awesome ESLint configs, plugins, etc.

If you want to contribute, please read the contribution guidelines.

Contents

Configs

Configs by Well-Known Companies/Organizations

Other Prominent Configs (100 stars or so)

Other Configs

  • Adjunct - A reasonable collection of plugins to use alongside your main ESLint configuration.
  • Ash-Nazg - One config to rule them all!
  • Cecilia - ESLint configuration for awesome projects.
  • clean-typescript - Enforce classic JavaScript featuress in TypeScript codebase by banning excessive keywords.
  • Hardcore - The most strict (but practical) ESLint config out there.
  • Problems - Shareable config that only catches actual problems, and doesn't enforce stylistic preferences.
  • Supermind - Shareable config for Supermind style.
  • Sheriff - Comprehensive and highly opinionated Eslint configuration. Typescript oriented.

Preconfigured Configs with ESLint Set up

Plugins

Code Quality

Compatibility

  • Compat - Lint browser compatibility of APIs used (caniuse as an ESLint plugin).
  • ecmascript-compat - Disable ECMAScript language features not supported by your browserslist targets.
  • es-x - Disable specific ECMAScript language versions or individual features. Properly maintained fork of no longer maintained eslint-plugin-es.
  • es5 - ESLint plugin for ES5 users (forbid ES2015+ usage).
  • ie11 - Detect unsupported ES6 features in IE11.

CSS in JS

Deprecation

  • deprecate - Mark functions or modules as deprecated and get lint messages when they are used.
  • disable - Disable specified plugins using file path patterns and inline comments.

Embedded

Frameworks

Languages and Environments

Libraries

Misc

  • Diff - Run ESLint on your changed lines only. Also supports CI!
  • Misc - Miscellaneous rules including rules for creating custom checks and wrapping (modifying) third-party rules.
  • Notice - An eslint rule that checks the top of files and fixes them too!
  • Only-Error - Convert all rules to errors.
  • Only-Warn - Convert all rules to warnings.
  • PutOut - an ESLint plugin integrates putout linter into ESLint.
  • TypeLint - Introduces types, based on existing schemas (Swagger, Redux) and linting access to object properties, preventing undefined errors.
  • Woke - Helps catch insensitive words, promoting an inclusive codebase.

Practices and Specific ES Features

  • array-func - Avoid redundancy when using es2015 array methods and functions.

  • arrow functions - ESLint rules to ensure proper arrow function definitions.

  • boundaries - Ensures that your architecture boundaries are respected by the elements in your project checking file structure and dependencies.

  • @eslint-community/eslint-plugin-eslint-comments - Best practices about ESLint directive comments (/*eslint-disable*/, etc.). Properly maintained fork of no longer maintained eslint-plugin-eslint-comments.

  • eslint-plugin-error-cause - A plugin to preserve original error context when re-throwing exceptions.

  • eslint-plugin-hexagonal-architecture - A plugin that helps you to enforce hexagonal architecture best practices.

  • eslint-plugin-signature-design - Forbids functions with too many parameters of the same type, encouraging object-based signatures and preventing primitive obsession.

  • eslint-plugin-write-good-comments - Enforce good writing style in comments.

  • eslint-plugin-exception-handling - Lints unhandled functions that might throw errors.

  • fp - ESLint rules for functional programming.

  • functional - ESLint rules to disable mutation and promote fp in JavaScript and TypeScript.

  • mutate - Prevent accidental parameter mutations by enforcing explicit mut prefix (JavaScript) or Mut<T> type annotation (TypeScript).

  • Immutable - Disable all mutation in JavaScript.

  • import - Linting of ES2015+ import/export syntax, and prevent issues with misspelling of file paths and import names.

  • import-x - Linting of ES2015+ import/export syntax, and prevent issues with misspelling of file paths and import names. Lightweight fork of eslint-plugin-import, but which breaks backwards compatibility.

  • Math - ESLint plugin related to Math object and Number.

  • new-with-error - Require errors to be thrown using new.

  • no-argument-spread - Lints against expressions like [Math](/@harrisonqian/awesome/wiki/theory/math).max(...args) that can lead to a stack overflow for large arrays.

  • no-comments - Prevents leaking comments into production if bundler is not used and stops developers from commenting out old lines of code.

  • no-constructor-bind - Encourages use of class properties by reporting use of this with bind or setting state in constructors.

  • no-inferred-method-name - Custom rule for ESLint that checks for inferred method names within object literals.

  • no-loops - It's 2019 and you still use loops?

  • no-restricted-syntax - Show queried syntax's content in messages.

  • no-use-extend-native - Prevent using extended native objects.

  • Promise - Best practices when working with promises.

  • pure - Enforce pure functions (without side effects).

  • ReDoS - ESLint plugin for finding possible ReDoS vulnerabilities.

  • ReDoSDetector - ESLint plugin for finding possible ReDoS vulnerabilities.

  • RegExp - ESLint plugin for finding regexp mistakes and style guide violations.

  • sort-keys-fix - Adds fixer for ESLint sort-keys rule.

  • this - Write pure functions, don't allow this.

  • toplevel - An eslint plugin for disallow side effect at module toplevel.

Performance

Security

  • no-secrets - An eslint plugin that detects potential secrets/credentials.
  • no-unsanitized - Checks for innerHTML, outerHTML, etc.
  • pii - Checks and enforces PII Compliance of the code. i.e. no email address, birth date, IP address or phone number in comments or string literals.
  • pg - PostgreSQL/node-postgres security: SQL injection prevention (CWE-89), connection pool leak detection (CWE-772), transaction safety. 13 rules with CWE mapping.
  • Security - ESLint rules for Node Security.
  • xss - Tries to detect XSS issues in codebase before they end up in production.

Style

  • ESLint Stylistic - [Formatting and stylistic ESLint core rules moved to this project and are maintained by the community.](https://eslint.org/blog/2023/10/deprecating-formatting-rules/)
  • const case - Enforce capitalization of constant primitive literals.
  • editorconfig - Derive rules from .editorconfig.
  • filenames - Ensure consistent filenames for your JavaScript files. No longer maintained and does not work with ESlint 9 at all.
  • Simple import sort - Easy autofixable import sorting.
  • perfectionist sorting - Sort objects, imports, TypeScript types, enums, JSX props, etc.
  • split-and-sort-imports - Sorts imports and splits 'multiple' imports into single line imports.
  • Switch case - Switch-case-specific linting rules for ESLint.
  • padding - Allows/disallows padding between statements.
  • paths - Use paths from tsconfig/jsconfig and auto fix relative paths to aliases.
  • @gitbutler/no-relative-imports - Use paths from tsconfig and auto fix relative paths to aliases. Observes tsconfig inheritance.

Testing Tools

Parsers

  • babel-eslint-parser - Allows you to lint ALL valid Babel code with the fantastic ESLint.
  • TypeScript - A TypeScript parser that produces output compatible with ESLint.
  • BrightScript - BrightScript plugin for Roku development. Includes Parser and Rules.
  • GraphQL - Parser for the GraphQL AST. Includes parser, plugin, processor (for non-graphql files) and rules.

Formatters

  • html - A enhanced ESLint formatter.
  • badger - Make SVG-based badges summarizing ESLint results (e.g., for use on a README).
  • git-log - ESLint Formatter featuring Git Author, Date, and Hash.
  • github - See ESLint errors and warnings directly in pull requests.
  • gitlab - Output ESLint results in the GitLab code quality results.
  • mo - Good-lookin' ESLint formatter and also for delightful reading experience.
  • SARIF - Generate a results in a SARIF format so it can be imported into tools like GitHub Advanced Security.
  • summary-chart - Format ESLint output into a bar chart.

Globals

Tools

Developing for ESLint

  • eslint-doc-generator - Generate documentation for your ESLint plugin including a rules table for your readme and header for your rule docs.
  • eslint-docgen - Automatically generate ESLint plugin documentation from rule metadata and test cases.

Tutorials

Installation and Setup

  • Lintier - CLI to quickly scaffold an ESLint & Prettier setup in a TypeScript project.
[[curator]]
I'm the Curator. I can help you navigate, organize, and curate this wiki. What would you like to do?