GithubHelp home page GithubHelp logo

isabella232 / eslint-plugin-vue-scoped-css Goto Github PK

View Code? Open in Web Editor NEW

This project forked from future-architect/eslint-plugin-vue-scoped-css

0.0 0.0 0.0 4.36 MB

ESLint plugin for Scoped CSS in Vue.js

Home Page: https://future-architect.github.io/eslint-plugin-vue-scoped-css/

License: MIT License

JavaScript 0.61% TypeScript 90.23% Vue 9.00% Dockerfile 0.16%

eslint-plugin-vue-scoped-css's Introduction

eslint-plugin-vue-scoped-css

eslint-plugin-vue-scoped-css is ESLint plugin for Scoped CSS in Vue.js.

NPM license NPM version NPM downloads NPM downloads NPM downloads NPM downloads NPM downloads Build Status Coverage Status

Features

This ESLint plugin provides linting rules relate to better ways to help you avoid problems when using Scoped CSS in Vue.js.

  • Provides linting rules for Scoped CSS.
  • Supports CSS syntax including level 4 selectors.
  • Supports <style lang="scss">.
  • Supports <style lang="stylus">.
  • Parses <style>, <template> and <script> blocks.

You can check on the Online DEMO.

Documentation

See documents.

Installation

npm install --save-dev eslint eslint-plugin-vue-scoped-css

Requirements

  • ESLint v6.0.0 and above
  • Node.js v12.22.x, v14.17.x, v16.x and above

Usage

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

Example .eslintrc.js:

module.exports = {
  extends: [
    // add more generic rulesets here, such as:
    // 'eslint:recommended',
    'plugin:vue-scoped-css/vue3-recommended'
  ],
  rules: {
    // override/add rules settings here, such as:
    // 'vue-scoped-css/no-unused-selector': 'error'
  }
}

Configs

This plugin provides some predefined configs:

  • plugin:vue-scoped-css/base - Settings and rules to enable this plugin
  • plugin:vue-scoped-css/recommended - /base, plus rules for better ways to help you avoid problems for Vue.js 2.x
  • plugin:vue-scoped-css/vue3-recommended - /base, plus rules for better ways to help you avoid problems for Vue.js 3.x
  • plugin:vue-scoped-css/all - All rules of this plugin are included

Rules

The --fix option on the command line automatically fixes problems reported by rules which have a wrench ๐Ÿ”ง below.

Recommended for Vue.js 3.x

Enforce all the rules in this category with:

{
  "extends": "plugin:vue-scoped-css/vue3-recommended"
}
Rule ID Description
vue-scoped-css/enforce-style-type enforce the <style> tags to be plain or have the scoped or module attribute
vue-scoped-css/no-deprecated-deep-combinator disallow using deprecated deep combinators ๐Ÿ”ง
vue-scoped-css/no-parent-of-v-global disallow parent selector for ::v-global pseudo-element
vue-scoped-css/no-parsing-error disallow parsing errors in <style>
vue-scoped-css/no-unused-keyframes disallow @keyframes which don't use in Scoped CSS
vue-scoped-css/no-unused-selector disallow selectors defined in Scoped CSS that don't use in <template>
vue-scoped-css/require-v-deep-argument require selector argument to be passed to ::v-deep() ๐Ÿ”ง
vue-scoped-css/require-v-global-argument require selector argument to be passed to ::v-global()
vue-scoped-css/require-v-slotted-argument require selector argument to be passed to ::v-slotted()

Recommended for Vue.js 2.x

Enforce all the rules in this category with:

{
  "extends": "plugin:vue-scoped-css/recommended"
}
Rule ID Description
vue-scoped-css/enforce-style-type enforce the <style> tags to be plain or have the scoped or module attribute
vue-scoped-css/no-parsing-error disallow parsing errors in <style>
vue-scoped-css/no-unused-keyframes disallow @keyframes which don't use in Scoped CSS
vue-scoped-css/no-unused-selector disallow selectors defined in Scoped CSS that don't use in <template>

Uncategorized

No preset enables the rules in this category. Please enable each rule if you want.

For example:

{
  "rules": {
    "vue-scoped-css/no-deprecated-v-enter-v-leave-class": "error"
  }
}
Rule ID Description
vue-scoped-css/no-deprecated-v-enter-v-leave-class disallow v-enter and v-leave classes.
vue-scoped-css/require-selector-used-inside disallow selectors defined that is not used inside <template>

Deprecated

  • โš ๏ธ We're going to remove deprecated rules in the next major release. Please migrate to successor/new rules.
  • ๐Ÿ˜‡ We don't fix bugs which are in deprecated rules since we don't have enough resources.
Rule ID Replaced by
vue-scoped-css/require-scoped vue-scoped-css/enforce-style-type

Contributing

Welcome contributing!

Please use GitHub's Issues/PRs.

Development Tools

  • npm test runs tests and measures coverage.
  • npm run update runs in order to update readme and recommended configuration.

License

See the LICENSE file for license rights and limitations (MIT).

eslint-plugin-vue-scoped-css's People

Contributors

dependabot[bot] avatar ota-meshi avatar privatenumber avatar renovate-bot avatar renovate[bot] avatar simllll avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.