##今の状況
現在開発環境をDocker、フロントをVue.js、バックエンドをFirebaseで構築しています。
また、コード整形ツールとしてESLint,Prettierを導入しているのですが、yarn lint
で起動させると以下の様なエラーが出てしまいます。
ERROR in ./pages/register.vue Module Error (from ./node_modules/eslint-loader/dist/cjs.js): /app/pages/register.vue 139:1 error Expected indentation of 6 spaces but found 8 indent 140:1 error Expected indentation of 8 spaces but found 10 indent 141:1 error Expected indentation of 10 spaces but found 12 indent 142:1 error Expected indentation of 10 spaces but found 12 indent 143:1 error Expected indentation of 8 spaces but found 10 indent 144:1 error Expected indentation of 6 spaces but found 8 indent 145:1 error Expected indentation of 8 spaces but found 10 indent 146:1 error Expected indentation of 10 spaces but found 12 indent 147:1 error Expected indentation of 10 spaces but found 12 indent 148:1 error Expected indentation of 8 spaces but found 10 indent 149:1 error Expected indentation of 6 spaces but found 8 indent 150:1 error Expected indentation of 8 spaces but found 10 indent 151:1 error Expected indentation of 10 spaces but found 12 indent 152:1 error Expected indentation of 10 spaces but found 12 indent 153:1 error Expected indentation of 8 spaces but found 10 indent 154:1 error Expected indentation of 6 spaces but found 8 indent 155:1 error Expected indentation of 8 spaces but found 10 indent 156:1 error Expected indentation of 10 spaces but found 12 indent 157:1 error Expected indentation of 10 spaces but found 12 indent 158:1 error Expected indentation of 8 spaces but found 10 indent 159:1 error Expected indentation of 6 spaces but found 8 indent 160:1 error Expected indentation of 8 spaces but found 10 indent 161:1 error Expected indentation of 10 spaces but found 12 indent 162:1 error Expected indentation of 10 spaces but found 12 indent 163:1 error Expected indentation of 8 spaces but found 10 indent 168:19 error Expected error to be handled node/handle-callback-err ✖ 26 problems (26 errors, 0 warnings) 25 errors and 0 warnings potentially fixable with the `--fix` option.
##試したこと
PrettierとESLintのspaceの広さを合わせました。
.prettierファイル
{ "printWidth": 120, "tabWidth": 2, "semi": false, "singleQuote": true, "trailingComma": "none", "bracketSpacing": true, "arrowParens": "avoid" }
.eslintrc.js
module.exports = { root: true, env: { node: true, es6: true }, parser: 'vue-eslint-parser', parserOptions: { sourceType: 'module', parser: 'babel-eslint' }, extends: [ '@nuxtjs', 'eslint:recommended', 'plugin:vue/recommended', 'plugin:vue-types/recommended', 'prettier', 'prettier/vue', 'plugin:nuxt/recommended', 'plugin:prettier/recommended' ], plugins: ['vue'], rules: { 'prettier/prettier': 0, 'vue/html-closing-bracket-newline': [ 'error', { multiline: 'always' } ], indent: [2, 'tab'],⇦追加(ESLintのdefaultは4) 'no-console': 'off', 'vue/require-prop-types': 0, 'vue/max-attributes-per-line': 'off', 'vue/html-self-closing': 'off', 'no-unused-vars': 'off', 'no-extra-parens': 1, 'no-multi-spaces': 2, 'vue/singleline-html-element-content-newline': 'off', 'vue/multiline-html-element-content-newline': 'off' } }
###結果
エラーは解消されませんでした。
理由が分からず困っておりますので、是非どなたかご教示頂けますと嬉しいです。
宜しくお願い致します。
GitHubはこちら
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2021/01/24 17:24