Skip to content

Commit 2c5ef95

Browse files
committed
CLI: Extend list of ignored ESLint rules for pbjs, fixes #1085
1 parent 36fc964 commit 2c5ef95

27 files changed

+28
-28
lines changed

bench/data/static_pbjs.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*eslint-disable block-scoped-var, no-redeclare, no-control-regex, no-prototype-builtins*/
1+
/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/
22
"use strict";
33

44
var $protobuf = require("../../minimal");

cli/pbjs.js

+11-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,17 @@ var targets = util.requireAll("./targets");
2020
* @returns {number|undefined} Exit code, if known
2121
*/
2222
exports.main = function main(args, callback) {
23-
var lintDefault = "eslint-disable block-scoped-var, no-redeclare, no-control-regex, no-prototype-builtins";
23+
var lintDefault = "eslint-disable " + [
24+
"block-scoped-var",
25+
"id-length",
26+
"no-control-regex",
27+
"no-magic-numbers",
28+
"no-prototype-builtins",
29+
"no-redeclare",
30+
"no-shadow",
31+
"no-var",
32+
"sort-vars"
33+
].join(", ");
2434
var argv = minimist(args, {
2535
alias: {
2636
target: "t",

cli/pbts.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,7 @@ exports.main = function(args, callback) {
139139
});
140140

141141
function getImportName(importItem) {
142-
var result = path.basename(importItem, ".js")
143-
return result.replace(/([-_~.+]\w)/g, match => {
142+
return path.basename(importItem, ".js").replace(/([-_~.+]\w)/g, function(match) {
144143
return match[1].toUpperCase();
145144
});
146145
}

dist/light/protobuf.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/light/protobuf.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/minimal/protobuf.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/minimal/protobuf.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/protobuf.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/protobuf.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ext/descriptor/index.d.ts

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import * as $protobuf from "../..";
2-
32
export const FileDescriptorSet: $protobuf.Type;
43

54
export const FileDescriptorProto: $protobuf.Type;

index.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -507,7 +507,7 @@ export interface IExtensionMapField extends IMapField {
507507
}
508508

509509
/** Abstract runtime message. */
510-
export class Message<T extends object = object> {
510+
export class Message<T extends object> {
511511

512512
/**
513513
* Constructs a new message instance.

tests/data/comments.d.ts

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import * as $protobuf from "../..";
2-
32
export interface ITest1 {
43
field1?: (string|null);
54
field2?: (number|null);

tests/data/comments.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*eslint-disable block-scoped-var, no-redeclare, no-control-regex, no-prototype-builtins*/
1+
/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/
22
"use strict";
33

44
var $protobuf = require("../../minimal");

tests/data/convert.d.ts

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import * as $protobuf from "../..";
2-
32
export interface IMessage {
43
stringVal?: (string|null);
54
stringRepeated?: (string[]|null);

tests/data/convert.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*eslint-disable block-scoped-var, no-redeclare, no-control-regex, no-prototype-builtins*/
1+
/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/
22
"use strict";
33

44
var $protobuf = require("../../minimal");

tests/data/mapbox/vector_tile.d.ts

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import * as $protobuf from "../../..";
2-
32
export namespace vector_tile {
43

54
interface ITile {

tests/data/mapbox/vector_tile.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*eslint-disable block-scoped-var, no-redeclare, no-control-regex, no-prototype-builtins*/
1+
/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/
22
"use strict";
33

44
var $protobuf = require("../../../minimal");

tests/data/package.d.ts

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import * as $protobuf from "../..";
2-
32
export interface IPackage {
43
name?: (string|null);
54
version?: (string|null);

tests/data/package.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*eslint-disable block-scoped-var, no-redeclare, no-control-regex, no-prototype-builtins*/
1+
/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/
22
"use strict";
33

44
var $protobuf = require("../../minimal");

tests/data/rpc-es6.d.ts

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import * as $protobuf from "../..";
2-
32
export class MyService extends $protobuf.rpc.Service {
43
constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean);
54
public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): MyService;

tests/data/rpc-es6.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*eslint-disable block-scoped-var, no-redeclare, no-control-regex, no-prototype-builtins*/
1+
/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/
22
import * as $protobuf from "../../minimal";
33

44
// Common aliases

tests/data/rpc-reserved.d.ts

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import * as $protobuf from "../..";
2-
32
export class MyService extends $protobuf.rpc.Service {
43
constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean);
54
public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): MyService;

tests/data/rpc-reserved.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*eslint-disable block-scoped-var, no-redeclare, no-control-regex, no-prototype-builtins*/
1+
/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/
22
"use strict";
33

44
var $protobuf = require("../../minimal");

tests/data/rpc.d.ts

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import * as $protobuf from "../..";
2-
32
export class MyService extends $protobuf.rpc.Service {
43
constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean);
54
public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): MyService;

tests/data/rpc.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*eslint-disable block-scoped-var, no-redeclare, no-control-regex, no-prototype-builtins*/
1+
/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/
22
"use strict";
33

44
var $protobuf = require("../../minimal");

tests/data/test.d.ts

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import * as $protobuf from "../..";
2-
32
export namespace jspb {
43

54
namespace test {

tests/data/test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*eslint-disable block-scoped-var, no-redeclare, no-control-regex, no-prototype-builtins*/
1+
/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/
22
"use strict";
33

44
var $protobuf = require("../../minimal");

0 commit comments

Comments
 (0)