小编Dim*_*ava的帖子

ESLint:`eslintrc.js` 的类型

我希望对我的eslintrc.js类型进行类型检查,并内置允许的规则的所有类型定义。

即喜欢:

module.exports = defineESLint({
  rules: {
    // intellisence: Enforce the consistent use of either backticks, double, or single quotes
    // quotes?: 'off' | 'warn' | 'error'
    // | ['warn' | 'error', 'single' | 'double', { avoidEscape?: true }]
    quotes: ["warn", 'single', {avoidEscape: true}],
  }
})
Run Code Online (Sandbox Code Playgroud)

我通常希望它能与我所有的eslint 扩展一起使用

目前我能做的就是

{
  "$schema": "https://raw.githubusercontent.com/SchemaStore/schemastore/master/src/schemas/json/eslintrc.json",
  "rules": {
    "quotes": [
      "warn",
      "single",
      {
        "avoidEscape": true
      }
    ]
  }
}
Run Code Online (Sandbox Code Playgroud)

在 json 中,但它几乎不起作用

typing eslint typescript-definitions eslintrc typescript-eslint

2
推荐指数
1
解决办法
1645
查看次数