ESLint JavaScript language implementation
npm install @eslint/js




Website |
Configure ESLint |
Rules |
Contribute to ESLint |
Report Bugs |
Code of Conduct |
X |
Discord |
Mastodon |
Bluesky
The beginnings of separating out JavaScript-specific functionality from ESLint.
Right now, this plugin contains two configurations:
- recommended - enables the rules recommended by the ESLint team (the replacement for "eslint:recommended")
- all - enables all ESLint rules (the replacement for "eslint:all")
You can install ESLint using npm or other package managers:
``shell`
npm install eslint -Dor
yarn add eslint -Dor
pnpm install eslint -Dor
bun add eslint -D
Then install this plugin:
`shell`
npm install @eslint/js -Dor
yarn add @eslint/js -Dor
pnpm install @eslint/js -Dor
bun add @eslint/js -D
Use in your eslint.config.js file anytime you want to extend one of the configs:
`js
import { defineConfig } from "eslint/config";
import js from "@eslint/js";
export default defineConfig([
// apply recommended rules to JS files
{
name: "your-project/recommended-rules",
files: ["*/.js"],
plugins: {
js,
},
extends: ["js/recommended"],
},
// apply recommended rules to JS files with an override
{
name: "your-project/recommended-rules-with-override",
files: ["*/.js"],
plugins: {
js,
},
extends: ["js/recommended"],
rules: {
"no-unused-vars": "warn",
},
},
// apply all rules to JS files
{
name: "your-project/all-rules",
files: ["*/.js"],
plugins: {
js,
},
extends: ["js/all"],
rules: {
"no-unused-vars": "warn",
},
},
]);
``
MIT