From 86dacebae98959d915ce86471e17eff3d71d8334 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filip=20Tammerg=C3=A5rd?= Date: Wed, 12 Apr 2023 13:42:43 +0200 Subject: [PATCH] fix: disable type checking in generated files --- .eslintrc.js | 1 + .../proto/gen/typescript/einride/example/freight/v1/index.ts | 1 + examples/proto/gen/typescript/einride/example/syntax/v1/index.ts | 1 + examples/proto/gen/typescript/einride/example/syntax/v2/index.ts | 1 + internal/plugin/packagegen.go | 1 + 5 files changed, 5 insertions(+) diff --git a/.eslintrc.js b/.eslintrc.js index bde448e..ebc6d86 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -3,5 +3,6 @@ module.exports = { rules: { "jest/no-deprecated-functions": "off", // we're not using Jest "prettier/prettier": "off", // we're not concerned with code style + "@typescript-eslint/ban-ts-comment": "off", // we need ts comment in generated files to disable type checking of files for consumers }, }; diff --git a/examples/proto/gen/typescript/einride/example/freight/v1/index.ts b/examples/proto/gen/typescript/einride/example/freight/v1/index.ts index 482bd11..058d98d 100644 --- a/examples/proto/gen/typescript/einride/example/freight/v1/index.ts +++ b/examples/proto/gen/typescript/einride/example/freight/v1/index.ts @@ -1,5 +1,6 @@ // Code generated by protoc-gen-typescript-http. DO NOT EDIT. /* eslint-disable camelcase */ +// @ts-nocheck // A shipment represents transportation of goods between an origin // [site][einride.example.freight.v1.Site] and a destination diff --git a/examples/proto/gen/typescript/einride/example/syntax/v1/index.ts b/examples/proto/gen/typescript/einride/example/syntax/v1/index.ts index 81aa953..bddca86 100644 --- a/examples/proto/gen/typescript/einride/example/syntax/v1/index.ts +++ b/examples/proto/gen/typescript/einride/example/syntax/v1/index.ts @@ -1,5 +1,6 @@ // Code generated by protoc-gen-typescript-http. DO NOT EDIT. /* eslint-disable camelcase */ +// @ts-nocheck // Enum export type Enum = diff --git a/examples/proto/gen/typescript/einride/example/syntax/v2/index.ts b/examples/proto/gen/typescript/einride/example/syntax/v2/index.ts index 7d1ed98..8498ae6 100644 --- a/examples/proto/gen/typescript/einride/example/syntax/v2/index.ts +++ b/examples/proto/gen/typescript/einride/example/syntax/v2/index.ts @@ -1,5 +1,6 @@ // Code generated by protoc-gen-typescript-http. DO NOT EDIT. /* eslint-disable camelcase */ +// @ts-nocheck // Message export type Message = { diff --git a/internal/plugin/packagegen.go b/internal/plugin/packagegen.go index 2b3fbe3..a1f5de1 100644 --- a/internal/plugin/packagegen.go +++ b/internal/plugin/packagegen.go @@ -46,5 +46,6 @@ func (p packageGenerator) Generate(f *codegen.File) error { func (p packageGenerator) generateHeader(f *codegen.File) { f.P("// Code generated by protoc-gen-typescript-http. DO NOT EDIT.") f.P("/* eslint-disable camelcase */") + f.P("// @ts-nocheck") f.P() }