Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Definition for rule 'vue/singleline-html-element-content-newline' was not found #568

Closed
selinAnt0n opened this issue Aug 31, 2018 · 4 comments
Assignees

Comments

@selinAnt0n
Copy link

selinAnt0n commented Aug 31, 2018

ESLing ver - ^4.19.1
node ver - 6.0.0
eslint-plugin-vue - 5.0.0-beta.3

Rule:

module.exports = {
    root: true,
    env: {
        browser: true,
        node: true
    },
    globals: {
        __static: true
    },
    extends: [
        'plugin:vue/essential'
    ],
    rules: {
        'indent': 'off',
        'vue/html-quotes': ["error", 'double'],
        'vue/no-unused-vars': 'error',
        "vue/html-indent": ["error", 4, {
            "attribute": 1,
            "closeBracket": 0,
            "alignAttributesVertically": true,
            "ignores": []
        }],
        'vue/script-indent': ["error", 4, {
            "baseIndent": 1,
        }],
        "vue/max-attributes-per-line": ["error", {
            "singleline": 1,
            "multiline": 1,
        }],
        "vue/name-property-casing": ["error", "PascalCase"],
        'vue/mustache-interpolation-spacing': ["error", 'never'],
        'vue/no-duplicate-attributes': ["error", {
            'allowCoexistClass': true,
            'allowCoexistStyle': true,
        }],
        "vue/singleline-html-element-content-newline": ["error", {
            "ignoreWhenNoAttributes": true,
            "ignores": ["pre", "textarea"]
        }],
        "vue/html-closing-bracket-spacing": ["error", {
            "startTag": "never",
            "endTag": "never",
            "selfClosingTag": "always"
        }],
        "vue/component-name-in-template-casing": ["error",
            "PascalCase|kebab-case"
        ],
        'arrow-parens': 0,
        'generator-star-spacing': 0,
        'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0,
        'comma-dangle': ['error', {
            'arrays': 'always-multiline',
            'objects': 'always-multiline',
            'imports': 'always-multiline',
            'exports': 'always-multiline',
            'functions': 'always-multiline'
        }],
        'linebreak-style': ['error', 'unix'],
        'no-multiple-empty-lines': ['error', {
            'max': 1
        }]
    },
    "settings": {
        "html/html-extensions": [".html"],
    }
}

Component:

<template>
    <Tab
        :items="objects"
        :value.sync="correctTab"
        :slotMod="tabOptions.slotMod">
        <Photos slot="Photos" :type="userType" :overlay="isOverlay" :open="true" />
    </Tab>
</template>

All-time take error with - Definition for rule 'vue/singleline-html-element-content-newline' was not found. How can I fix it ?

@ota-meshi
Copy link
Member

vue/singleline-html-element-content-newline is a rule added in v5.0.0-beta.3.
If you want to use this rule please use v5.0.0-beta.3.

@ota-meshi
Copy link
Member

sorry. I made a mistake. You used v5.0.0-beta.3.

@ota-meshi
Copy link
Member

I did a test according to your settings, but it worked fine.
https://github.com/ota-meshi/eslint-plugin-vue-test
https://travis-ci.org/ota-meshi/eslint-plugin-vue-test/builds/423102253

  6:31  error  Attribute "bind" should be on a new line  vue/max-attributes-per-line
  6:48  error  Attribute "bind" should be on a new line  vue/max-attributes-per-line
  6:69  error  Attribute "bind" should be on a new line  vue/max-attributes-per-line

Please tell me if there is a difference between this repository and your environment.

@ota-meshi ota-meshi self-assigned this Aug 31, 2018
@michalsnik
Copy link
Member

Oh! I think I know what the problem might be here.
You probably use @vue/plugin-eslint aren't you @selinAnt0n ?
And when you run vue-cli-service lint it might try to use it's own version of eslint-plugin-vue, which is different than the beta you want to use know.

While you play with beta version of eslint-plugin-vue you might want to slightly change the lint script:

"lint": "eslint src --ext .js,.vue"

And in the meanwhile I'll also consider fixing @vue/plugin-eslint so it can properly resolve the right package.

I hope this will help you @selinAnt0n :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants