From c5b870c07638fcc2d536fb08cf0bd790c024a551 Mon Sep 17 00:00:00 2001 From: Rozelin Date: Sat, 15 Jun 2024 17:56:03 +0900 Subject: [PATCH 1/2] =?UTF-8?q?=E3=81=A8=E3=82=8A=E3=81=82=E3=81=88?= =?UTF-8?q?=E3=81=9A=E5=85=A8=E9=83=A8=E3=82=B3=E3=83=9F=E3=83=83=E3=83=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .eslintignore | 1 + .eslintrc.cjs | 41 +++++++++++ eslint.config.js | 27 ------- package-lock.json | 131 ++++++++++++++++++++++++++++++++++ package.json | 8 ++- src/components/HelloWorld.vue | 23 ++---- src/pages/CreateRoom.vue | 69 +++++++++--------- src/pages/HomePage.vue | 18 +++-- src/pages/IndividualRoom.vue | 23 ++---- src/pages/RoomList.vue | 23 ++---- src/router/index.ts | 2 +- 11 files changed, 250 insertions(+), 116 deletions(-) create mode 100644 .eslintignore create mode 100644 .eslintrc.cjs delete mode 100644 eslint.config.js diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..c870c3a --- /dev/null +++ b/.eslintignore @@ -0,0 +1 @@ +src/lib/apis/generated diff --git a/.eslintrc.cjs b/.eslintrc.cjs new file mode 100644 index 0000000..eb237a3 --- /dev/null +++ b/.eslintrc.cjs @@ -0,0 +1,41 @@ +module.exports = { + root: true, + env: { + browser: true, + node: true, + es6: true, + }, + extends: [ + // add more generic rulesets here, such as: + // 'eslint:recommended', + 'plugin:vue/vue3-recommended', + 'eslint:recommended', + 'plugin:@typescript-eslint/recommended', + 'plugin:prettier/recommended', + // 'plugin:vue/recommended' // Use this if you are using Vue.js 2.x. + ], + plugins: ['@typescript-eslint'], + rules: { + // override/add rules settings here, such as: + // 'vue/no-unused-vars': 'error' + 'no-restricted-imports': [ + 'error', + { + name: '@/lib/apis/generated', + message: 'Please use @/lib/apis instead.', + }, + ], + 'prettier/prettier': [ + 'error', + { + singleQuote: true, + semi: false, + }, + ], + }, + parser: 'vue-eslint-parser', + parserOptions: { + parser: '@typescript-eslint/parser', + sourceType: 'module', + }, +} diff --git a/eslint.config.js b/eslint.config.js deleted file mode 100644 index eeb2084..0000000 --- a/eslint.config.js +++ /dev/null @@ -1,27 +0,0 @@ -import pluginVue from 'eslint-plugin-vue' -import vueParser from 'vue-eslint-parser' -import tseslint from 'typescript-eslint' -export default [ - // add more generic rulesets here, such as: - // js.configs.recommended, - ...pluginVue.configs['flat/recommended'], - // ...pluginVue.configs['flat/vue2-recommended'], // Use this if you are using Vue.js 2.x. - { - rules: { - // override/add rules settings here, such as: - // 'vue/no-unused-vars': 'error' - 'no-restricted-imports': [ - 'error', - { - name: '@/lib/apis/generated', - message: 'Please use @/lib/apis instead.', - }, - ], - }, - files: ['*.vue', '**/*.vue'], - languageOptions: { - parser: vueParser, - parserOptions: { parser: tseslint.parser, sourceType: 'module' }, - }, - }, -] diff --git a/package-lock.json b/package-lock.json index 5d017f8..9c1f5b1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -16,11 +16,17 @@ "@eslint/js": "^8.57.0", "@openapitools/openapi-generator-cli": "^2.13.4", "@stoplight/prism-cli": "^5.8.1", + "@typescript-eslint/eslint-plugin": "^7.13.0", + "@typescript-eslint/parser": "^7.13.0", "@vitejs/plugin-vue": "^5.0.4", "concurrently": "^8.2.2", "eslint": "^8.57.0", + "eslint-config-prettier": "^9.1.0", + "eslint-config-typescript": "^3.0.0", + "eslint-plugin-prettier": "^5.1.3", "eslint-plugin-vue": "^9.26.0", "execa": "^9.2.0", + "prettier": "^3.3.2", "ts-morph": "^22.0.0", "typescript": "^5.4.5", "typescript-eslint": "^7.13.0", @@ -861,6 +867,19 @@ "node": ">=10" } }, + "node_modules/@pkgr/core": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/@pkgr/core/-/core-0.1.1.tgz", + "integrity": "sha512-cq8o4cWH0ibXh9VGi5P20Tu9XF/0fFXl9EUinr9QfTM7a7p0oTA4iJRCQWppXR1Pg8dSM0UCItCkPwsk9qWWYA==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^12.20.0 || ^14.18.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/unts" + } + }, "node_modules/@rollup/rollup-android-arm-eabi": { "version": "4.18.0", "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.18.0.tgz", @@ -1603,6 +1622,7 @@ "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-7.13.0.tgz", "integrity": "sha512-FX1X6AF0w8MdVFLSdqwqN/me2hyhuQg4ykN6ZpVhh1ij/80pTvDKclX1sZB9iqex8SjQfVhwMKs3JtnnMLzG9w==", "dev": true, + "license": "MIT", "dependencies": { "@eslint-community/regexpp": "^4.10.0", "@typescript-eslint/scope-manager": "7.13.0", @@ -1636,6 +1656,7 @@ "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-7.13.0.tgz", "integrity": "sha512-EjMfl69KOS9awXXe83iRN7oIEXy9yYdqWfqdrFAYAAr6syP8eLEFI7ZE4939antx2mNgPRW/o1ybm2SFYkbTVA==", "dev": true, + "license": "BSD-2-Clause", "dependencies": { "@typescript-eslint/scope-manager": "7.13.0", "@typescript-eslint/types": "7.13.0", @@ -2948,6 +2969,63 @@ "url": "https://opencollective.com/eslint" } }, + "node_modules/eslint-config-prettier": { + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-9.1.0.tgz", + "integrity": "sha512-NSWl5BFQWEPi1j4TjVNItzYV7dZXZ+wP6I6ZhrBGpChQhZRUaElihE9uRRkcbRnNb76UMKDF3r+WTmNcGPKsqw==", + "dev": true, + "license": "MIT", + "bin": { + "eslint-config-prettier": "bin/cli.js" + }, + "peerDependencies": { + "eslint": ">=7.0.0" + } + }, + "node_modules/eslint-config-typescript": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/eslint-config-typescript/-/eslint-config-typescript-3.0.0.tgz", + "integrity": "sha512-CwC2cQ29OLE1OUw0k+Twpc6wpCdenG8rrErl89sWrzmMpWfkulyeQS1HJhhjU0B3Tb4k41zdei4LtX26x5m60Q==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "@typescript-eslint/eslint-plugin": ">=1.8.0", + "@typescript-eslint/parser": ">=1.8.0", + "eslint": ">=6.0.0", + "typescript": "*" + } + }, + "node_modules/eslint-plugin-prettier": { + "version": "5.1.3", + "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-5.1.3.tgz", + "integrity": "sha512-C9GCVAs4Eq7ZC/XFQHITLiHJxQngdtraXaM+LoUFoFp/lHNl2Zn8f3WQbe9HvTBBQ9YnKFB0/2Ajdqwo5D1EAw==", + "dev": true, + "license": "MIT", + "dependencies": { + "prettier-linter-helpers": "^1.0.0", + "synckit": "^0.8.6" + }, + "engines": { + "node": "^14.18.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint-plugin-prettier" + }, + "peerDependencies": { + "@types/eslint": ">=8.0.0", + "eslint": ">=8.0.0", + "eslint-config-prettier": "*", + "prettier": ">=3.0.0" + }, + "peerDependenciesMeta": { + "@types/eslint": { + "optional": true + }, + "eslint-config-prettier": { + "optional": true + } + } + }, "node_modules/eslint-plugin-vue": { "version": "9.26.0", "resolved": "https://registry.npmjs.org/eslint-plugin-vue/-/eslint-plugin-vue-9.26.0.tgz", @@ -3166,6 +3244,13 @@ "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", "dev": true }, + "node_modules/fast-diff": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/fast-diff/-/fast-diff-1.3.0.tgz", + "integrity": "sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw==", + "dev": true, + "license": "Apache-2.0" + }, "node_modules/fast-glob": { "version": "3.3.2", "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.2.tgz", @@ -4974,6 +5059,35 @@ "node": ">= 0.8.0" } }, + "node_modules/prettier": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.3.2.tgz", + "integrity": "sha512-rAVeHYMcv8ATV5d508CFdn+8/pHPpXeIid1DdrPwXnaAdH7cqjVbpJaT5eq4yRAFU/lsbwYwSF/n5iNrdJHPQA==", + "dev": true, + "license": "MIT", + "bin": { + "prettier": "bin/prettier.cjs" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" + } + }, + "node_modules/prettier-linter-helpers": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz", + "integrity": "sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w==", + "dev": true, + "license": "MIT", + "dependencies": { + "fast-diff": "^1.1.2" + }, + "engines": { + "node": ">=6.0.0" + } + }, "node_modules/pretty-data": { "version": "0.40.0", "resolved": "https://registry.npmjs.org/pretty-data/-/pretty-data-0.40.0.tgz", @@ -5572,6 +5686,23 @@ "node": ">=8" } }, + "node_modules/synckit": { + "version": "0.8.8", + "resolved": "https://registry.npmjs.org/synckit/-/synckit-0.8.8.tgz", + "integrity": "sha512-HwOKAP7Wc5aRGYdKH+dw0PRRpbO841v2DENBtjnR5HFWoiNByAl7vrx3p0G/rCyYXQsrxqtX48TImFtPcIHSpQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@pkgr/core": "^0.1.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": "^14.18.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/unts" + } + }, "node_modules/text-table": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", diff --git a/package.json b/package.json index ed82bf0..fa79918 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "dev": "vite", "build": "vue-tsc && vite build", "preview": "vite preview", - "lint": "eslint src", + "lint": "eslint src --ext .js,.ts,.vue", "gen-api": "node ./scripts/gen-api.js", "with-mock": "concurrently \"prism mock -p 3000 -d https://raw.githubusercontent.com/traP-jp/h24s_19_server/main/swagger.yaml\" \"vite\"" }, @@ -20,11 +20,17 @@ "@eslint/js": "^8.57.0", "@openapitools/openapi-generator-cli": "^2.13.4", "@stoplight/prism-cli": "^5.8.1", + "@typescript-eslint/eslint-plugin": "^7.13.0", + "@typescript-eslint/parser": "^7.13.0", "@vitejs/plugin-vue": "^5.0.4", "concurrently": "^8.2.2", "eslint": "^8.57.0", + "eslint-config-prettier": "^9.1.0", + "eslint-config-typescript": "^3.0.0", + "eslint-plugin-prettier": "^5.1.3", "eslint-plugin-vue": "^9.26.0", "execa": "^9.2.0", + "prettier": "^3.3.2", "ts-morph": "^22.0.0", "typescript": "^5.4.5", "typescript-eslint": "^7.13.0", diff --git a/src/components/HelloWorld.vue b/src/components/HelloWorld.vue index eadb5f6..7b25f3f 100644 --- a/src/components/HelloWorld.vue +++ b/src/components/HelloWorld.vue @@ -10,12 +10,7 @@ const count = ref(0)

{{ msg }}

- +

Edit components/HelloWorld.vue to test HMR @@ -24,22 +19,16 @@ const count = ref(0)

Check out - create-vue, the official Vue + Vite starter + create-vue, the official Vue + Vite starter

Install - Volar + Volar in your IDE for a better DX

-

- Click on the Vite and Vue logos to learn more -

+

Click on the Vite and Vue logos to learn more

diff --git a/src/pages/HomePage.vue b/src/pages/HomePage.vue index 0983c47..3d21ff4 100644 --- a/src/pages/HomePage.vue +++ b/src/pages/HomePage.vue @@ -1,7 +1,17 @@ @@ -9,7 +19,7 @@ .read-the-docs { color: #888; } -.changePageButton{ - margin:10px; +.changePageButton { + margin: 10px; } diff --git a/src/pages/IndividualRoom.vue b/src/pages/IndividualRoom.vue index eadb5f6..7b25f3f 100644 --- a/src/pages/IndividualRoom.vue +++ b/src/pages/IndividualRoom.vue @@ -10,12 +10,7 @@ const count = ref(0)

{{ msg }}

- +

Edit components/HelloWorld.vue to test HMR @@ -24,22 +19,16 @@ const count = ref(0)

Check out - create-vue, the official Vue + Vite starter + create-vue, the official Vue + Vite starter

Install - Volar + Volar in your IDE for a better DX

-

- Click on the Vite and Vue logos to learn more -

+

Click on the Vite and Vue logos to learn more