You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 7, 2025. It is now read-only.
Provide a defineConfig function for .eslintrc.js, and a defineFlatConfig function for eslint.config.js files.
Installation
# add eslint and eslint-define-config to project’s dev dependencies
npm add --save-dev eslint eslint-define-config
# or
yarn add --dev eslint eslint-define-config
# or
pnpm add --save-dev eslint eslint-define-config
Usage
By default only eslint's rules are supported. To activate auto-suggestions for Rules of specific plugins, you need to install the respective types for that plugin.
Plugins can either support their own types, or they could be supported by the community in the @eslint-types repository.
A list of community supported plugins can be found here.
Improve your eslint configuration experience with:
auto-suggestions
type checking (Use // @ts-check at the first line in your .eslintrc.js or eslint.config.js)
documentation
deprecation warnings
Video
Click on the thumbnail to play the video
Want to support your own plugin?
⚠️This feature is very new and requires the support of the respective plugin owners
Add a declare module to your plugin package like this:
declare module 'eslint-define-config'{exportinterfaceCustomRuleOptions{/** * Require consistently using either `T[]` or `Array<T>` for arrays. * * @see [array-type](https://typescript-eslint.io/rules/array-type) */'@typescript-eslint/array-type': [{default?: 'array'|'generic'|'array-simple';readonly?: 'array'|'generic'|'array-simple';},];// ... more Rules}}