From f5d4e3cbb0c045df7a39a1d4200f3b0fdfd26dfa Mon Sep 17 00:00:00 2001 From: alex Date: Tue, 24 Mar 2020 15:36:53 -0400 Subject: [PATCH] build!: update to latest version of gts/typescript --- .eslintrc.json | 3 +++ .eslintrc.yml | 15 --------------- .prettierignore | 8 +++++--- .prettierrc | 8 -------- .prettierrc.js | 17 +++++++++++++++++ package.json | 18 +++++++++--------- samples/package.json | 2 +- samples/quickstart.js | 2 +- src/index.ts | 3 ++- test/index.ts | 2 +- 10 files changed, 39 insertions(+), 39 deletions(-) create mode 100644 .eslintrc.json delete mode 100644 .eslintrc.yml delete mode 100644 .prettierrc create mode 100644 .prettierrc.js diff --git a/.eslintrc.json b/.eslintrc.json new file mode 100644 index 0000000..7821534 --- /dev/null +++ b/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": "./node_modules/gts" +} diff --git a/.eslintrc.yml b/.eslintrc.yml deleted file mode 100644 index 73eeec2..0000000 --- a/.eslintrc.yml +++ /dev/null @@ -1,15 +0,0 @@ ---- -extends: - - 'eslint:recommended' - - 'plugin:node/recommended' - - prettier -plugins: - - node - - prettier -rules: - prettier/prettier: error - block-scoped-var: error - eqeqeq: error - no-warning-comments: warn - no-var: error - prefer-const: error diff --git a/.prettierignore b/.prettierignore index f6fac98..a4ac7b3 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1,3 +1,5 @@ -node_modules/* -samples/node_modules/* -src/**/doc/* +**/node_modules +**/.coverage +build/ +docs/ +protos/ diff --git a/.prettierrc b/.prettierrc deleted file mode 100644 index df6eac0..0000000 --- a/.prettierrc +++ /dev/null @@ -1,8 +0,0 @@ ---- -bracketSpacing: false -printWidth: 80 -semi: true -singleQuote: true -tabWidth: 2 -trailingComma: es5 -useTabs: false diff --git a/.prettierrc.js b/.prettierrc.js new file mode 100644 index 0000000..08cba37 --- /dev/null +++ b/.prettierrc.js @@ -0,0 +1,17 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +module.exports = { + ...require('gts/.prettierrc.json') +} diff --git a/package.json b/package.json index 75c2f04..d67bd97 100644 --- a/package.json +++ b/package.json @@ -29,15 +29,15 @@ "author": "Google Inc.", "license": "Apache-2.0", "devDependencies": { - "@compodoc/compodoc": "^1.1.7", - "@types/mocha": "^7.0.0", - "@types/node": "^10.5.2", - "codecov": "^3.0.4", - "gts": "^1.0.0", - "mocha": "^7.0.0", - "c8": "^7.0.0", - "typescript": "3.6.4", - "linkinator": "^2.0.0" + "@compodoc/compodoc": "^1.1.11", + "@types/mocha": "^7.0.2", + "@types/node": "^10.17.17", + "codecov": "^3.6.5", + "gts": "2.0.0-alpha.5", + "mocha": "^7.1.1", + "c8": "^7.1.0", + "typescript": "3.8.3", + "linkinator": "^2.0.4" }, "engines": { "node": ">=8.10.0" diff --git a/samples/package.json b/samples/package.json index c6e7a09..e9c3948 100644 --- a/samples/package.json +++ b/samples/package.json @@ -14,6 +14,6 @@ "@google-cloud/projectify": "^1.0.4" }, "devDependencies": { - "mocha": "^7.0.0" + "mocha": "^7.1.1" } } diff --git a/samples/quickstart.js b/samples/quickstart.js index f28c4fb..459b37b 100644 --- a/samples/quickstart.js +++ b/samples/quickstart.js @@ -15,7 +15,7 @@ // [START projectify_quickstart] const {replaceProjectIdToken} = require('@google-cloud/projectify'); const options = { - projectId: '{{projectId}}' + projectId: '{{projectId}}', }; replaceProjectIdToken(options, 'fake-project-id'); // [END projectify_quickstart] diff --git a/src/index.ts b/src/index.ts index d09ba58..38ea04e 100644 --- a/src/index.ts +++ b/src/index.ts @@ -23,7 +23,7 @@ import {Stream} from 'stream'; * @param {string} projectId - A projectId. If not provided * @return {*} - The original argument with all placeholders populated. */ -// tslint:disable-next-line:no-any +/* eslint-disable @typescript-eslint/no-explicit-any */ export function replaceProjectIdToken(value: any, projectId: string): any { if (Array.isArray(value)) { value = (value as string[]).map(v => replaceProjectIdToken(v, projectId)); @@ -37,6 +37,7 @@ export function replaceProjectIdToken(value: any, projectId: string): any { typeof value.hasOwnProperty === 'function' ) { for (const opt in value) { + /* eslint-disable no-prototype-builtins */ if (value.hasOwnProperty(opt)) { value[opt] = replaceProjectIdToken(value[opt], projectId); } diff --git a/test/index.ts b/test/index.ts index c525126..2254253 100644 --- a/test/index.ts +++ b/test/index.ts @@ -117,7 +117,7 @@ describe('projectId placeholder', () => { }); it('should not inject projectId into stream', () => { - // tslint:disable-next-line: no-any + /* eslint-disable @typescript-eslint/no-explicit-any */ const transform = new stream.Transform() as any; transform.prop = 'A {{projectId}} Z';