在eslint.config.js文件中,如何获取新配置对象的 TypeScript 类型提示?
/** @type {???} */
export default [
{
rules: {...}
}
]
Run Code Online (Sandbox Code Playgroud)
jon*_*rpe 14
您可以使用import types将声明(包括库类型)导入到 JSDoc 。对于您的具体情况,相关类型是FlatConfig,因此:
/** @type { import("eslint").Linter.FlatConfig[] } */
export default [
// get hints here
];
Run Code Online (Sandbox Code Playgroud)
请注意,您需要安装@types/eslintforFlatConfig才能出现在 上Linter。
| 归档时间: |
|
| 查看次数: |
1685 次 |
| 最近记录: |