Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build!: update to latest version of gts/typescript #171

Merged
merged 2 commits into from
Mar 24, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "./node_modules/gts"
}
15 changes: 0 additions & 15 deletions .eslintrc.yml

This file was deleted.

8 changes: 5 additions & 3 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
node_modules/*
samples/node_modules/*
src/**/doc/*
**/node_modules
**/.coverage
build/
docs/
protos/
8 changes: 0 additions & 8 deletions .prettierrc

This file was deleted.

17 changes: 17 additions & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -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')
}
18 changes: 9 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we use ^3.8.3 here?
@bcoe

"linkinator": "^2.0.4"
},
"engines": {
"node": ">=10"
Expand Down
2 changes: 1 addition & 1 deletion samples/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@
"@google-cloud/projectify": "^1.0.4"
},
"devDependencies": {
"mocha": "^7.0.0"
"mocha": "^7.1.1"
}
}
2 changes: 1 addition & 1 deletion samples/quickstart.js
Original file line number Diff line number Diff line change
Expand Up @@ -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]
3 changes: 2 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand All @@ -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);
}
Expand Down
2 changes: 1 addition & 1 deletion test/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down