Skip to content

Commit f989e8c

Browse files
authored
Adds npm lint command and updates lint options (#467)
* adding lint command and modifying lint options * one additional format fix * order deps in package.json, remove unnecessary [] from tslint * Lint spec/* files (#468) * adding lint command and modifying lint options * one additional format fix * order deps in package.json, remove unnecessary [] from tslint
1 parent 8712ee9 commit f989e8c

File tree

3 files changed

+18
-8
lines changed

3 files changed

+18
-8
lines changed

integration_test/functions/src/index.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,9 @@ function callScheduleTrigger(functionName: string, region: string) {
5252
{
5353
method: 'POST',
5454
host: 'cloudscheduler.googleapis.com',
55-
path: `projects/${firebaseConfig.projectId}/locations/us-central1/jobs/firebase-schedule-${functionName}-${region}:run`,
55+
path: `projects/${
56+
firebaseConfig.projectId
57+
}/locations/us-central1/jobs/firebase-schedule-${functionName}-${region}:run`,
5658
headers: {
5759
'Content-Type': 'application/json',
5860
},
@@ -197,7 +199,9 @@ export const integrationTests: any = functions
197199
resp
198200
.status(500)
199201
.send(
200-
`FAIL - details at https://${process.env.GCLOUD_PROJECT}.firebaseio.com/testRuns/${testId}`
202+
`FAIL - details at https://${
203+
process.env.GCLOUD_PROJECT
204+
}.firebaseio.com/testRuns/${testId}`
201205
);
202206
});
203207
});

package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
"build:release": "npm install --production && npm install typescript firebase-admin && tsc -p tsconfig.release.json",
2626
"build": "tsc -p tsconfig.release.json",
2727
"format": "prettier --write '**/*.ts'",
28+
"lint": "tslint --project tsconfig.json --config tslint.json",
2829
"posttest": "npm run format",
2930
"test": "mocha -r ts-node/register ./spec/index.spec.ts"
3031
},
@@ -56,6 +57,9 @@
5657
"prettier": "^1.17.1",
5758
"sinon": "^7.3.2",
5859
"ts-node": "^8.2.0",
60+
"tslint": "^5.17.0",
61+
"tslint-no-unused-expression-chai": "^0.1.4",
62+
"tslint-plugin-prettier": "^2.0.0",
5963
"typescript": "^3.5.1"
6064
},
6165
"peerDependencies": {

tslint.json

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
{
2-
"extends": "tslint:recommended",
2+
"defaultSeverity": "warning",
3+
"extends": ["tslint:recommended", "tslint-no-unused-expression-chai"],
34
"rules": {
45
"quotemark": [true, "single", "avoid-escape"],
5-
"interface-name": [false],
6+
"interface-name": false,
67
"variable-name": [true, "check-format", "allow-leading-underscore"],
78
"object-literal-sort-keys": false,
8-
"whitespace": [true],
9-
"member-access": [false],
10-
"no-console": [false],
11-
"no-namespace": [false]
9+
"whitespace": true,
10+
"member-access": false,
11+
"no-console": false,
12+
"no-namespace": false,
13+
"trailing-comma": [true, { "functions": "never" }]
1214
}
1315
}

0 commit comments

Comments
 (0)