Unverified Commit dd556bf9 authored by Tim Neutkens's avatar Tim Neutkens Committed by GitHub

Add tsc type checking (#5826)

* Add tsc type checking

* Add linting on circle

* Add node-fetch types

* Use strict mode
parent 70985015
......@@ -8,6 +8,7 @@ jobs:
- checkout
- run: yarn install
- run: yarn bootstrap
- run: yarn lint
- run: yarn test
publish-stable:
docker:
......
......@@ -13,7 +13,8 @@
"pretest": "npm run lint",
"test": "npm run testall || npm run testall",
"coveralls": "cat ./test/coverage/lcov.info | coveralls",
"lint": "standard && standard --parser typescript-eslint-parser --plugin typescript packages/**/*.ts",
"lint": "lerna run typescript && standard && standard --parser typescript-eslint-parser --plugin typescript packages/**/*.ts",
"typescript": "lerna run typescript",
"prepublish": "lerna run prepublish",
"publish-canary": "lerna version prerelease --preid canary --force-publish",
"lint-staged": "lint-staged"
......@@ -27,6 +28,7 @@
"standard": {
"parser": "babel-eslint",
"ignore": [
"**/*.d.ts",
"**/node_modules/**",
"examples/with-ioc/**",
"examples/with-kea/**",
......
{
"compilerOptions": {
"strict": true,
"allowJs": true,
"noEmit": true,
"module": "esnext",
"target": "ES2017",
"esModuleInterop": true,
"moduleResolution": "node",
"jsx": "react"
}
}
......@@ -52,10 +52,12 @@ export default function ({ types: t }: {types: typeof BabelTypes}): PluginObj {
if (
callExpression.isMemberExpression() &&
callExpression.node.computed === false &&
callExpression.get('property').isIdentifier({ name: 'Map' })
callExpression.node.computed === false
) {
callExpression = callExpression.parentPath
const property = callExpression.get('property')
if (!Array.isArray(property) && property.isIdentifier({ name: 'Map' })) {
callExpression = callExpression.parentPath
}
}
if (!callExpression.isCallExpression()) return
......
......@@ -28,7 +28,8 @@
"scripts": {
"build": "taskr",
"release": "taskr release",
"prepublish": "npm run release"
"prepublish": "npm run release",
"typescript": "tsc --noEmit"
},
"taskr": {
"requires": [
......@@ -91,6 +92,7 @@
"react-dom": "^16.0.0"
},
"devDependencies": {
"@babel/parser": "7.2.0",
"@taskr/clear": "1.1.0",
"@taskr/esnext": "1.1.0",
"@taskr/watch": "1.1.0",
......@@ -100,6 +102,7 @@
"@types/babel__template": "7.0.1",
"@types/babel__traverse": "7.0.3",
"@types/nanoid": "1.2.0",
"@types/node-fetch": "2.1.4",
"@types/webpack": "4.4.20",
"taskr": "1.1.0",
"typescript": "3.1.6"
......
{
"compilerOptions": {
"strict": true,
"allowJs": true,
"noEmit": true,
"module": "esnext",
"target": "ES2017",
"esModuleInterop": true,
"moduleResolution": "node",
"jsx": "react",
"strictNullChecks": true,
"noImplicitAny": true,
"baseUrl": "../..",
"paths": {
"@babel/types": [
"babel-types/index.d.ts",
"@types/babel-types/index.d.ts",
"node_modules/@types/babel-types/index.d.ts",
"packages/next/node_modules/@types/babel-types/index.d.ts"
"@types/babel-types/index.d.ts"
]
}
}
......
declare module '@babel/plugin-transform-modules-commonjs';
declare module 'next-server/next-config';
declare module 'next-server/constants';
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment