From 9372c08ea4d5b8a96bd74f5ae62a1ecfacfee9d8 Mon Sep 17 00:00:00 2001 From: Hal Seki Date: Tue, 2 Jan 2024 00:33:49 +0900 Subject: [PATCH 1/8] update to node 20.10.0 and fix eslint --- .eslintrc.js | 53 +- .node-version | 2 +- .prettierrc.yaml | 16 + .settings.json | 3 + .vscode/settings.json | 3 + components/Logo.vue | 16 +- components/Modal.vue | 24 +- components/PrintableMap.vue | 492 +- layouts/error.vue | 2 +- lib/displayHelper.ts | 2 +- package.json | 1 + pages/index.vue | 170 +- pages/map/_map.vue | 2 +- tsconfig.json | 4 +- yarn.lock | 9016 ++++++++++++++++++++--------------- 15 files changed, 5470 insertions(+), 4336 deletions(-) create mode 100644 .prettierrc.yaml create mode 100644 .settings.json create mode 100644 .vscode/settings.json diff --git a/.eslintrc.js b/.eslintrc.js index 74b279c9..4d4e6d0f 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -2,30 +2,53 @@ module.exports = { root: true, env: { browser: true, - node: true + node: true, }, parser: 'vue-eslint-parser', parserOptions: { ecmaVersion: 2016, - parser: 'babel-eslint' + parser: 'babel-eslint', }, extends: [ '@nuxtjs', 'plugin:nuxt/recommended', - 'plugin:vue/recommended' - ], - plugins: [ - 'vue', - 'html' + 'plugin:vue/recommended', + 'prettier', ], + plugins: ['html', 'vue'], // add your custom rules here rules: { - quotes: ['error', 'single'], - camelcase: 'warn', - 'vue/no-mutating-props': 'warn', - 'brace-style': 'warn', - 'eqeqeq': 'warn', - 'quotes': 'warn', - semi: 'error' - } + // タグの最後で改行しないで + 'vue/html-closing-bracket-newline': [2, { multiline: 'never' }], + // 不要なカッコは消す + 'no-extra-parens': 1, + // 無駄なスペースは削除 + 'no-multi-spaces': 2, + // 不要な空白行は削除。2行開けてたらエラー + 'no-multiple-empty-lines': [2, { max: 1 }], + // 関数とカッコはあけない(function hoge() {/** */}) + 'func-call-spacing': [2, 'never'], + // true/falseを無駄に使うな + 'no-unneeded-ternary': 2, + // セミコロンは禁止 + semi: [2, 'never'], + // 文字列はシングルクオートのみ + quotes: [2, 'single'], + // varは禁止 + 'no-var': 2, + // jsのインデントは2 + indent: [2, 2], + // かっこの中はスペースなし!違和感 + 'space-in-parens': [2, 'never'], + // コンソールは許可 + 'no-console': 0, + // カンマの前後にスペース入れる? + 'comma-spacing': 2, + // 配列のindexには空白入れるな(hogehoge[ x ]) + 'computed-property-spacing': 2, + // キー + 'key-spacing': 2, + // キーワードの前後には適切なスペースを + 'keyword-spacing': 2, + }, } diff --git a/.node-version b/.node-version index 0a9f3027..d5a15960 100644 --- a/.node-version +++ b/.node-version @@ -1 +1 @@ -14.17.2 +20.10.0 diff --git a/.prettierrc.yaml b/.prettierrc.yaml new file mode 100644 index 00000000..6609e785 --- /dev/null +++ b/.prettierrc.yaml @@ -0,0 +1,16 @@ +tabWidth: 2 +useTabs: false +semi: true +singleQuote: false +quoteProps: "as-needed" +trailingComma: "es5" +bracketSpacing: true +bracketSameLine: false +arrowParens: "always" +requirePragma: false +insertPragma: false +htmlWhitespaceSensitivity: "css" +vueIndentScriptAndStyle: true +endOfLine: "lf" +embeddedLanguageFormatting: "off" +singleAttributePerLine: false diff --git a/.settings.json b/.settings.json new file mode 100644 index 00000000..8d9c9bc0 --- /dev/null +++ b/.settings.json @@ -0,0 +1,3 @@ +{ + "editor.formatOnSave": false +} \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 00000000..62098c32 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "eslint.validate": [] +} \ No newline at end of file diff --git a/components/Logo.vue b/components/Logo.vue index 6c728541..8a307066 100644 --- a/components/Logo.vue +++ b/components/Logo.vue @@ -1,13 +1,13 @@ -