-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
feat: Export defineConfig, globalIgnores #19487
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
✅ Deploy Preview for docs-eslint ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
@@ -72,15 +72,17 @@ This ensures that pnpm installs dependencies in a way that is more compatible wi | |||
You can configure rules in your `eslint.config.js` files as in this example: | |||
|
|||
```js | |||
export default [ | |||
import { defineConfig } from "eslint/config"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since eslint is still CJS, should we maybe rather use default imports (e.g., import config from "eslint/config";
) in ESM config examples as they're guaranteed to work?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At least locally, this seems to work fine as-is. (Node v22.9.0)
Co-authored-by: Milos Djermanovic <milos.djermanovic@gmail.com>
Co-authored-by: Milos Djermanovic <milos.djermanovic@gmail.com>
Co-authored-by: Milos Djermanovic <milos.djermanovic@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
Prerequisites checklist
What is the purpose of this pull request? (put an "X" next to an item)
[ ] Documentation update
[ ] Bug fix (template)
[ ] New rule (template)
[ ] Changes an existing rule (template)
[ ] Add autofix to a rule
[ ] Add a CLI option
[x] Add something to the core
[ ] Other, please explain:
What changes did you make? (Give an overview)
/config
entrypoint on the package to exportdefineConfig
andglobalIgnores
/config
entrypointeslint.config.js
to usedefineConfig
andglobalIgnores
docs/src/use/configure/combine-configs.md
: Updated all examples to usedefineConfig
for defining configurations, ensuring consistency and clarity in the documentation. [1] [2] [3]docs/src/use/configure/configuration-files.md
: Revised multiple sections to incorporatedefineConfig
, including examples for applying rules, specifying files, and handling ignores. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15]README.md
: Updated the example configuration to usedefineConfig
for better compatibility and standardization.fixes #19116
Is there anything you'd like reviewers to focus on?
Did I miss any important docs?