Skip to content

Commit ce84e29

Browse files
OptoCloudJochen Parmentier
authored andcommitted
Make eslint less pedantic (google#8012)
* Disable eslint spam * Generate TS example files
1 parent bb0e642 commit ce84e29

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+85
-2
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
// automatically generated by the FlatBuffers compiler, do not modify
22

3+
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
4+
35
export * as models from './models.js';
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
// automatically generated by the FlatBuffers compiler, do not modify
22

3+
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
4+
35
export { HelloReply } from './models/hello-reply.js';
46
export { HelloRequest } from './models/hello-request.js';

grpc/examples/ts/greeter/src/models/hello-reply.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
// automatically generated by the FlatBuffers compiler, do not modify
22

3+
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
4+
35
import * as flatbuffers from 'flatbuffers';
46

57

grpc/examples/ts/greeter/src/models/hello-request.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
// automatically generated by the FlatBuffers compiler, do not modify
22

3+
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
4+
35
import * as flatbuffers from 'flatbuffers';
46

57

src/idl_gen_ts.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,8 @@ class TsGenerator : public BaseGenerator {
149149

150150
std::string code;
151151

152-
code += "// " + std::string(FlatBuffersGeneratedWarning()) + "\n\n";
152+
code += "// " + std::string(FlatBuffersGeneratedWarning()) + "\n\n" +
153+
"/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */\n\n";
153154

154155
for (auto it = bare_imports.begin(); it != bare_imports.end(); it++) {
155156
code += it->second.import_statement + "\n";
@@ -254,7 +255,9 @@ class TsGenerator : public BaseGenerator {
254255
}
255256

256257
for (const auto &it : ns_defs_) {
257-
code = "// " + std::string(FlatBuffersGeneratedWarning()) + "\n\n";
258+
code = "// " + std::string(FlatBuffersGeneratedWarning()) + "\n\n" +
259+
"/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */\n\n";
260+
258261
// export all definitions in ns entry point module
259262
int export_counter = 0;
260263
for (const auto &def : it.second.definitions) {

tests/ts/monster_test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
// automatically generated by the FlatBuffers compiler, do not modify
22

3+
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
4+
35
export { TableA, TableAT } from './table-a.js';
46
export * as MyGame from './my-game.js';

tests/ts/my-game.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
// automatically generated by the FlatBuffers compiler, do not modify
22

3+
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
4+
35
export { InParentNamespace, InParentNamespaceT } from './my-game/in-parent-namespace.js';
46
export * as Example from './my-game/example.js';
57
export * as Example2 from './my-game/example2.js';

tests/ts/my-game/example.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
// automatically generated by the FlatBuffers compiler, do not modify
22

3+
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
4+
35
export { Ability, AbilityT } from './example/ability.js';
46
export { Any } from './example/any.js';
57
export { AnyAmbiguousAliases } from './example/any-ambiguous-aliases.js';

tests/ts/my-game/example/ability.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
// automatically generated by the FlatBuffers compiler, do not modify
22

3+
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
4+
35
import * as flatbuffers from 'flatbuffers';
46

57

tests/ts/my-game/example/any-ambiguous-aliases.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
// automatically generated by the FlatBuffers compiler, do not modify
22

3+
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
4+
35
import { Monster, MonsterT } from '../../my-game/example/monster.js';
46

57

0 commit comments

Comments
 (0)