Skip to content

Commit cbba0f1

Browse files
Add npm script to check TypeScript
"npm run lint" will compile the TypeScript code to check types.
1 parent 4a4becc commit cbba0f1

File tree

3 files changed

+25
-1
lines changed

3 files changed

+25
-1
lines changed

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
"scripts": {
1212
"build": "npm run clean && babel src -d lib --extensions '.js,.ts'",
1313
"clean": "rimraf lib/*",
14+
"lint": "tsc",
1415
"test": "echo \"Error: no test specified\" && exit 1"
1516
},
1617
"dependencies": {},
@@ -19,6 +20,7 @@
1920
"@babel/core": "^7.0.0-beta.54",
2021
"@babel/preset-env": "^7.0.0-beta.54",
2122
"@babel/preset-typescript": "^7.0.0-beta.54",
22-
"rimraf": "^2.6.2"
23+
"rimraf": "^2.6.2",
24+
"typescript": "^2.9.2"
2325
}
2426
}

tsconfig.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"compilerOptions": {
3+
"allowJs": true,
4+
"allowSyntheticDefaultImports": true,
5+
"baseUrl": "./",
6+
"rootDir": "./",
7+
"module": "es2015",
8+
"noEmit": true,
9+
"noUnusedLocals": true,
10+
"noUnusedParameters": true,
11+
"pretty": true,
12+
"skipLibCheck": true,
13+
"sourceMap": true
14+
},
15+
"include": [
16+
"src"
17+
]
18+
}

yarn.lock

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1727,6 +1727,10 @@ trim-right@^1.0.1:
17271727
version "1.0.1"
17281728
resolved "https://registry.yarnpkg.com/trim-right/-/trim-right-1.0.1.tgz#cb2e1203067e0c8de1f614094b9fe45704ea6003"
17291729

1730+
typescript@^2.9.2:
1731+
version "2.9.2"
1732+
resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.9.2.tgz#1cbf61d05d6b96269244eb6a3bce4bd914e0f00c"
1733+
17301734
unicode-canonical-property-names-ecmascript@^1.0.4:
17311735
version "1.0.4"
17321736
resolved "https://registry.yarnpkg.com/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-1.0.4.tgz#2619800c4c825800efdd8343af7dd9933cbe2818"

0 commit comments

Comments
 (0)