ESLint 不允许/禁止 `this` 返回类型以达到详细程度

问题描述 投票:0回答:1

如何使用 ESLint

no-restricted-syntax
规则来禁止/禁止
this
关键字用作函数和类方法上的 返回类型

typescript eslint this
1个回答
0
投票
rules: {
    "no-restricted-syntax": ["error", "FunctionExpression[returnType.typeAnnotation.type='TSThisType']"],
}

https://eslint.org/docs/latest/rules/no-restricted-syntax

最新问题
© www.soinside.com 2019 - 2024. All rights reserved.