-
-
Notifications
You must be signed in to change notification settings - Fork 206
feat: support standard flat file format #765
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
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,11 @@ | ||
import { ESLint } from 'eslint'; | ||
|
||
declare const eslintPluginPrettier: ESLint.Plugin; | ||
declare const eslintPluginPrettier: ESLint.Plugin & { | ||
configs: { | ||
recommended: import('eslint').Linter.Config< | ||
import('eslint').Linter.RulesRecord | ||
>[]; | ||
}; | ||
}; | ||
|
||
export = eslintPluginPrettier; |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -131,15 +131,21 @@ function reportDifference(context, difference) { | |
const eslintPluginPrettier = { | ||
meta: { name, version }, | ||
configs: { | ||
recommended: { | ||
extends: ['prettier'], | ||
plugins: ['prettier'], | ||
rules: { | ||
'prettier/prettier': 'error', | ||
'arrow-body-style': 'off', | ||
'prefer-arrow-callback': 'off', | ||
recommended: [ | ||
{ | ||
name: 'prettier/recommended', | ||
plugins: { | ||
get prettier() { | ||
return eslintPluginPrettier; | ||
}, | ||
}, | ||
rules: { | ||
'prettier/prettier': 'error', | ||
'arrow-body-style': 'off', | ||
'prefer-arrow-callback': 'off', | ||
}, | ||
}, | ||
}, | ||
], | ||
Comment on lines
+134
to
+148
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Keep the legacy Replacing 🤖 Prompt for AI Agents
|
||
}, | ||
rules: { | ||
prettier: { | ||
|
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.
Fix the flat config typing for
configs.recommended
.configs.recommended
now returns a flat-config array whose entries use the flat shape (plugins
object with actual plugin values). Typing it asLinter.Config<RulesRecord>[]
is wrong—legacy configs expectplugins: string[]
, so consumers will get type errors when they spread this intodefineConfig
(which expectsLinter.FlatConfig
). Please change the declaration toimport('eslint').Linter.FlatConfig[]
(or an equivalent alias) to reflect the real runtime shape.📝 Committable suggestion
🤖 Prompt for AI Agents