0.2.0 • Published 8 years ago

@mysticatea/eslint-plugin-vue v0.2.0

Weekly downloads
1
License
MIT
Repository
github
Last release
8 years ago

@mysticatea/eslint-plugin-vue

npm version Downloads/month Build Status Coverage Status Dependency Status

Experimental ESLint plugin for Vue.js.

💿 Installation

Use npm.

> npm install --save-dev eslint @mysticatea/eslint-plugin-vue
  • Requires Node.js ^4.0.0 || >=6.0.0
  • Requires ESLint >=3.18.0

📖 Usage

Write .eslintrc.* file to configure rules. See also: http://eslint.org/docs/user-guide/configuring

.eslintrc.json (An example)

{
    "plugins": ["@mysticatea/vue"],
    "extends": ["eslint:recommended", "plugin:@mysticatea/vue/recommended"],
    "rules": {
        "@mysticatea/vue/html-quotes": ["error", "double"],
        "@mysticatea/vue/v-bind-style": ["error", "shorthand"],
        "@mysticatea/vue/v-on-style": ["error", "shorthand"]
    }
}

💡 Rules

  • ⭐️ the mark of a recommended rule.
  • ✒️ the mark of a fixable rule.

Possible Errors

Rule IDDescription
⭐️no-invalid-template-rootdisallow invalid template root.
⭐️no-invalid-v-binddisallow invalid v-bind directives.
⭐️no-invalid-v-cloakdisallow invalid v-cloak directives.
⭐️no-invalid-v-else-ifdisallow invalid v-else-if directives.
⭐️no-invalid-v-elsedisallow invalid v-else directives.
⭐️no-invalid-v-fordisallow invalid v-for directives.
⭐️no-invalid-v-htmldisallow invalid v-html directives.
⭐️no-invalid-v-ifdisallow invalid v-if directives.
⭐️no-invalid-v-modeldisallow invalid v-model directives.
⭐️no-invalid-v-ondisallow invalid v-on directives.
⭐️no-invalid-v-oncedisallow invalid v-once directives.
⭐️no-invalid-v-predisallow invalid v-pre directives.
⭐️no-invalid-v-showdisallow invalid v-show directives.
⭐️no-invalid-v-textdisallow invalid v-text directives.
⭐️no-parsing-errordisallow parsing errors in <template>.

Best Practices

Rule IDDescription
⭐️✒️html-end-tagsenforce end tag style.
⭐️✒️html-no-self-closingdisallow self-closing elements.
⭐️no-confusing-v-for-v-ifdisallow confusing v-for and v-if on the same element.
⭐️no-duplicate-attributesdisallow duplicate arguments.
⭐️no-textarea-mustachedisallow mustaches in <textarea>.
⭐️require-component-isrequire v-bind:is of <component> elements.
⭐️require-v-for-keyrequire v-bind:key with v-for directives.

Stylistic Issues

Rule IDDescription
html-quotesenforce quotes style of HTML attributes.
✒️v-bind-styleenforce v-bind directive style.
✒️v-on-styleenforce v-on directive style.

⚙ Configs

This plugin provides plugin:@mysticatea/vue/recommended preset config. This preset config:

  • adds parser: "vue-eslint-parser"
  • enables rules which are given ⭐️ in the above table.

⚓️ Semantic Versioning Policy

@mysticatea/eslint-plugin-vue follows semantic versioning and ESLint's Semantic Versioning Policy.

  • Patch release (intended to not break your lint build)
    • A bug fix in a rule that results in it reporting fewer errors.
    • Improvements to documentation.
    • Non-user-facing changes such as refactoring code, adding, deleting, or modifying tests, and increasing test coverage.
    • Re-releasing after a failed release (i.e., publishing a release that doesn't work for anyone).
  • Minor release (might break your lint build)
    • A bug fix in a rule that results in it reporting more errors.
    • A new rule is created.
    • A new option to an existing rule is created.
    • An existing rule is deprecated.
  • Major release (likely to break your lint build)
    • A support for old Node version is dropped.
    • A support for old ESLint version is dropped.
    • An existing rule is changed in it reporting more errors.
    • An existing rule is removed.
    • An existing option of a rule is removed.
    • An existing config is updated.

📰 Changelog

💎 Contributing

Welcome contributing!

Please use GitHub's Issues/PRs.

Development Tools

  • npm test runs tests and measures coverage.
  • npm run coverage shows the coverage result of npm test command.
  • npm run clean removes the coverage result of npm test command.