https://github.com/yoast/eslint-config
Shared configuration for ESLint used across Yoast projects.
https://github.com/yoast/eslint-config
Last synced: 3 months ago
JSON representation
Shared configuration for ESLint used across Yoast projects.
- Host: GitHub
- URL: https://github.com/yoast/eslint-config
- Owner: Yoast
- License: gpl-3.0
- Created: 2025-02-26T15:16:05.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-05-12T13:12:50.000Z (about 1 year ago)
- Last Synced: 2025-10-02T17:48:55.504Z (7 months ago)
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/@yoast/eslint-config
- Size: 131 KB
- Stars: 1
- Watchers: 6
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# @Yoast/eslint-config
A shared ESLint configuration used across a variety of Yoast projects. Anyone is welcome to use this configuration, but
it is primarily intended for internal use.
## Presets
This configuration contains three presets:
| Preset | Description | Usage |
|-------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------|
| yoast/recommended | The base config. This should almost always be used. It's based on the @eslint/js/recommended and eslint-plugin-import config and contains stylistic configuration for all Yoast JavaScript. | `import yoastConfig from @yoast/eslint-config"` |
| yoast/react | An extension for the base config, adding the React plugin and React/JSX-specific rules. | `import { reactConfig } from @yoast/eslint-config"` |
| yoast/node | An extension for the base config, adding the Node plugin adding some rules that are relevant when working with Node.JS. | `import { nodeConfig } from @yoast/eslint-config"` |
## Example usage
```js
// eslint.config.mjs
import globals from "globals";
import yoastConfig, { reactConfig } from "@yoast/eslint-config";
/** @type {import('eslint').Linter.Config[]} */
export default [
{ ignores: [ "build" ] },
...yoastConfig,
...reactConfig,
{
languageOptions: {
ecmaVersion: "latest",
globals: {
...globals.browser,
},
},
rules: {
// Deviate from the Yoast config to allow for not using the error that is caught.
"no-unused-vars": [ "error", { caughtErrors: "none" } ],
},
}
];
```