chore(site): enable eslint-plugin-eslint-comments (#4799)

* chore(site): enable eslint-plugin-eslint-comments

* chore: add descriptions to eslint-disable comments

* chore: update eslint-disable comments in main.go
This commit is contained in:
Joe Previte
2022-10-28 13:46:51 -07:00
committed by GitHub
parent 506a81e3dc
commit ffe461ae58
11 changed files with 29 additions and 15 deletions

View File

@ -624,7 +624,7 @@ func (g *Generator) typescriptType(ty types.Type) (TypescriptType, error) {
ValueType: "any",
AboveTypeLine: fmt.Sprintf("%s\n%s",
indentedComment("Embedded anonymous struct, please fix by naming it"),
indentedComment("eslint-disable-next-line @typescript-eslint/no-explicit-any"),
indentedComment("eslint-disable-next-line @typescript-eslint/no-explicit-any -- TODO explain why this is needed"),
),
}, nil
case *types.Map:
@ -736,7 +736,7 @@ func (g *Generator) typescriptType(ty types.Type) (TypescriptType, error) {
if _, ok := n.Underlying().(*types.Struct); ok {
return TypescriptType{ValueType: "any", AboveTypeLine: fmt.Sprintf("%s\n%s",
indentedComment(fmt.Sprintf("Named type %q unknown, using \"any\"", n.String())),
indentedComment("eslint-disable-next-line @typescript-eslint/no-explicit-any"),
indentedComment("eslint-disable-next-line @typescript-eslint/no-explicit-any -- TODO explain why this is needed"),
)}, nil
}
@ -761,7 +761,7 @@ func (g *Generator) typescriptType(ty types.Type) (TypescriptType, error) {
intf := ty
if intf.Empty() {
return TypescriptType{ValueType: "any",
AboveTypeLine: indentedComment("eslint-disable-next-line")}, nil
AboveTypeLine: indentedComment("eslint-disable-next-line @typescript-eslint/no-explicit-any -- TODO explain why this is needed")}, nil
}
return TypescriptType{}, xerrors.New("only empty interface types are supported")
case *types.TypeParam: