Skip to content

Commit

Permalink
CLI: Extend list of ignored ESLint rules for pbjs, fixes protobufjs#1085
Browse files Browse the repository at this point in the history
  • Loading branch information
dcodeIO authored and johncsnyder committed Sep 21, 2019
1 parent 18dc7a0 commit d3562d7
Show file tree
Hide file tree
Showing 27 changed files with 28 additions and 28 deletions.
2 changes: 1 addition & 1 deletion bench/data/static_pbjs.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*eslint-disable block-scoped-var, no-redeclare, no-control-regex, no-prototype-builtins*/
/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/
"use strict";

var $protobuf = require("../../minimal");
Expand Down
12 changes: 11 additions & 1 deletion cli/pbjs.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,17 @@ var targets = util.requireAll("./targets");
* @returns {number|undefined} Exit code, if known
*/
exports.main = function main(args, callback) {
var lintDefault = "eslint-disable block-scoped-var, no-redeclare, no-control-regex, no-prototype-builtins";
var lintDefault = "eslint-disable " + [
"block-scoped-var",
"id-length",
"no-control-regex",
"no-magic-numbers",
"no-prototype-builtins",
"no-redeclare",
"no-shadow",
"no-var",
"sort-vars"
].join(", ");
var argv = minimist(args, {
alias: {
target: "t",
Expand Down
3 changes: 1 addition & 2 deletions cli/pbts.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,7 @@ exports.main = function(args, callback) {
});

function getImportName(importItem) {
var result = path.basename(importItem, ".js")
return result.replace(/([-_~.+]\w)/g, match => {
return path.basename(importItem, ".js").replace(/([-_~.+]\w)/g, function(match) {
return match[1].toUpperCase();
});
}
Expand Down
2 changes: 1 addition & 1 deletion dist/light/protobuf.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/light/protobuf.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/minimal/protobuf.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/minimal/protobuf.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/protobuf.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/protobuf.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion ext/descriptor/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import * as $protobuf from "../..";

export const FileDescriptorSet: $protobuf.Type;

export const FileDescriptorProto: $protobuf.Type;
Expand Down
2 changes: 1 addition & 1 deletion index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,7 @@ export interface IExtensionMapField extends IMapField {
}

/** Abstract runtime message. */
export class Message<T extends object = object> {
export class Message<T extends object> {

/**
* Constructs a new message instance.
Expand Down
1 change: 0 additions & 1 deletion tests/data/comments.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import * as $protobuf from "../..";

export interface ITest1 {
field1?: (string|null);
field2?: (number|null);
Expand Down
2 changes: 1 addition & 1 deletion tests/data/comments.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*eslint-disable block-scoped-var, no-redeclare, no-control-regex, no-prototype-builtins*/
/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/
"use strict";

var $protobuf = require("../../minimal");
Expand Down
1 change: 0 additions & 1 deletion tests/data/convert.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import * as $protobuf from "../..";

export interface IMessage {
stringVal?: (string|null);
stringRepeated?: (string[]|null);
Expand Down
2 changes: 1 addition & 1 deletion tests/data/convert.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*eslint-disable block-scoped-var, no-redeclare, no-control-regex, no-prototype-builtins*/
/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/
"use strict";

var $protobuf = require("../../minimal");
Expand Down
1 change: 0 additions & 1 deletion tests/data/mapbox/vector_tile.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import * as $protobuf from "../../..";

export namespace vector_tile {

interface ITile {
Expand Down
2 changes: 1 addition & 1 deletion tests/data/mapbox/vector_tile.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*eslint-disable block-scoped-var, no-redeclare, no-control-regex, no-prototype-builtins*/
/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/
"use strict";

var $protobuf = require("../../../minimal");
Expand Down
1 change: 0 additions & 1 deletion tests/data/package.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import * as $protobuf from "../..";

export interface IPackage {
name?: (string|null);
version?: (string|null);
Expand Down
2 changes: 1 addition & 1 deletion tests/data/package.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*eslint-disable block-scoped-var, no-redeclare, no-control-regex, no-prototype-builtins*/
/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/
"use strict";

var $protobuf = require("../../minimal");
Expand Down
1 change: 0 additions & 1 deletion tests/data/rpc-es6.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import * as $protobuf from "../..";

export class MyService extends $protobuf.rpc.Service {
constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean);
public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): MyService;
Expand Down
2 changes: 1 addition & 1 deletion tests/data/rpc-es6.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*eslint-disable block-scoped-var, no-redeclare, no-control-regex, no-prototype-builtins*/
/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/
import * as $protobuf from "../../minimal";

// Common aliases
Expand Down
1 change: 0 additions & 1 deletion tests/data/rpc-reserved.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import * as $protobuf from "../..";

export class MyService extends $protobuf.rpc.Service {
constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean);
public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): MyService;
Expand Down
2 changes: 1 addition & 1 deletion tests/data/rpc-reserved.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*eslint-disable block-scoped-var, no-redeclare, no-control-regex, no-prototype-builtins*/
/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/
"use strict";

var $protobuf = require("../../minimal");
Expand Down
1 change: 0 additions & 1 deletion tests/data/rpc.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import * as $protobuf from "../..";

export class MyService extends $protobuf.rpc.Service {
constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean);
public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): MyService;
Expand Down
2 changes: 1 addition & 1 deletion tests/data/rpc.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*eslint-disable block-scoped-var, no-redeclare, no-control-regex, no-prototype-builtins*/
/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/
"use strict";

var $protobuf = require("../../minimal");
Expand Down
1 change: 0 additions & 1 deletion tests/data/test.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import * as $protobuf from "../..";

export namespace jspb {

namespace test {
Expand Down
2 changes: 1 addition & 1 deletion tests/data/test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*eslint-disable block-scoped-var, no-redeclare, no-control-regex, no-prototype-builtins*/
/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/
"use strict";

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

0 comments on commit d3562d7

Please sign in to comment.