Generated by DeepSeek V3.2| ESLint | |
|---|---|
| Name | ESLint |
| Developer | Nicholas C. Zakas |
| Released | 22 June 2013 |
| Latest release version | 9.0.0 |
| Latest release date | 24 May 2024 |
| Programming language | JavaScript |
| Operating system | Cross-platform |
| Genre | Static program analysis |
| License | MIT License |
ESLint. It is a static code analysis tool for identifying problematic patterns found in JavaScript code. Created by Nicholas C. Zakas, it was first released in June 2013 to provide a pluggable linting utility for ECMAScript/JavaScript developers. The tool is highly configurable, allowing teams to enforce consistent coding styles and catch potential errors early in the development process, and it has become a standard part of the modern web development toolchain.
ESLint operates by parsing source code into an abstract syntax tree (AST) and then evaluating that tree against a defined set of rules. This approach allows it to understand code structure beyond simple text patterns, similar to tools like JSHint and JSLint, but with a greater emphasis on extensibility. It is designed to be completely pluggable, meaning every single rule is a plugin that can be toggled or extended, a philosophy that has contributed to its widespread adoption in projects ranging from small Node.js applications to large-scale frameworks like React and Vue.js. The tool is commonly integrated into continuous integration pipelines and code editors such as Visual Studio Code to provide real-time feedback.
Its core features include fully pluggable rule configuration, where each rule can be set to "off," "warn," or "error." It supports the use of sharable configurations, such as those popularized by Airbnb and Google, allowing teams to adopt established style guides quickly. ESLint can automatically fix many types of problems, such as formatting issues or simple syntax errors, directly from the command line or editor. It has built-in support for ECMAScript modules, JSX syntax used by React, and newer language features from ECMAScript 2015 and beyond, often requiring parser configuration with projects like Babel.
Configuration is typically managed through a file named `.eslintrc` in formats including JSON, YAML, or JavaScript, or via the `eslintConfig` property in a `package.json` file. Developers can extend from popular community-shared configs like `eslint:recommended` or `plugin:react/recommended`. Environment settings can be defined to recognize global variables provided by libraries like jQuery or environments like Node.js and Mocha. For projects using non-standard syntax, the parser can be switched to alternatives like `@babel/eslint-parser` or `@typescript-eslint/parser` for TypeScript.
The ecosystem includes hundreds of built-in and community-created rules covering potential errors, best practices, variables, stylistic issues, and ECMAScript 6 features. Plugins allow for linting specific libraries or frameworks; for example, `eslint-plugin-react` provides rules for React projects, and `eslint-plugin-vue` is essential for Vue.js applications. Rule severity is customizable, and new rules can be created using the provided Node.js API. The `@typescript-eslint` project, maintained in collaboration with the TypeScript team, enables comprehensive linting for TypeScript codebases.
It integrates seamlessly into modern development workflows. It is commonly executed via command line, within npm scripts, or as part of build tools like webpack through `eslint-loader`. Most popular code editors, including Visual Studio Code, Sublime Text, and Atom, offer extensions that provide inline highlighting. In continuous integration systems like Jenkins, GitHub Actions, or CircleCI, it is often used to enforce code quality gates before merging pull requests. The `--fix` option is frequently used in conjunction with pre-commit hooks managed by tools like Husky to automatically correct style violations.
The project was initiated by Nicholas C. Zakas in 2013, with its creation motivated by the desire for a more flexible and configurable tool than the existing JSLint and JSHint. It gained rapid adoption after being adopted by major organizations like Airbnb and integrated into the JavaScript Foundation, which later merged into the OpenJS Foundation. Key milestones include the introduction of the ability to automatically fix issues in version 1.0.0, a major architectural overhaul in version 4.0.0 to improve performance, and the transition to a new config system in version 8.0.0. The project is developed openly on GitHub, with contributions from a large community and backing from the OpenJS Foundation.
Category:Free software programmed in JavaScript Category:Open-source software Category:Static program analysis tools Category:JavaScript programming tools