From a8c5431a5a2565bb236e9fda108ec45da6bbd292 Mon Sep 17 00:00:00 2001 From: bendtherules Date: Fri, 24 Jan 2020 16:58:02 +0530 Subject: [PATCH] example > typescript setup - add tsconfig, tslint, rename to tsx --- example/package.json | 8 +++++++- example/src/{index.js => index.tsx} | 0 example/tsconfig.json | 25 +++++++++++++++++++++++++ example/tslint.json | 18 ++++++++++++++++++ 4 files changed, 50 insertions(+), 1 deletion(-) rename example/src/{index.js => index.tsx} (100%) create mode 100644 example/tsconfig.json create mode 100644 example/tslint.json diff --git a/example/package.json b/example/package.json index 53b1f02..da152ab 100644 --- a/example/package.json +++ b/example/package.json @@ -18,5 +18,11 @@ }, "devDependencies": { "@jpavon/react-scripts-ts": "^1.2.2" - } + }, + "browserslist": [ + ">0.2%", + "not dead", + "not ie <= 11", + "not op_mini all" + ] } diff --git a/example/src/index.js b/example/src/index.tsx similarity index 100% rename from example/src/index.js rename to example/src/index.tsx diff --git a/example/tsconfig.json b/example/tsconfig.json new file mode 100644 index 0000000..1e7446e --- /dev/null +++ b/example/tsconfig.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "baseUrl": ".", + "outDir": "build", + "module": "esnext", + "target": "es5", + "lib": ["es6", "dom", "es2016", "es2017"], + "sourceMap": true, + "allowJs": true, + "jsx": "react", + "declaration": true, + "moduleResolution": "node", + "forceConsistentCasingInFileNames": true, + "noImplicitReturns": true, + "noImplicitThis": true, + "noImplicitAny": true, + "strictNullChecks": true, + "suppressImplicitAnyIndexErrors": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "allowSyntheticDefaultImports": true + }, + "include": ["src"], + "exclude": ["node_modules", "build", "public"] +} diff --git a/example/tslint.json b/example/tslint.json new file mode 100644 index 0000000..e7cd39a --- /dev/null +++ b/example/tslint.json @@ -0,0 +1,18 @@ +{ + "extends": [ + "tslint:recommended", + "tslint-react", + "tslint-config-prettier" + ], + "rules": { + "no-empty-interface": false, + "object-literal-sort-keys": false, + "ordered-imports": false, + "no-console": false, + "member-ordering": false, + "jsx-no-lambda": false, + "interface-name": false, + "no-any": true + }, + "defaultSeverity": "warning" +}