Skip to content

Commit 0c482b9

Browse files
mceachenkoskimas
authored andcommitted
Linted typings and added model-less transaction signature
* s/String/string * s/Object/object * replaced callable genericized types with interfaces (see microsoft/TypeScript#17097 (comment) * coallesced some method calls where union types made sense * replace Function with `() => void` * tslint fixed a bunch of missing semicolons
1 parent 1c9af95 commit 0c482b9

File tree

5 files changed

+201
-144
lines changed

5 files changed

+201
-144
lines changed

examples/express-ts/package.json

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,24 +14,24 @@
1414
],
1515
"license": "MIT",
1616
"dependencies": {
17-
"body-parser": "^1.16.1",
18-
"express": "^4.14.1",
19-
"express-promise-router": "^1.1.1",
20-
"knex": "^0.12.7",
17+
"body-parser": "^1.17.2",
18+
"express": "^4.15.3",
19+
"express-promise-router": "^2.0.0",
20+
"knex": "^0.13.0",
2121
"lodash": "^4.17.4",
22-
"morgan": "^1.8.1",
23-
"objection": "^0.7.0",
22+
"morgan": "^1.8.2",
23+
"objection": "../..",
2424
"sqlite3": "^3.1.8"
2525
},
2626
"devDependencies": {
27-
"@types/body-parser": "^0.0.34",
28-
"@types/express": "^4.0.35",
29-
"@types/knex": "^0.0.41",
30-
"@types/lodash": "^4.14.53",
27+
"@types/body-parser": "^1.16.4",
28+
"@types/express": "^4.0.36",
29+
"@types/knex": "^0.0.56",
30+
"@types/lodash": "^4.14.70",
3131
"@types/morgan": "^1.7.32",
32-
"@types/sqlite3": "^2.2.32",
33-
"tslint": "^4.4.2",
34-
"tslint-config-standard": "^4.0.0",
35-
"typescript": "^2.2.1"
32+
"@types/sqlite3": "^3.1.0",
33+
"tslint": "^5.5.0",
34+
"tslint-config-standard": "^6.0.1",
35+
"typescript": "^2.4.2"
3636
}
3737
}

examples/express-ts/tsconfig.json

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,17 @@
22
"compilerOptions": {
33
"allowJs": false,
44
"allowUnreachableCode": false,
5-
"forceConsistentCasingInFileNames": true,
5+
"alwaysStrict": true,
66
"module": "commonjs",
77
"moduleResolution": "node",
88
"noFallthroughCasesInSwitch": true,
99
"noImplicitAny": true,
1010
"noImplicitReturns": true,
1111
"noImplicitThis": true,
12-
"noImplicitUseStrict": false,
12+
"strict": true,
1313
"strictNullChecks": true,
1414
"target": "es6",
1515
"rootDir": "src",
1616
"outDir": "lib"
17-
},
18-
"exclude": [
19-
"node_modules"
20-
]
17+
}
2118
}

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@
6767
"mysql": "^2.13.0",
6868
"pg": "^6.2.2",
6969
"sqlite3": "^3.1.8",
70-
"typescript": "^2.4.1"
70+
"tslint": "^5.5.0",
71+
"typescript": "^2.4.2"
7172
}
7273
}

tslint.json

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"defaultSeverity": "error",
3+
"extends": [
4+
"tslint:recommended"
5+
],
6+
"jsRules": {},
7+
"rules": {
8+
"class-name": false,
9+
"interface-name": [false],
10+
"max-classes-per-file": [false],
11+
"member-access": [false],
12+
"member-ordering": [false],
13+
"no-namespace": [false],
14+
"no-empty-interface": [false],
15+
"no-unused-expression": [false],
16+
"semicolon": [true, "always"],
17+
"space-before-function-paren": [false],
18+
"trailing-comma": [false, "always"],
19+
"array-type": [false, "array-simple"],
20+
"unified-signatures": false
21+
},
22+
"rulesDirectory": []
23+
}

0 commit comments

Comments
 (0)