1
0
Fork 0
mirror of https://github.com/terribleplan/next.js.git synced 2024-01-19 02:48:18 +00:00

example/with-typescript (#3698)

* example/with-typescript2

* apply standard js style

* remove unnecessary file & code

* fix link url

* replace with-typescript
This commit is contained in:
Bonggyun Lee 2018-02-07 01:06:48 +09:00 committed by Sergio Xalambrí
parent 9404beb12f
commit 87ab61eba5
6 changed files with 32 additions and 27 deletions

View file

@ -1 +0,0 @@
*.js

View file

@ -31,4 +31,3 @@ npm install
npm run dev npm run dev
``` ```
Output JS files are aside the related TypeScript ones.

View file

@ -0,0 +1,2 @@
const withTypescript = require('@zeit/next-typescript')
module.exports = withTypescript()

View file

@ -1,22 +1,20 @@
{ {
"name": "with-typescript", "name": "with-typescript-plugin",
"version": "1.0.0", "version": "1.0.0",
"scripts": { "scripts": {
"dev": "concurrently \"tsc --pretty --watch\" \"next\"", "dev": "next",
"prebuild": "tsc",
"build": "next build", "build": "next build",
"start": "next start" "start": "next start"
}, },
"dependencies": { "dependencies": {
"next": "latest", "next": "^5.0.0",
"react": "^16.1.0", "react": "^16.2.0",
"react-dom": "^16.1.0" "react-dom": "^16.2.0"
}, },
"devDependencies": { "devDependencies": {
"@types/next": "^2.4.5", "@types/next": "^2.4.7",
"@types/react": "^16.0.22", "@types/react": "^16.0.36",
"concurrently": "^3.5.0", "@zeit/next-typescript": "0.0.8",
"tslint": "^5.8.0", "typescript": "^2.7.1"
"typescript": "^2.6.1"
} }
} }

View file

@ -1,8 +1,25 @@
{ {
"compileOnSave": false,
"compilerOptions": { "compilerOptions": {
"jsx": "react-native", "target": "esnext",
"module": "commonjs", "module": "esnext",
"strict": true, "allowJs": true,
"target": "es2017" "moduleResolution": "node",
"allowSyntheticDefaultImports": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"removeComments": false,
"preserveConstEnums": true,
"sourceMap": true,
"skipLibCheck": true,
"baseUrl": ".",
"typeRoots": [
"./node_modules/@types"
],
"lib": [
"dom",
"es2015",
"es2016"
]
} }
} }

View file

@ -1,10 +0,0 @@
{
"defaultSeverity": "error",
"extends": ["tslint:recommended"],
"jsRules": {},
"rules": {
"quotemark": [true, "single", "jsx-double"],
"semicolon": [true, "never"]
},
"rulesDirectory": []
}