meteorlxy / eslint-plugin-prettier-vue

:ok_hand: ESLint plugin for Prettier formatting, which is better for Vue SFC
MIT License
115 stars 9 forks source link

Failed to load plugin 'prettier-vue' declared in '.eslintrc.js': #10

Closed shaneostonstowe closed 3 years ago

shaneostonstowe commented 4 years ago

I have followed your docs for installing eslint-lugin-prettier-vue. Note that I am using the latest beta of VueJS in this test app.

I get this error when attempting to build the app:

Module build failed (from ./node_modules/eslint-loader/index.js):
Error: Failed to load plugin 'prettier-vue' declared in '.eslintrc.js': 

Here is the resulting package.json and my .eslintrc: package.json

{
  "name": "anvos-test-app",
  "version": "0.1.0",
  "private": true,
  "scripts": {
    "serve": "vue-cli-service serve",
    "build": "vue-cli-service build",
    "test:unit": "vue-cli-service test:unit",
    "test:e2e": "vue-cli-service test:e2e",
    "lint": "vue-cli-service lint"
  },
  "dependencies": {
    "core-js": "^3.6.5",
    "lodash": "^4.17.15",
    "vue": "^3.0.0-beta.20",
    "vue-router": "^4.0.0-beta.2",
    "vuex": "^4.0.0-beta.4"
  },
  "devDependencies": {
    "@types/jest": "^24.0.19",
    "@typescript-eslint/eslint-plugin": "^2.33.0",
    "@typescript-eslint/parser": "^2.33.0",
    "@vue/cli-plugin-babel": "~4.4.0",
    "@vue/cli-plugin-e2e-cypress": "~4.4.0",
    "@vue/cli-plugin-eslint": "~4.4.0",
    "@vue/cli-plugin-router": "~4.4.0",
    "@vue/cli-plugin-typescript": "~4.4.0",
    "@vue/cli-plugin-unit-jest": "~4.4.0",
    "@vue/cli-plugin-vuex": "~4.4.0",
    "@vue/cli-service": "~4.4.0",
    "@vue/compiler-sfc": "^3.0.0-beta.1",
    "@vue/eslint-config-prettier": "^6.0.0",
    "@vue/eslint-config-typescript": "^5.0.2",
    "@vue/test-utils": "^2.0.0-alpha.7",
    "eslint-plugin-prettier-vue": "^2.1.0",
    "eslint-plugin-vue": "next",
    "eslint-config-prettier": "^6.11.0",
    "eslint": "^6.7.2",
    "prettier": "^1.19.1",
    "lint-staged": "^9.5.0",
    "tailwindcss": "^1.4.6",
    "typescript": "~3.9.3",
    "vue-cli-plugin-vue-next": "~0.1.3"
  },

and eslintrc.js

module.exports = {
    root: true,
    env: {
        node: true
    },
    extends: [
        'eslint:recommended',
        'plugin:vue/vue3-recommended',
        'plugin:prettier-vue/recommended',
        '@vue/typescript/recommended',
        '@vue/prettier',
        '@vue/prettier/@typescript-eslint'
    ],
    parserOptions: {
        ecmaVersion: 2020
    },
    rules: {
        'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
        'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
        'vue/max-attributes-per-line': [
            'error',
            {
                singleline: 1,
                multiline: {
                    max: 1,
                    allowFirstLine: true
                }
            }
        ]
    },
    settings: {
        'prettier-vue': {
            SFCBlocks: {
                template: false
            }
        }
    },
    overrides: [
        {
            files: [
                '**/__tests__/*.{j,t}s?(x)',
                '**/tests/unit/**/*.spec.{j,t}s?(x)'
            ],
            env: {
                jest: true
            }
        }
    ]
}
meteorlxy commented 4 years ago

Sorry for delay. Could you please provide a reproduce repo?

shaneostonstowe commented 4 years ago

The repo in which the issue arises is a private one. I will attempt the replicate a basic vue-cli project this weekend and post a link here.

shaneostonstowe commented 4 years ago

@meteorlxy I have opened up my private repo by inviting you as a collaborator and created a branch with the plugins recommended by your documentation. This branch gets the same error noted in the issue above. Note that this is an experimental branch running Vue 2 RC4.

https://github.com/jrni-studio/vue-queuing/tree/eslint-plugin-prettier-vue-test

shaneostonstowe commented 4 years ago

Bump.....

meteorlxy commented 4 years ago

Note that this is an experimental branch running Vue 2 RC4.

I think it is Vue 3 RC4. This plugin does not support Vue 3 yet.

shaneostonstowe commented 4 years ago

When will it?

meteorlxy commented 4 years ago

I have released a pre-release version on next branch. You can try it and feedbacks welcome!