From a5957211529b50693d56487d85218a5fb0b7dc95 Mon Sep 17 00:00:00 2001 From: xiaohuoni <448627663@qq.com> Date: Tue, 19 Mar 2019 22:54:48 +0800 Subject: [PATCH] ts config --- tsconfig.json | 15 ++++---- tslint.json | 11 ------ tslint.yml | 95 +++++++++++++++++++++++++++++++++++++++++++++++++++ typings.d.ts | 12 +++++++ 4 files changed, 113 insertions(+), 20 deletions(-) delete mode 100644 tslint.json create mode 100644 tslint.yml create mode 100644 typings.d.ts diff --git a/tsconfig.json b/tsconfig.json index 6444ff25..48b504b7 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -2,8 +2,8 @@ "compilerOptions": { "outDir": "build/dist", "module": "esnext", - "target": "es2016", - "lib": ["es6", "dom"], + "target": "esnext", + "lib": ["esnext", "dom"], "sourceMap": true, "baseUrl": ".", "jsx": "react", @@ -16,19 +16,16 @@ "noUnusedLocals": true, "allowJs": true, "experimentalDecorators": true, + "strict": true, "paths": { - "@/*": ["./ant-design-pro/*/src/*"] + "@/*": ["./src/*"] } }, - "include": ["./ant-design-pro"], + "include": ["."], "exclude": [ "node_modules", - "build", - "scripts", - "acceptance-tests", - "webpack", + "_scripts", "jest", - "src/setupTests.ts", "tslint:latest", "tslint-config-prettier" ] diff --git a/tslint.json b/tslint.json deleted file mode 100644 index 125e217e..00000000 --- a/tslint.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "extends": ["tslint:latest", "tslint-react", "tslint-config-prettier"], - "rules": { - "no-var-requires": false, - "no-submodule-imports": false, - "object-literal-sort-keys": false, - "jsx-no-lambda": false, - "no-implicit-dependencies": false, - "no-console": false - } -} diff --git a/tslint.yml b/tslint.yml new file mode 100644 index 00000000..a3e95faf --- /dev/null +++ b/tslint.yml @@ -0,0 +1,95 @@ +defaultSeverity: error +extends: + - tslint-react + - tslint-eslint-rules + - tslint-config-prettier +jsRules: +rules: + class-name: true + eofline: true + forin: true + jsdoc-format: false + label-position: true + member-ordering: + - true + - order: statics-first + new-parens: true + no-arg: true + no-bitwise: true + no-conditional-assignment: true + no-consecutive-blank-lines: true + no-console: + - true + - debug + - info + - log + - time + - timeEnd + - trace + - warn + no-construct: true + no-debugger: true + no-duplicate-variable: true + no-eval: true + no-internal-module: true + no-multi-spaces: true + no-namespace: true + no-reference: true + no-shadowed-variable: true + no-string-literal: true + no-trailing-whitespace: true + no-unused-expression: true + no-var-keyword: true + one-variable-per-declaration: + - true + - ignore-for-loop + prefer-const: + - true + - destructuring: all + radix: true + space-in-parens: true + switch-default: true + trailing-comma: + - true + - singleline: never + multiline: always + esSpecCompliant: true + triple-equals: + - true + - allow-null-check + typedef-whitespace: + - true + - call-signature: nospace + index-signature: nospace + parameter: nospace + property-declaration: nospace + variable-declaration: nospace + - call-signature: onespace + index-signature: onespace + parameter: onespace + property-declaration: onespace + variable-declaration: onespace + use-isnan: true + variable-name: + - true + - allow-leading-underscore + - ban-keywords + - check-format + - allow-pascal-case + jsx-no-lambda: false + jsx-no-string-ref: false + jsx-boolean-value: + - true + - never + jsx-no-multiline-js: false + whitespace: + - true + - check-branch + - check-decl + - check-operator + - check-module + - check-separator + - check-rest-spread + - check-type + - check-type-operator + - check-preblock diff --git a/typings.d.ts b/typings.d.ts new file mode 100644 index 00000000..31596c27 --- /dev/null +++ b/typings.d.ts @@ -0,0 +1,12 @@ +declare module '*.css'; +declare module '*.less'; +declare module '*.scss'; +declare module '*.sass'; +declare module '*.svg'; +declare module '*.png'; +declare module '*.jpg'; +declare module '*.jpeg'; +declare module '*.gif'; +declare module '*.bmp'; +declare module '*.tiff'; +declare var APP_TYPE: string; -- GitLab