From b1507edcc3390360e0292566d75e7795c1023a80 Mon Sep 17 00:00:00 2001 From: syuilo Date: Sat, 13 Mar 2021 00:18:41 +0900 Subject: [PATCH] =?UTF-8?q?eslintrc=E3=81=A8tsconfig=E3=82=92=E6=95=B4?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .eslintrc | 20 +---------------- gulpfile.ts | 2 +- src/.eslintrc | 6 +++++ src/client/.eslintrc | 20 +++++++++++++++++ tsconfig.json => src/tsconfig.json | 8 +++---- test/.eslintrc | 7 ++++++ test/tsconfig.json | 36 ++++++++++++++++++++++++++++++ 7 files changed, 75 insertions(+), 24 deletions(-) create mode 100644 src/.eslintrc rename tsconfig.json => src/tsconfig.json (89%) create mode 100644 test/.eslintrc create mode 100644 test/tsconfig.json diff --git a/.eslintrc b/.eslintrc index 3a220319e..3e5b59cb0 100644 --- a/.eslintrc +++ b/.eslintrc @@ -3,29 +3,11 @@ "parser": "@typescript-eslint/parser" }, "extends": [ - "eslint:recommended", - "plugin:vue/recommended" + "eslint:recommended" ], "rules": { - "vue/require-v-for-key": 0, - "vue/max-attributes-per-line": 0, - "vue/html-indent": 0, - "vue/html-self-closing": 0, - "vue/no-unused-vars": 0, - "vue/attributes-order": 0, - "vue/require-prop-types": 0, - "vue/require-default-prop": 0, - "vue/html-closing-bracket-spacing": 0, - "vue/singleline-html-element-content-newline": 0, - "vue/no-v-html": 0, "no-console": 0, "no-unused-vars": 0, "no-empty": 0 - }, - "globals": { - "ENV": true, - "VERSION": true, - "API": true, - "LANGS": true } } diff --git a/gulpfile.ts b/gulpfile.ts index b899d62f9..0717d8208 100644 --- a/gulpfile.ts +++ b/gulpfile.ts @@ -14,7 +14,7 @@ const locales: { [x: string]: any } = require('./locales'); const meta = require('./package.json'); gulp.task('build:ts', () => { - const tsProject = ts.createProject('./tsconfig.json'); + const tsProject = ts.createProject('./src/tsconfig.json'); return tsProject .src() diff --git a/src/.eslintrc b/src/.eslintrc new file mode 100644 index 000000000..d54e20f6b --- /dev/null +++ b/src/.eslintrc @@ -0,0 +1,6 @@ +{ + "env": { + "node": true, + "commonjs": true + } +} diff --git a/src/client/.eslintrc b/src/client/.eslintrc index 8829472b4..fffa28d9e 100644 --- a/src/client/.eslintrc +++ b/src/client/.eslintrc @@ -1,4 +1,24 @@ { + "env": { + "node": false, + }, + "extends": [ + "eslint:recommended", + "plugin:vue/recommended" + ], + "rules": { + "vue/require-v-for-key": 0, + "vue/max-attributes-per-line": 0, + "vue/html-indent": 0, + "vue/html-self-closing": 0, + "vue/no-unused-vars": 0, + "vue/attributes-order": 0, + "vue/require-prop-types": 0, + "vue/require-default-prop": 0, + "vue/html-closing-bracket-spacing": 0, + "vue/singleline-html-element-content-newline": 0, + "vue/no-v-html": 0 + }, "globals": { "_DEV_": false, "_LANGS_": false, diff --git a/tsconfig.json b/src/tsconfig.json similarity index 89% rename from tsconfig.json rename to src/tsconfig.json index 075450bf6..95cb35fc5 100644 --- a/tsconfig.json +++ b/src/tsconfig.json @@ -22,8 +22,8 @@ "resolveJsonModule": true, "isolatedModules": true, "typeRoots": [ - "node_modules/@types", - "src/@types" + "../node_modules/@types", + "./@types" ], "lib": [ "esnext" @@ -31,9 +31,9 @@ }, "compileOnSave": false, "include": [ - "./src/**/*.ts" + "./**/*.ts" ], "exclude": [ - "./src/client/**/*.ts" + "./client/**/*.ts" ] } diff --git a/test/.eslintrc b/test/.eslintrc new file mode 100644 index 000000000..cea1b1138 --- /dev/null +++ b/test/.eslintrc @@ -0,0 +1,7 @@ +{ + "env": { + "node": true, + "mocha": true, + "commonjs": true + } +} diff --git a/test/tsconfig.json b/test/tsconfig.json new file mode 100644 index 000000000..987067ba8 --- /dev/null +++ b/test/tsconfig.json @@ -0,0 +1,36 @@ +{ + "compilerOptions": { + "allowJs": true, + "noEmitOnError": false, + "noImplicitAny": true, + "noImplicitReturns": true, + "noUnusedParameters": false, + "noUnusedLocals": true, + "noFallthroughCasesInSwitch": true, + "declaration": false, + "sourceMap": true, + "target": "es2017", + "module": "commonjs", + "moduleResolution": "node", + "removeComments": false, + "noLib": false, + "strict": true, + "strictNullChecks": true, + "strictPropertyInitialization": false, + "experimentalDecorators": true, + "emitDecoratorMetadata": true, + "resolveJsonModule": true, + "isolatedModules": true, + "typeRoots": [ + "../node_modules/@types", + "../src/@types" + ], + "lib": [ + "esnext" + ] + }, + "compileOnSave": false, + "include": [ + "./**/*.ts" + ] +}