In an eslint.config.js
file, how can I get TypeScript type hints for the new config object?
/** @type {???} */
export default [
{
rules: {...}
}
]
You import declarations, including library types, to JSDoc using import types.
For your specific case the relevant type is Config
, so:
/** @type { import("eslint").Linter.Config[] } */
export default [
// get hints here
];
Note:
FlatConfig
, which is still available as a deprecated alias in the v9 types; and@types/eslint
for Config
/FlatConfig
to appear on Linter
.for eslint v9 use:
change the file name to eslint.config.mjs
/** @type { import("eslint").Linter.Config[] } */
export default [...]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With