npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

eslint-plugin-vue-scoped-css

v2.9.0

Published

ESLint plugin for Scoped CSS in Vue.js

Downloads

299,137

Readme

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 vue-eslint-parser

Requirements

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

Usage

New Config (eslint.config.js)

Use eslint.config.js file to configure rules. See also: https://eslint.org/docs/latest/use/configure/configuration-files-new.

Example eslint.config.js:

import eslintPluginVueScopedCSS from 'eslint-plugin-vue-scoped-css';
export default [
  // add more generic rule sets here, such as:
  // js.configs.recommended,
  ...eslintPluginVueScopedCSS.configs['flat/recommended'],
  {
    rules: {
      // override/add rules settings here, such as:
      // 'vue-scoped-css/no-unused-selector': 'error'
    }
  }
];

Legacy Config (.eslintrc)

Use .eslintrc.* file to configure rules. See also: https://eslint.org/docs/latest/use/configure/.

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:

New Config (eslint.config.js)

  • *.configs['flat/base'] - Settings and rules to enable this plugin
  • *.configs['flat/recommended'] - /base, plus rules for better ways to help you avoid problems for Vue.js 3.x
  • *.configs['flat/vue2-recommended'] - /base, plus rules for better ways to help you avoid problems for Vue.js 2.x
  • *.configs['flat/all'] - All rules of this plugin are included

Legacy Config (.eslintrc)

  • 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 :wrench: below.

Recommended for Vue.js 3.x

Enforce all the rules in this category with:

export default [
  ...eslintPluginVueScopedCSS.configs['flat/recommended'],
]

or

{
  "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 | :wrench: | | 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() | :wrench: | | 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:

export default [
  ...eslintPluginVueScopedCSS.configs['flat/vue2-recommended'],
]

or

{
  "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> | | | vue-scoped-css/v-deep-pseudo-style | enforce :deep()/::v-deep() style | :wrench: | | vue-scoped-css/v-global-pseudo-style | enforce :global()/::v-global() style | :wrench: | | vue-scoped-css/v-slotted-pseudo-style | enforce :slotted()/::v-slotted() style | :wrench: |

Deprecated

  • :warning: We're going to remove deprecated rules in the next major release. Please migrate to successor/new rules.
  • :innocent: 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).