├── .changeset ├── README.md └── config.json ├── .devcontainer └── devcontainer.json ├── .github ├── FUNDING.yml └── workflows │ ├── GHPages.yml │ ├── NodeCI.yml │ ├── Release.yml │ ├── format.yml │ └── stale.yml ├── .gitignore ├── .npmrc ├── .vscode └── settings.json ├── CHANGELOG.md ├── LICENSE ├── README.md ├── docs ├── .vitepress │ ├── build-system │ │ ├── build.mts │ │ └── src │ │ │ ├── events.mjs │ │ │ └── vue-eslint-parser.mjs │ ├── config.mts │ ├── shim │ │ ├── module.mjs │ │ ├── safer-buffer.mjs │ │ └── sax.mjs │ ├── stylelint.config.js │ ├── theme │ │ ├── components │ │ │ ├── components │ │ │ │ ├── EslintPluginEditor.vue │ │ │ │ ├── PgEditor.vue │ │ │ │ ├── RulesSettings.vue │ │ │ │ └── SnsBar.vue │ │ │ ├── eslint-code-block.vue │ │ │ ├── playground-block.vue │ │ │ ├── rules │ │ │ │ └── index.js │ │ │ └── state │ │ │ │ ├── deserialize.js │ │ │ │ ├── index.js │ │ │ │ └── serialize.js │ │ ├── index.ts │ │ └── style.css │ └── vite-plugin.mjs ├── index.md ├── playground │ └── index.md ├── rules │ ├── enforce-style-type.md │ ├── index.md │ ├── no-deprecated-deep-combinator.md │ ├── no-deprecated-v-enter-v-leave-class.md │ ├── no-parent-of-v-global.md │ ├── no-parsing-error.md │ ├── no-unused-keyframes.md │ ├── no-unused-selector.md │ ├── require-scoped.md │ ├── require-selector-used-inside.md │ ├── require-v-deep-argument.md │ ├── require-v-global-argument.md │ ├── require-v-slotted-argument.md │ ├── v-deep-pseudo-style.md │ ├── v-global-pseudo-style.md │ └── v-slotted-pseudo-style.md └── user-guide │ └── index.md ├── eslint.config.mjs ├── lib ├── configs │ ├── all.ts │ ├── base.ts │ ├── flat │ │ ├── all.ts │ │ ├── base.ts │ │ ├── recommended.ts │ │ └── vue2-recommended.ts │ ├── recommended.ts │ └── vue3-recommended.ts ├── index.ts ├── options.ts ├── rules │ ├── enforce-style-type.ts │ ├── no-deprecated-deep-combinator.ts │ ├── no-deprecated-v-enter-v-leave-class.ts │ ├── no-parent-of-v-global.ts │ ├── no-parsing-error.ts │ ├── no-unused-keyframes.ts │ ├── no-unused-selector.ts │ ├── require-scoped.ts │ ├── require-selector-used-inside.ts │ ├── require-v-deep-argument.ts │ ├── require-v-global-argument.ts │ ├── require-v-slotted-argument.ts │ ├── v-deep-pseudo-style.ts │ ├── v-global-pseudo-style.ts │ └── v-slotted-pseudo-style.ts ├── styles │ ├── ast.ts │ ├── context │ │ ├── comment-directive │ │ │ └── index.ts │ │ ├── index.ts │ │ ├── style │ │ │ └── index.ts │ │ └── vue-components │ │ │ ├── find-vue.ts │ │ │ └── index.ts │ ├── parser │ │ ├── css-parser.ts │ │ ├── index.ts │ │ ├── scss-parser.ts │ │ ├── selector │ │ │ ├── css-selector-parser.ts │ │ │ ├── replace-utils.ts │ │ │ ├── scss-selector-parser.ts │ │ │ └── stylus-selector-parser.ts │ │ ├── stylus-parser.ts │ │ └── utils.ts │ ├── selectors │ │ ├── index.ts │ │ ├── query │ │ │ ├── attribute-tracker.ts │ │ │ ├── elements.ts │ │ │ ├── index.ts │ │ │ └── reference-expression.ts │ │ └── resolver │ │ │ ├── css-selector-resolver.ts │ │ │ ├── scss-selector-resolver.ts │ │ │ └── stylus-selector-resolver.ts │ ├── template │ │ ├── at-rule-params │ │ │ ├── css.ts │ │ │ ├── index.ts │ │ │ ├── scss.ts │ │ │ └── stylus.ts │ │ ├── decl-value │ │ │ ├── css.ts │ │ │ ├── index.ts │ │ │ ├── scss.ts │ │ │ └── stylus.ts │ │ ├── index.ts │ │ ├── interpolation.ts │ │ ├── scss │ │ │ └── util.ts │ │ ├── selector │ │ │ ├── css.ts │ │ │ ├── index.ts │ │ │ ├── scss.ts │ │ │ └── stylus.ts │ │ └── stylus │ │ │ └── util.ts │ └── utils │ │ ├── css-nodes.ts │ │ ├── index.ts │ │ ├── nodes.ts │ │ └── selectors.ts ├── types.ts └── utils │ ├── compat.ts │ ├── regexp.ts │ ├── rules.ts │ ├── templates.ts │ └── utils.ts ├── package-lock.json ├── package.json ├── renovate.json ├── tests ├── lib │ ├── comment-directives.ts │ ├── configs │ │ └── recommended.ts │ ├── rules-without-vue-eslint-parser.ts │ ├── rules │ │ ├── enforce-style-type.ts │ │ ├── no-deprecated-deep-combinator.ts │ │ ├── no-deprecated-v-enter-v-leave-class.ts │ │ ├── no-parent-of-v-global.ts │ │ ├── no-parsing-error.ts │ │ ├── no-unused-keyframes.ts │ │ ├── no-unused-selector.ts │ │ ├── require-scoped.ts │ │ ├── require-selector-used-inside.ts │ │ ├── require-v-deep-argument.ts │ │ ├── require-v-global-argument.ts │ │ ├── require-v-slotted-argument.ts │ │ ├── v-deep-pseudo-style.ts │ │ ├── v-global-pseudo-style.ts │ │ └── v-slotted-pseudo-style.ts │ ├── styles │ │ ├── fixtures │ │ │ ├── .eslintrc.js │ │ │ ├── index │ │ │ │ ├── @nest-concat01 │ │ │ │ │ ├── ast.json │ │ │ │ │ ├── selectors-text.json │ │ │ │ │ ├── selectors.json │ │ │ │ │ └── source.vue │ │ │ │ ├── @nest-concat02 │ │ │ │ │ ├── ast.json │ │ │ │ │ ├── selectors-text.json │ │ │ │ │ ├── selectors.json │ │ │ │ │ └── source.vue │ │ │ │ ├── @nest-concat03 │ │ │ │ │ ├── ast.json │ │ │ │ │ ├── selectors-text.json │ │ │ │ │ ├── selectors.json │ │ │ │ │ └── source.vue │ │ │ │ ├── @nest-concat04 │ │ │ │ │ ├── ast.json │ │ │ │ │ ├── selectors-text.json │ │ │ │ │ ├── selectors.json │ │ │ │ │ └── source.vue │ │ │ │ ├── @nest-deep01 │ │ │ │ │ ├── ast.json │ │ │ │ │ ├── selectors-text.json │ │ │ │ │ ├── selectors.json │ │ │ │ │ └── source.vue │ │ │ │ ├── @nest-invalid01 │ │ │ │ │ ├── ast.json │ │ │ │ │ ├── selectors-text.json │ │ │ │ │ ├── selectors.json │ │ │ │ │ └── source.vue │ │ │ │ ├── @nest01 │ │ │ │ │ ├── ast.json │ │ │ │ │ ├── selectors-text.json │ │ │ │ │ ├── selectors.json │ │ │ │ │ └── source.vue │ │ │ │ ├── @nest02 │ │ │ │ │ ├── ast.json │ │ │ │ │ ├── selectors-text.json │ │ │ │ │ ├── selectors.json │ │ │ │ │ └── source.vue │ │ │ │ ├── @nest03 │ │ │ │ │ ├── ast.json │ │ │ │ │ ├── selectors-text.json │ │ │ │ │ ├── selectors.json │ │ │ │ │ └── source.vue │ │ │ │ ├── attribute01 │ │ │ │ │ ├── ast.json │ │ │ │ │ ├── selectors-text.json │ │ │ │ │ ├── selectors.json │ │ │ │ │ └── source.vue │ │ │ │ ├── attribute02 │ │ │ │ │ ├── ast.json │ │ │ │ │ ├── selectors-text.json │ │ │ │ │ ├── selectors.json │ │ │ │ │ └── source.vue │ │ │ │ ├── decl01 │ │ │ │ │ ├── ast.json │ │ │ │ │ ├── selectors-text.json │ │ │ │ │ ├── selectors.json │ │ │ │ │ └── source.vue │ │ │ │ ├── decl02 │ │ │ │ │ ├── ast.json │ │ │ │ │ ├── selectors-text.json │ │ │ │ │ ├── selectors.json │ │ │ │ │ └── source.vue │ │ │ │ ├── decl03 │ │ │ │ │ ├── ast.json │ │ │ │ │ ├── selectors-text.json │ │ │ │ │ ├── selectors.json │ │ │ │ │ └── source.vue │ │ │ │ ├── decl04 │ │ │ │ │ ├── ast.json │ │ │ │ │ ├── selectors-text.json │ │ │ │ │ ├── selectors.json │ │ │ │ │ └── source.vue │ │ │ │ ├── keyframes │ │ │ │ │ ├── ast.json │ │ │ │ │ ├── selectors-text.json │ │ │ │ │ ├── selectors.json │ │ │ │ │ └── source.vue │ │ │ │ ├── nest-invalid01 │ │ │ │ │ ├── ast.json │ │ │ │ │ ├── selectors-text.json │ │ │ │ │ ├── selectors.json │ │ │ │ │ └── source.vue │ │ │ │ ├── nest-scss-deep │ │ │ │ │ ├── ast.json │ │ │ │ │ ├── selectors-text.json │ │ │ │ │ ├── selectors.json │ │ │ │ │ └── source.vue │ │ │ │ ├── nest-scss01 │ │ │ │ │ ├── ast.json │ │ │ │ │ ├── selectors-text.json │ │ │ │ │ ├── selectors.json │ │ │ │ │ └── source.vue │ │ │ │ ├── nest-scss02 │ │ │ │ │ ├── ast.json │ │ │ │ │ ├── selectors-text.json │ │ │ │ │ ├── selectors.json │ │ │ │ │ └── source.vue │ │ │ │ ├── nest01 │ │ │ │ │ ├── ast.json │ │ │ │ │ ├── selectors-text.json │ │ │ │ │ ├── selectors.json │ │ │ │ │ └── source.vue │ │ │ │ ├── pseudo01 │ │ │ │ │ ├── ast.json │ │ │ │ │ ├── selectors-text.json │ │ │ │ │ ├── selectors.json │ │ │ │ │ └── source.vue │ │ │ │ ├── pseudo02 │ │ │ │ │ ├── ast.json │ │ │ │ │ ├── selectors-text.json │ │ │ │ │ ├── selectors.json │ │ │ │ │ └── source.vue │ │ │ │ ├── pseudo03 │ │ │ │ │ ├── ast.json │ │ │ │ │ ├── selectors-text.json │ │ │ │ │ ├── selectors.json │ │ │ │ │ └── source.vue │ │ │ │ ├── pseudo04 │ │ │ │ │ ├── ast.json │ │ │ │ │ ├── selectors-text.json │ │ │ │ │ ├── selectors.json │ │ │ │ │ └── source.vue │ │ │ │ ├── pseudo05 │ │ │ │ │ ├── ast.json │ │ │ │ │ ├── selectors-text.json │ │ │ │ │ ├── selectors.json │ │ │ │ │ └── source.vue │ │ │ │ ├── scss-comment01 │ │ │ │ │ ├── ast.json │ │ │ │ │ ├── selectors-text.json │ │ │ │ │ ├── selectors.json │ │ │ │ │ └── source.vue │ │ │ │ ├── scss-comment02 │ │ │ │ │ ├── ast.json │ │ │ │ │ ├── selectors-text.json │ │ │ │ │ ├── selectors.json │ │ │ │ │ └── source.vue │ │ │ │ ├── scss-comment03-in-selector │ │ │ │ │ ├── ast.json │ │ │ │ │ ├── selectors-text.json │ │ │ │ │ ├── selectors.json │ │ │ │ │ └── source.vue │ │ │ │ ├── scss-comment04-in-selector │ │ │ │ │ ├── ast.json │ │ │ │ │ ├── selectors-text.json │ │ │ │ │ ├── selectors.json │ │ │ │ │ └── source.vue │ │ │ │ ├── scss-interpolation01-selector │ │ │ │ │ ├── ast.json │ │ │ │ │ ├── selectors-text.json │ │ │ │ │ ├── selectors.json │ │ │ │ │ └── source.vue │ │ │ │ ├── scss-nest-concat01 │ │ │ │ │ ├── ast.json │ │ │ │ │ ├── selectors-text.json │ │ │ │ │ ├── selectors.json │ │ │ │ │ └── source.vue │ │ │ │ ├── scss-sample01 │ │ │ │ │ ├── ast.json │ │ │ │ │ ├── selectors-text.json │ │ │ │ │ ├── selectors.json │ │ │ │ │ └── source.vue │ │ │ │ ├── selector01 │ │ │ │ │ ├── ast.json │ │ │ │ │ ├── selectors-text.json │ │ │ │ │ ├── selectors.json │ │ │ │ │ └── source.vue │ │ │ │ ├── string │ │ │ │ │ ├── ast.json │ │ │ │ │ ├── selectors-text.json │ │ │ │ │ ├── selectors.json │ │ │ │ │ └── source.vue │ │ │ │ ├── stylus-@nest01 │ │ │ │ │ ├── ast.json │ │ │ │ │ ├── selectors-text.json │ │ │ │ │ ├── selectors.json │ │ │ │ │ └── source.vue │ │ │ │ ├── stylus-comments01 │ │ │ │ │ ├── ast.json │ │ │ │ │ ├── selectors-text.json │ │ │ │ │ ├── selectors.json │ │ │ │ │ └── source.vue │ │ │ │ ├── stylus-comments02-in-selector │ │ │ │ │ ├── ast.json │ │ │ │ │ ├── selectors-text.json │ │ │ │ │ ├── selectors.json │ │ │ │ │ └── source.vue │ │ │ │ ├── stylus-nesting01 │ │ │ │ │ ├── ast.json │ │ │ │ │ ├── selectors-text.json │ │ │ │ │ ├── selectors.json │ │ │ │ │ └── source.vue │ │ │ │ ├── stylus-nesting02-comb │ │ │ │ │ ├── ast.json │ │ │ │ │ ├── selectors-text.json │ │ │ │ │ ├── selectors.json │ │ │ │ │ └── source.vue │ │ │ │ ├── stylus-selector01-ruleset │ │ │ │ │ ├── ast.json │ │ │ │ │ ├── selectors-text.json │ │ │ │ │ ├── selectors.json │ │ │ │ │ └── source.vue │ │ │ │ ├── stylus-selector02-parent-ref │ │ │ │ │ ├── ast.json │ │ │ │ │ ├── selectors-text.json │ │ │ │ │ ├── selectors.json │ │ │ │ │ └── source.vue │ │ │ │ ├── stylus-selector03-partial-ref │ │ │ │ │ ├── ast.json │ │ │ │ │ ├── selectors-text.json │ │ │ │ │ ├── selectors.json │ │ │ │ │ └── source.vue │ │ │ │ ├── stylus-selector04-partial-ref-minus │ │ │ │ │ ├── ast.json │ │ │ │ │ ├── selectors-text.json │ │ │ │ │ ├── selectors.json │ │ │ │ │ └── source.vue │ │ │ │ ├── stylus-selector05-range-partial-ref │ │ │ │ │ ├── ast.json │ │ │ │ │ ├── selectors-text.json │ │ │ │ │ ├── selectors.json │ │ │ │ │ └── source.vue │ │ │ │ ├── stylus-selector06-range-partial-ref │ │ │ │ │ ├── ast.json │ │ │ │ │ ├── selectors-text.json │ │ │ │ │ ├── selectors.json │ │ │ │ │ └── source.vue │ │ │ │ ├── stylus-selector07-initial-ref │ │ │ │ │ ├── ast.json │ │ │ │ │ ├── selectors-text.json │ │ │ │ │ ├── selectors.json │ │ │ │ │ └── source.vue │ │ │ │ ├── stylus-selector08-relative-ref │ │ │ │ │ ├── ast.json │ │ │ │ │ ├── selectors-text.json │ │ │ │ │ ├── selectors.json │ │ │ │ │ └── source.vue │ │ │ │ ├── stylus-selector09-root-ref │ │ │ │ │ ├── ast.json │ │ │ │ │ ├── selectors-text.json │ │ │ │ │ ├── selectors.json │ │ │ │ │ └── source.vue │ │ │ │ ├── stylus01 │ │ │ │ │ ├── ast.json │ │ │ │ │ ├── selectors-text.json │ │ │ │ │ ├── selectors.json │ │ │ │ │ └── source.vue │ │ │ │ ├── stylus02 │ │ │ │ │ ├── ast.json │ │ │ │ │ ├── selectors-text.json │ │ │ │ │ ├── selectors.json │ │ │ │ │ └── source.vue │ │ │ │ ├── stylus03 │ │ │ │ │ ├── ast.json │ │ │ │ │ ├── selectors-text.json │ │ │ │ │ ├── selectors.json │ │ │ │ │ └── source.vue │ │ │ │ ├── stylus04 │ │ │ │ │ ├── ast.json │ │ │ │ │ ├── selectors-text.json │ │ │ │ │ ├── selectors.json │ │ │ │ │ └── source.vue │ │ │ │ ├── stylus05 │ │ │ │ │ ├── ast.json │ │ │ │ │ ├── selectors-text.json │ │ │ │ │ ├── selectors.json │ │ │ │ │ └── source.vue │ │ │ │ ├── stylus06 │ │ │ │ │ ├── ast.json │ │ │ │ │ ├── selectors-text.json │ │ │ │ │ ├── selectors.json │ │ │ │ │ └── source.vue │ │ │ │ ├── syntax-error01 │ │ │ │ │ ├── ast.json │ │ │ │ │ ├── selectors-text.json │ │ │ │ │ ├── selectors.json │ │ │ │ │ └── source.vue │ │ │ │ ├── test01 │ │ │ │ │ ├── ast.json │ │ │ │ │ ├── selectors-text.json │ │ │ │ │ ├── selectors.json │ │ │ │ │ └── source.vue │ │ │ │ ├── test02 │ │ │ │ │ ├── ast.json │ │ │ │ │ ├── selectors-text.json │ │ │ │ │ ├── selectors.json │ │ │ │ │ └── source.vue │ │ │ │ ├── test03 │ │ │ │ │ ├── ast.json │ │ │ │ │ ├── selectors-text.json │ │ │ │ │ ├── selectors.json │ │ │ │ │ └── source.vue │ │ │ │ ├── test04 │ │ │ │ │ ├── ast.json │ │ │ │ │ ├── selectors-text.json │ │ │ │ │ ├── selectors.json │ │ │ │ │ └── source.vue │ │ │ │ ├── test05 │ │ │ │ │ ├── ast.json │ │ │ │ │ ├── selectors-text.json │ │ │ │ │ ├── selectors.json │ │ │ │ │ └── source.vue │ │ │ │ ├── universal │ │ │ │ │ ├── ast.json │ │ │ │ │ ├── selectors-text.json │ │ │ │ │ ├── selectors.json │ │ │ │ │ └── source.vue │ │ │ │ └── v-deep01 │ │ │ │ │ ├── ast.json │ │ │ │ │ ├── selectors-text.json │ │ │ │ │ ├── selectors.json │ │ │ │ │ └── source.vue │ │ │ └── selectors │ │ │ │ └── query │ │ │ │ ├── adjacent-sibling01 │ │ │ │ ├── query-result.json │ │ │ │ └── source.vue │ │ │ │ ├── bind-class-expression01 │ │ │ │ ├── query-result.json │ │ │ │ └── source.vue │ │ │ │ ├── bind-class-expression02 │ │ │ │ ├── query-result.json │ │ │ │ └── source.vue │ │ │ │ ├── bind-class01 │ │ │ │ ├── query-result.json │ │ │ │ └── source.vue │ │ │ │ ├── bind-class02 │ │ │ │ ├── query-result.json │ │ │ │ └── source.vue │ │ │ │ ├── bind-class03 │ │ │ │ ├── query-result.json │ │ │ │ └── source.vue │ │ │ │ ├── bind-class04 │ │ │ │ ├── query-result.json │ │ │ │ └── source.vue │ │ │ │ ├── bind-class05 │ │ │ │ ├── query-result.json │ │ │ │ └── source.vue │ │ │ │ ├── bind-class06 │ │ │ │ ├── query-result.json │ │ │ │ └── source.vue │ │ │ │ ├── bind-id01 │ │ │ │ ├── query-result.json │ │ │ │ └── source.vue │ │ │ │ ├── bind-id02 │ │ │ │ ├── query-result.json │ │ │ │ └── source.vue │ │ │ │ ├── bind-id03 │ │ │ │ ├── query-result.json │ │ │ │ └── source.vue │ │ │ │ ├── class-attr01 │ │ │ │ ├── query-result.json │ │ │ │ └── source.vue │ │ │ │ ├── component-tag01 │ │ │ │ ├── query-result.json │ │ │ │ └── source.vue │ │ │ │ ├── deep01 │ │ │ │ ├── query-result.json │ │ │ │ └── source.vue │ │ │ │ ├── general-sibling01 │ │ │ │ ├── query-result.json │ │ │ │ └── source.vue │ │ │ │ ├── id-attr01 │ │ │ │ ├── query-result.json │ │ │ │ └── source.vue │ │ │ │ ├── js-classlist01 │ │ │ │ ├── query-result.json │ │ │ │ └── source.vue │ │ │ │ ├── js-classlist02 │ │ │ │ ├── query-result.json │ │ │ │ └── source.vue │ │ │ │ ├── js-classlist03 │ │ │ │ ├── query-result.json │ │ │ │ └── source.vue │ │ │ │ ├── js-classlist04 │ │ │ │ ├── query-result.json │ │ │ │ └── source.vue │ │ │ │ ├── js-classlist05 │ │ │ │ ├── query-result.json │ │ │ │ └── source.vue │ │ │ │ ├── js-comcat-literal01 │ │ │ │ ├── query-result.json │ │ │ │ └── source.vue │ │ │ │ ├── js-template-literal01 │ │ │ │ ├── query-result.json │ │ │ │ └── source.vue │ │ │ │ ├── scss-interpolation01-selector │ │ │ │ ├── query-result.json │ │ │ │ └── source.vue │ │ │ │ ├── scss-interpolation02-selector-and-template │ │ │ │ ├── query-result.json │ │ │ │ └── source.vue │ │ │ │ ├── slot-tag01 │ │ │ │ ├── query-result.json │ │ │ │ └── source.vue │ │ │ │ ├── stylus-interpolation01-selector │ │ │ │ ├── query-result.json │ │ │ │ └── source.vue │ │ │ │ ├── template-tag01 │ │ │ │ ├── query-result.json │ │ │ │ └── source.vue │ │ │ │ ├── test01 │ │ │ │ ├── query-result.json │ │ │ │ └── source.vue │ │ │ │ ├── test02 │ │ │ │ ├── query-result.json │ │ │ │ └── source.vue │ │ │ │ ├── test03 │ │ │ │ ├── query-result.json │ │ │ │ └── source.vue │ │ │ │ ├── test04 │ │ │ │ ├── query-result.json │ │ │ │ └── source.vue │ │ │ │ ├── test05 │ │ │ │ ├── query-result.json │ │ │ │ └── source.vue │ │ │ │ ├── test06 │ │ │ │ ├── query-result.json │ │ │ │ └── source.vue │ │ │ │ ├── universal01 │ │ │ │ ├── query-result.json │ │ │ │ └── source.vue │ │ │ │ ├── v-deep01 │ │ │ │ ├── query-result.json │ │ │ │ └── source.vue │ │ │ │ ├── v-global01 │ │ │ │ ├── query-result.json │ │ │ │ ├── reverse-query-result.json │ │ │ │ └── source.vue │ │ │ │ ├── v-slotted01 │ │ │ │ ├── query-result.json │ │ │ │ └── source.vue │ │ │ │ ├── vue-computed01 │ │ │ │ ├── query-result.json │ │ │ │ └── source.vue │ │ │ │ ├── vue-computed02 │ │ │ │ ├── query-result.json │ │ │ │ └── source.vue │ │ │ │ ├── vue-computed03 │ │ │ │ ├── query-result.json │ │ │ │ └── source.vue │ │ │ │ ├── vue-computed04 │ │ │ │ ├── query-result.json │ │ │ │ └── source.vue │ │ │ │ ├── vue-computed05 │ │ │ │ ├── query-result.json │ │ │ │ └── source.vue │ │ │ │ ├── vue-computed06 │ │ │ │ ├── query-result.json │ │ │ │ └── source.vue │ │ │ │ ├── vue-computed07 │ │ │ │ ├── query-result.json │ │ │ │ └── source.vue │ │ │ │ ├── vue-computed08 │ │ │ │ ├── query-result.json │ │ │ │ └── source.vue │ │ │ │ ├── vue-computed09 │ │ │ │ ├── query-result.json │ │ │ │ └── source.vue │ │ │ │ ├── vue-computed10-trace-identifier │ │ │ │ ├── query-result.json │ │ │ │ └── source.vue │ │ │ │ ├── vue-computed11-computed-string │ │ │ │ ├── query-result.json │ │ │ │ └── source.vue │ │ │ │ ├── vue-computed12-spread-array │ │ │ │ ├── query-result.json │ │ │ │ └── source.vue │ │ │ │ ├── vue-data01 │ │ │ │ ├── query-result.json │ │ │ │ └── source.vue │ │ │ │ ├── vue-data02 │ │ │ │ ├── query-result.json │ │ │ │ └── source.vue │ │ │ │ ├── vue-data03 │ │ │ │ ├── query-result.json │ │ │ │ └── source.vue │ │ │ │ ├── vue-data04 │ │ │ │ ├── query-result.json │ │ │ │ └── source.vue │ │ │ │ ├── vue-data05 │ │ │ │ ├── query-result.json │ │ │ │ └── source.vue │ │ │ │ ├── vue-data06 │ │ │ │ ├── query-result.json │ │ │ │ └── source.vue │ │ │ │ ├── vue-data07 │ │ │ │ ├── query-result.json │ │ │ │ └── source.vue │ │ │ │ ├── vue-data08 │ │ │ │ ├── query-result.json │ │ │ │ └── source.vue │ │ │ │ ├── vue-data09 │ │ │ │ ├── query-result.json │ │ │ │ └── source.vue │ │ │ │ ├── vue-data10 │ │ │ │ ├── query-result.json │ │ │ │ └── source.vue │ │ │ │ ├── vue-transition-group01 │ │ │ │ ├── query-result.json │ │ │ │ └── source.vue │ │ │ │ ├── vue-transition01 │ │ │ │ ├── query-result.json │ │ │ │ └── source.vue │ │ │ │ ├── vue-transition02 │ │ │ │ ├── query-result.json │ │ │ │ └── source.vue │ │ │ │ ├── vue-transition03 │ │ │ │ ├── query-result.json │ │ │ │ └── source.vue │ │ │ │ ├── vue-transition04 │ │ │ │ ├── query-result.json │ │ │ │ └── source.vue │ │ │ │ ├── vue-transition05 │ │ │ │ ├── query-result.json │ │ │ │ └── source.vue │ │ │ │ ├── vue-transition06 │ │ │ │ ├── query-result.json │ │ │ │ └── source.vue │ │ │ │ └── vue-transition07 │ │ │ │ ├── query-result.json │ │ │ │ └── source.vue │ │ ├── parser │ │ │ └── index.ts │ │ ├── selectors │ │ │ ├── index.ts │ │ │ └── query.ts │ │ └── test-utils.ts │ ├── test-lib │ │ └── eslint-compat.ts │ └── utils │ │ └── rules.ts └── regressions │ └── reporter.ts ├── tools ├── lib │ ├── categories.ts │ ├── load-configs.ts │ └── load-rules.ts ├── new-rule.ts ├── render-rules.ts ├── update-docs-rules-index.ts ├── update-docs.ts ├── update-readme.ts ├── update-rules.ts └── update.ts ├── tsconfig.build.json ├── tsconfig.json └── typings ├── @eslint-community └── eslint-utils │ └── index.d.ts ├── eslint-scope └── index.d.ts ├── postcss-safe-parser └── index.d.ts ├── postcss-scss └── index.d.ts └── postcss-styl └── index.d.ts /.changeset/README.md: -------------------------------------------------------------------------------- 1 | # Changesets 2 | 3 | Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works 4 | with multi-package repos, or single-package repos to help you version and publish your code. You can 5 | find the full documentation for it [in our repository](https://github.com/changesets/changesets) 6 | 7 | We have a quick list of common questions to get you started engaging with this project in 8 | [our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md) 9 | -------------------------------------------------------------------------------- /.changeset/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://unpkg.com/@changesets/config/schema.json", 3 | "changelog": [ 4 | "@svitejs/changesets-changelog-github-compact", 5 | { 6 | "repo": "future-architect/eslint-plugin-vue-scoped-css" 7 | } 8 | ], 9 | "commit": false, 10 | "linked": [], 11 | "access": "public", 12 | "baseBranch": "master", 13 | "updateInternalDependencies": "patch", 14 | "bumpVersionsWithWorkspaceProtocolOnly": true, 15 | "ignore": [] 16 | } 17 | -------------------------------------------------------------------------------- /.devcontainer/devcontainer.json: -------------------------------------------------------------------------------- 1 | // For format details, see https://aka.ms/devcontainer.json. For config options, see the 2 | // README at: https://github.com/devcontainers/templates/tree/main/src/typescript-node 3 | { 4 | "name": "Node.js & TypeScript", 5 | // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile 6 | "image": "mcr.microsoft.com/devcontainers/typescript-node:1-18", 7 | 8 | // Features to add to the dev container. More info: https://containers.dev/features. 9 | // "features": {}, 10 | 11 | // Use 'forwardPorts' to make a list of ports inside the container available locally. 12 | // "forwardPorts": [], 13 | 14 | // Use 'postCreateCommand' to run commands after the container is created. 15 | "postCreateCommand": "npm install" 16 | 17 | // Configure tool-specific properties. 18 | // "customizations": {}, 19 | 20 | // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. 21 | // "remoteUser": "root" 22 | } 23 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: ota-meshi 4 | -------------------------------------------------------------------------------- /.github/workflows/GHPages.yml: -------------------------------------------------------------------------------- 1 | name: GHPages 2 | 3 | on: 4 | push: 5 | branches: [master] 6 | workflow_dispatch: null 7 | 8 | # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages 9 | permissions: 10 | contents: read 11 | pages: write 12 | id-token: write 13 | 14 | # Allow one concurrent deployment 15 | concurrency: 16 | group: pages 17 | cancel-in-progress: true 18 | 19 | jobs: 20 | deploy: 21 | environment: 22 | name: github-pages 23 | url: ${{ steps.deployment.outputs.page_url }} 24 | runs-on: ubuntu-latest 25 | steps: 26 | - name: Checkout 27 | uses: actions/checkout@v4 28 | - uses: actions/setup-node@v4 29 | - name: Install Packages 30 | run: npm install 31 | - name: Build docs 32 | run: npm run docs:build 33 | - name: Setup Pages 34 | uses: actions/configure-pages@v5 35 | - name: Upload artifact 36 | uses: actions/upload-pages-artifact@v3 37 | with: 38 | path: ./docs/.vitepress/dist/eslint-plugin-vue-scoped-css 39 | - name: Deploy to GitHub Pages 40 | id: deployment 41 | uses: actions/deploy-pages@v4 42 | -------------------------------------------------------------------------------- /.github/workflows/Release.yml: -------------------------------------------------------------------------------- 1 | name: Release 2 | 3 | on: 4 | push: 5 | branches: 6 | - master 7 | 8 | jobs: 9 | release: 10 | name: Release 11 | runs-on: ubuntu-latest 12 | steps: 13 | - name: Checkout Repo 14 | uses: actions/checkout@v4 15 | with: 16 | # This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits 17 | fetch-depth: 0 18 | 19 | - name: Setup Node.js 20 | uses: actions/setup-node@v4 21 | 22 | - name: Install Dependencies 23 | run: npm install 24 | 25 | - name: Create Release Pull Request or Publish to npm 26 | id: changesets 27 | uses: changesets/action@v1 28 | with: 29 | # this expects you to have a npm script called version that runs some logic and then calls `changeset version`. 30 | version: npm run version:ci 31 | # This expects you to have a script called release which does a build for your packages and calls changeset publish 32 | publish: npm run release 33 | commit: "chore: release eslint-plugin-vue-scoped-css" 34 | title: "chore: release eslint-plugin-vue-scoped-css" 35 | env: 36 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 37 | NPM_TOKEN: ${{ secrets.NPM_TOKEN }} 38 | -------------------------------------------------------------------------------- /.github/workflows/format.yml: -------------------------------------------------------------------------------- 1 | name: 👔 Format 2 | 3 | on: 4 | workflow_dispatch: null 5 | 6 | jobs: 7 | format: 8 | runs-on: ubuntu-latest 9 | 10 | steps: 11 | - name: Checkout repo 12 | uses: actions/checkout@v4 13 | - name: Setup node 14 | uses: actions/setup-node@v4 15 | - name: Install deps 16 | run: npm install 17 | - name: Format 18 | run: npm run eslint-fix 19 | - name: Commit 20 | run: | 21 | git config --local user.email "github-actions[bot]@users.noreply.github.com" 22 | git config --local user.name "github-actions[bot]" 23 | 24 | git add . 25 | if [ -z "$(git status --porcelain)" ]; then 26 | echo "no formatting changed" 27 | exit 0 28 | fi 29 | git commit -m "chore: format" 30 | git push 31 | echo "pushed formatting changes https://github.com/$GITHUB_REPOSITORY/commit/$(git rev-parse HEAD)" 32 | -------------------------------------------------------------------------------- /.github/workflows/stale.yml: -------------------------------------------------------------------------------- 1 | name: Close stale issues and PRs 2 | on: 3 | schedule: 4 | - cron: "30 1 * * *" 5 | 6 | permissions: 7 | issues: write 8 | pull-requests: write 9 | 10 | jobs: 11 | stale: 12 | if: github.repository == 'future-architect/eslint-plugin-vue-scoped-css' 13 | name: Close stale issues with missing information 14 | runs-on: ubuntu-latest 15 | steps: 16 | - uses: actions/stale@v9 17 | with: 18 | any-of-labels: "needs repro,needs info,needs more info" 19 | days-before-stale: 60 20 | days-before-close: 14 21 | stale-issue-message: This issue is is stale because it missing information and has been open for 60 days with no activity. 22 | stale-pr-message: This PR is is stale because it missing information and has been open for 60 days with no activity. 23 | close-issue-message: > 24 | This issue has been automatically closed because we haven't received a 25 | response from the original author 🙈. This automation helps keep the issue 26 | tracker clean from issues that aren't actionable. Please reach out if you 27 | have more information for us! 🙂 28 | close-pr-message: > 29 | This PR has been automatically closed because we haven't received a 30 | response from the original author 🙈. This automation helps keep the issue 31 | tracker clean from PRs that aren't actionable. Please reach out if you 32 | have more information for us! 🙂 33 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /node_modules 2 | /docs/.vitepress/dist 3 | /docs/.vitepress/cache 4 | /docs/.vitepress/build-system/shim 5 | /dist 6 | /.nyc_output 7 | /coverage 8 | 9 | # gh-pages 10 | /assets 11 | /rules 12 | /playground 13 | /user-guide 14 | /404.html 15 | /index.html 16 | -------------------------------------------------------------------------------- /.npmrc: -------------------------------------------------------------------------------- 1 | force=true -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "eslint.validate": [ 3 | "javascript", 4 | "javascriptreact", 5 | "vue", 6 | "typescript", 7 | "json", 8 | "jsonc", 9 | "yaml" 10 | ], 11 | "typescript.validate.enable": true, 12 | "javascript.validate.enable": false, 13 | "vetur.validation.script": false, 14 | "vetur.validation.style": false, 15 | "css.validate": false, 16 | "typescript.tsdk": "node_modules/typescript/lib", 17 | "editor.codeActionsOnSave": { 18 | "source.fixAll.eslint": "explicit", 19 | "source.fixAll.stylelint": "explicit" 20 | }, 21 | "editor.codeActionsOnSaveTimeout": 7500, 22 | "stylelint.validate": [ 23 | "css", 24 | "html", 25 | "less", 26 | "postcss", 27 | "sass", 28 | "scss", 29 | "vue", 30 | "vue-html", 31 | "vue-postcss", 32 | "stylus" 33 | ] 34 | } 35 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 Yosuke Ota 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /docs/.vitepress/build-system/src/events.mjs: -------------------------------------------------------------------------------- 1 | import all from "events"; 2 | export default all; 3 | export const EventEmitter = all.EventEmitter; 4 | -------------------------------------------------------------------------------- /docs/.vitepress/build-system/src/vue-eslint-parser.mjs: -------------------------------------------------------------------------------- 1 | import all from "vue-eslint-parser"; 2 | export default all; 3 | export const parseForESLint = all.parseForESLint; 4 | export const AST = all.AST; 5 | -------------------------------------------------------------------------------- /docs/.vitepress/shim/module.mjs: -------------------------------------------------------------------------------- 1 | export function createRequire() { 2 | // noop 3 | } 4 | export default { 5 | createRequire, 6 | }; 7 | -------------------------------------------------------------------------------- /docs/.vitepress/shim/safer-buffer.mjs: -------------------------------------------------------------------------------- 1 | export {}; 2 | -------------------------------------------------------------------------------- /docs/.vitepress/shim/sax.mjs: -------------------------------------------------------------------------------- 1 | export {}; 2 | -------------------------------------------------------------------------------- /docs/.vitepress/stylelint.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | extends: ["stylelint-config-standard-vue"], 3 | rules: { 4 | "no-descending-specificity": null, 5 | "selector-class-pattern": null, 6 | "value-keyword-case": null, 7 | 8 | // Conflict with Prettier 9 | indentation: null, 10 | }, 11 | }; 12 | -------------------------------------------------------------------------------- /docs/.vitepress/theme/components/components/PgEditor.vue: -------------------------------------------------------------------------------- 1 | 12 | 13 | 36 | -------------------------------------------------------------------------------- /docs/.vitepress/theme/components/state/deserialize.js: -------------------------------------------------------------------------------- 1 | import * as pako from "pako"; 2 | 3 | /** 4 | * Deserialize a given serialized string then update this object. 5 | * @param {string} serializedString A serialized string. 6 | * @returns {object} The deserialized state. 7 | */ 8 | export function deserializeState(serializedString) { 9 | const state = { 10 | code: undefined, 11 | rules: undefined, 12 | }; 13 | 14 | if (serializedString === "") { 15 | return state; 16 | } 17 | 18 | try { 19 | const decodedText = window.atob(serializedString); 20 | const jsonText = pako.inflate( 21 | Uint8Array.from(decodedText, (c) => c.charCodeAt(0)), 22 | { to: "string" }, 23 | ); 24 | const json = JSON.parse(jsonText); 25 | 26 | if (typeof json === "object" && json != null) { 27 | if (typeof json.code === "string") { 28 | state.code = json.code; 29 | } 30 | if (typeof json.rules === "object" && json.rules != null) { 31 | state.rules = {}; 32 | for (const id of Object.keys(json.rules)) { 33 | state.rules[id] = json.rules[id] === 2 ? "error" : "off"; 34 | } 35 | } 36 | } 37 | } catch (error) { 38 | //eslint-disable-next-line no-console -- demo 39 | console.error(error); 40 | } 41 | 42 | return state; 43 | } 44 | -------------------------------------------------------------------------------- /docs/.vitepress/theme/components/state/index.js: -------------------------------------------------------------------------------- 1 | export * from "./deserialize.js"; 2 | export * from "./serialize.js"; 3 | -------------------------------------------------------------------------------- /docs/.vitepress/theme/components/state/serialize.js: -------------------------------------------------------------------------------- 1 | import * as pako from "pako"; 2 | 3 | /** 4 | * Get only enabled rules to make the serialized data smaller. 5 | * @param {object} allRules The rule settings. 6 | * @returns {object} The rule settings for the enabled rules. 7 | */ 8 | function getEnabledRules(allRules) { 9 | return Object.keys(allRules).reduce((map, id) => { 10 | if (allRules[id] === "error") { 11 | map[id] = 2; 12 | } 13 | return map; 14 | }, {}); 15 | } 16 | 17 | /** 18 | * Serialize a given state as a base64 string. 19 | * @param {State} state The state to serialize. 20 | * @returns {string} The serialized string. 21 | */ 22 | export function serializeState(state) { 23 | const saveData = { 24 | code: state.code, 25 | rules: state.rules ? getEnabledRules(state.rules) : undefined, 26 | }; 27 | const jsonString = JSON.stringify(saveData); 28 | const compressedString = String.fromCharCode(...pako.deflate(jsonString)); 29 | const base64 = 30 | (typeof window !== "undefined" && window.btoa(compressedString)) || 31 | compressedString; 32 | 33 | //eslint-disable-next-line no-console -- demo 34 | console.log( 35 | `The compress rate of serialized string: ${( 36 | (100 * base64.length) / 37 | jsonString.length 38 | ).toFixed(1)}% (${jsonString.length}B → ${base64.length}B)`, 39 | ); 40 | 41 | return base64; 42 | } 43 | -------------------------------------------------------------------------------- /docs/.vitepress/theme/index.ts: -------------------------------------------------------------------------------- 1 | import type { Theme } from "vitepress"; 2 | import DefaultTheme from "vitepress/theme"; 3 | import ESLintCodeBlock from "./components/eslint-code-block.vue"; 4 | import PlaygroundBlock from "./components/playground-block.vue"; 5 | import "./style.css"; 6 | 7 | const theme: Theme = { 8 | extends: DefaultTheme, 9 | enhanceApp(ctx) { 10 | DefaultTheme.enhanceApp(ctx); 11 | ctx.app.component("eslint-code-block", ESLintCodeBlock); 12 | ctx.app.component("playground-block", PlaygroundBlock); 13 | }, 14 | }; 15 | export default theme; 16 | -------------------------------------------------------------------------------- /docs/.vitepress/theme/style.css: -------------------------------------------------------------------------------- 1 | a > img { 2 | display: inline-block; 3 | } 4 | 5 | /* Playground */ 6 | .playground .VPDoc.has-aside .content-container, 7 | .playground .VPDoc:not(.has-sidebar) .content, 8 | .playground .VPDoc:not(.has-sidebar) .container { 9 | max-width: none; 10 | } 11 | 12 | .playground .VPDoc.has-aside .aside { 13 | display: none; 14 | } 15 | -------------------------------------------------------------------------------- /docs/playground/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | pageClass: "playground" 3 | --- 4 | 5 | # Playground 6 | 7 | 8 | 9 | The playground is [here](https://future-architect.github.io/eslint-plugin-vue-scoped-css/playground/)!! 10 | 11 | 12 | -------------------------------------------------------------------------------- /docs/rules/no-deprecated-deep-combinator.md: -------------------------------------------------------------------------------- 1 | --- 2 | pageClass: "rule-details" 3 | sidebarDepth: 0 4 | title: "vue-scoped-css/no-deprecated-deep-combinator" 5 | description: "disallow using deprecated deep combinators" 6 | --- 7 | # vue-scoped-css/no-deprecated-deep-combinator 8 | 9 | > disallow using deprecated deep combinators 10 | 11 | - :gear: This rule is included in `"plugin:vue-scoped-css/all"` and `"plugin:vue-scoped-css/vue3-recommended"`. 12 | - :wrench: The `--fix` option on the [command line](https://eslint.org/docs/user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule. 13 | 14 | ## :book: Rule Details 15 | 16 | This rule reports the use of deprecated deep combinators as errors. 17 | 18 | 19 | 20 | ```vue 21 | 30 | ``` 31 | 32 | 33 | 34 | ## :wrench: Options 35 | 36 | Nothing. 37 | 38 | ## Implementation 39 | 40 | - [Rule source](https://github.com/future-architect/eslint-plugin-vue-scoped-css/blob/master/lib/rules/no-deprecated-deep-combinator.ts) 41 | - [Test source](https://github.com/future-architect/eslint-plugin-vue-scoped-css/blob/master/tests/lib/rules/no-deprecated-deep-combinator.ts) 42 | -------------------------------------------------------------------------------- /docs/rules/no-parent-of-v-global.md: -------------------------------------------------------------------------------- 1 | --- 2 | pageClass: "rule-details" 3 | sidebarDepth: 0 4 | title: "vue-scoped-css/no-parent-of-v-global" 5 | description: "disallow parent selector for `::v-global` pseudo-element" 6 | --- 7 | # vue-scoped-css/no-parent-of-v-global 8 | 9 | > disallow parent selector for `::v-global` pseudo-element 10 | 11 | - :gear: This rule is included in `"plugin:vue-scoped-css/all"` and `"plugin:vue-scoped-css/vue3-recommended"`. 12 | 13 | ## :book: Rule Details 14 | 15 | This rule reports parent selector for `::v-global` pseudo-element. 16 | 17 | 18 | 19 | ```vue 20 | 27 | ``` 28 | 29 | 30 | 31 | ## :wrench: Options 32 | 33 | Nothing. 34 | 35 | ## Implementation 36 | 37 | - [Rule source](https://github.com/future-architect/eslint-plugin-vue-scoped-css/blob/master/lib/rules/no-parent-of-v-global.ts) 38 | - [Test source](https://github.com/future-architect/eslint-plugin-vue-scoped-css/blob/master/tests/lib/rules/no-parent-of-v-global.ts) 39 | -------------------------------------------------------------------------------- /docs/rules/no-parsing-error.md: -------------------------------------------------------------------------------- 1 | --- 2 | pageClass: "rule-details" 3 | sidebarDepth: 0 4 | title: "vue-scoped-css/no-parsing-error" 5 | description: "disallow parsing errors in ` 24 | ``` 25 | 26 | 27 | 28 | ## :wrench: Options 29 | 30 | Nothing. 31 | 32 | ## Implementation 33 | 34 | - [Rule source](https://github.com/future-architect/eslint-plugin-vue-scoped-css/blob/master/lib/rules/no-parsing-error.ts) 35 | - [Test source](https://github.com/future-architect/eslint-plugin-vue-scoped-css/blob/master/tests/lib/rules/no-parsing-error.ts) 36 | -------------------------------------------------------------------------------- /docs/rules/no-unused-keyframes.md: -------------------------------------------------------------------------------- 1 | --- 2 | pageClass: "rule-details" 3 | sidebarDepth: 0 4 | title: "vue-scoped-css/no-unused-keyframes" 5 | description: "disallow `@keyframes` which don't use in Scoped CSS" 6 | --- 7 | # vue-scoped-css/no-unused-keyframes 8 | 9 | > disallow `@keyframes` which don't use in Scoped CSS 10 | 11 | - :gear: This rule is included in all of `"plugin:vue-scoped-css/all"`, `"plugin:vue-scoped-css/recommended"` and `"plugin:vue-scoped-css/vue3-recommended"`. 12 | 13 | ## :book: Rule Details 14 | 15 | This rule reports `@keyframes` is not used in Scoped CSS. 16 | 17 | 18 | 19 | ```vue 20 | 33 | ``` 34 | 35 | 36 | 37 | ## :wrench: Options 38 | 39 | ```json 40 | { 41 | "vue-scoped-css/no-unused-keyframes": ["error", { 42 | "checkUnscoped": false 43 | }] 44 | } 45 | ``` 46 | 47 | - `checkUnscoped` ... The rule only checks ` 26 | 27 | 28 | 30 | ``` 31 | 32 | 33 | 34 | ## :wrench: Options 35 | 36 | Default is set to `always`. 37 | 38 | ```json 39 | { 40 | "vue-scoped-css/require-scoped": ["error", "always" | "never"] 41 | } 42 | ``` 43 | 44 | - `"always"` (default) ... requires `scoped`. 45 | - `"never"` ... disallowed `scoped`. 46 | 47 | ### `"never"` 48 | 49 | 50 | 51 | ```vue 52 | 54 | 55 | 56 | 58 | 59 | 60 | 62 | ``` 63 | 64 | 65 | 66 | ## :books: Further reading 67 | 68 | - [Vue Loader - Scoped CSS] 69 | 70 | [Vue Loader - Scoped CSS]: https://vue-loader.vuejs.org/guide/scoped-css.html 71 | 72 | ## Implementation 73 | 74 | - [Rule source](https://github.com/future-architect/eslint-plugin-vue-scoped-css/blob/master/lib/rules/require-scoped.ts) 75 | - [Test source](https://github.com/future-architect/eslint-plugin-vue-scoped-css/blob/master/tests/lib/rules/require-scoped.ts) 76 | -------------------------------------------------------------------------------- /docs/rules/require-v-deep-argument.md: -------------------------------------------------------------------------------- 1 | --- 2 | pageClass: "rule-details" 3 | sidebarDepth: 0 4 | title: "vue-scoped-css/require-v-deep-argument" 5 | description: "require selector argument to be passed to `::v-deep()`" 6 | --- 7 | # vue-scoped-css/require-v-deep-argument 8 | 9 | > require selector argument to be passed to `::v-deep()` 10 | 11 | - :gear: This rule is included in `"plugin:vue-scoped-css/all"` and `"plugin:vue-scoped-css/vue3-recommended"`. 12 | - :wrench: The `--fix` option on the [command line](https://eslint.org/docs/user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule. 13 | 14 | ## :book: Rule Details 15 | 16 | This rule reports `::v-deep` pseudo-element with no selector argument passed. 17 | 18 | 19 | 20 | ```vue 21 | 29 | ``` 30 | 31 | 32 | 33 | ## :wrench: Options 34 | 35 | Nothing. 36 | 37 | ## Implementation 38 | 39 | - [Rule source](https://github.com/future-architect/eslint-plugin-vue-scoped-css/blob/master/lib/rules/require-v-deep-argument.ts) 40 | - [Test source](https://github.com/future-architect/eslint-plugin-vue-scoped-css/blob/master/tests/lib/rules/require-v-deep-argument.ts) 41 | -------------------------------------------------------------------------------- /docs/rules/require-v-global-argument.md: -------------------------------------------------------------------------------- 1 | --- 2 | pageClass: "rule-details" 3 | sidebarDepth: 0 4 | title: "vue-scoped-css/require-v-global-argument" 5 | description: "require selector argument to be passed to `::v-global()`" 6 | --- 7 | # vue-scoped-css/require-v-global-argument 8 | 9 | > require selector argument to be passed to `::v-global()` 10 | 11 | - :gear: This rule is included in `"plugin:vue-scoped-css/all"` and `"plugin:vue-scoped-css/vue3-recommended"`. 12 | 13 | ## :book: Rule Details 14 | 15 | This rule reports `::v-global` pseudo-element with no selector argument passed. 16 | 17 | 18 | 19 | ```vue 20 | 28 | ``` 29 | 30 | 31 | 32 | ## :wrench: Options 33 | 34 | Nothing. 35 | 36 | ## Implementation 37 | 38 | - [Rule source](https://github.com/future-architect/eslint-plugin-vue-scoped-css/blob/master/lib/rules/require-v-global-argument.ts) 39 | - [Test source](https://github.com/future-architect/eslint-plugin-vue-scoped-css/blob/master/tests/lib/rules/require-v-global-argument.ts) 40 | -------------------------------------------------------------------------------- /docs/rules/require-v-slotted-argument.md: -------------------------------------------------------------------------------- 1 | --- 2 | pageClass: "rule-details" 3 | sidebarDepth: 0 4 | title: "vue-scoped-css/require-v-slotted-argument" 5 | description: "require selector argument to be passed to `::v-slotted()`" 6 | --- 7 | # vue-scoped-css/require-v-slotted-argument 8 | 9 | > require selector argument to be passed to `::v-slotted()` 10 | 11 | - :gear: This rule is included in `"plugin:vue-scoped-css/all"` and `"plugin:vue-scoped-css/vue3-recommended"`. 12 | 13 | ## :book: Rule Details 14 | 15 | This rule reports `::v-slotted` pseudo-element with no selector argument passed. 16 | 17 | 18 | 19 | ```vue 20 | 28 | ``` 29 | 30 | 31 | 32 | ## :wrench: Options 33 | 34 | Nothing. 35 | 36 | ## Implementation 37 | 38 | - [Rule source](https://github.com/future-architect/eslint-plugin-vue-scoped-css/blob/master/lib/rules/require-v-slotted-argument.ts) 39 | - [Test source](https://github.com/future-architect/eslint-plugin-vue-scoped-css/blob/master/tests/lib/rules/require-v-slotted-argument.ts) 40 | -------------------------------------------------------------------------------- /docs/rules/v-deep-pseudo-style.md: -------------------------------------------------------------------------------- 1 | --- 2 | pageClass: "rule-details" 3 | sidebarDepth: 0 4 | title: "vue-scoped-css/v-deep-pseudo-style" 5 | description: "enforce `:deep()`/`::v-deep()` style" 6 | --- 7 | # vue-scoped-css/v-deep-pseudo-style 8 | 9 | > enforce `:deep()`/`::v-deep()` style 10 | 11 | - :gear: This rule is included in `"plugin:vue-scoped-css/all"`. 12 | - :wrench: The `--fix` option on the [command line](https://eslint.org/docs/user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule. 13 | 14 | ## :book: Rule Details 15 | 16 | This rule enforces deep pseudo style which you should use `:deep()` or `::v-deep()`. 17 | 18 | 19 | 20 | ```vue 21 | 28 | ``` 29 | 30 | 31 | 32 | ## :wrench: Options 33 | 34 | ```json 35 | { 36 | "vue-scoped-css/v-deep-pseudo-style": [ 37 | "error", 38 | ":deep" // or "::v-deep" 39 | ] 40 | } 41 | ``` 42 | 43 | - `":deep"` (default) ... requires using `:deep()`. 44 | - `"::v-deep"` ... requires using `::v-deep()`. 45 | 46 | ## :books: Further reading 47 | 48 | - [Vue.js - API SFC CSS Features > Deep Selectors](https://vuejs.org/api/sfc-css-features.html#deep-selectors) 49 | 50 | ## Implementation 51 | 52 | - [Rule source](https://github.com/future-architect/eslint-plugin-vue-scoped-css/blob/master/lib/rules/v-deep-pseudo-style.ts) 53 | - [Test source](https://github.com/future-architect/eslint-plugin-vue-scoped-css/blob/master/tests/lib/rules/v-deep-pseudo-style.ts) 54 | -------------------------------------------------------------------------------- /docs/rules/v-global-pseudo-style.md: -------------------------------------------------------------------------------- 1 | --- 2 | pageClass: "rule-details" 3 | sidebarDepth: 0 4 | title: "vue-scoped-css/v-global-pseudo-style" 5 | description: "enforce `:global()`/`::v-global()` style" 6 | --- 7 | # vue-scoped-css/v-global-pseudo-style 8 | 9 | > enforce `:global()`/`::v-global()` style 10 | 11 | - :gear: This rule is included in `"plugin:vue-scoped-css/all"`. 12 | - :wrench: The `--fix` option on the [command line](https://eslint.org/docs/user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule. 13 | 14 | ## :book: Rule Details 15 | 16 | This rule enforces global pseudo style which you should use `:global()` or `::v-global()`. 17 | 18 | 19 | 20 | ```vue 21 | 28 | ``` 29 | 30 | 31 | 32 | ## :wrench: Options 33 | 34 | ```json 35 | { 36 | "vue-scoped-css/v-global-pseudo-style": [ 37 | "error", 38 | ":global" // or "::v-global" 39 | ] 40 | } 41 | ``` 42 | 43 | - `":global"` (default) ... requires using `:global()`. 44 | - `"::v-global"` ... requires using `::v-global()`. 45 | 46 | ## :books: Further reading 47 | 48 | - [Vue.js - API SFC CSS Features > Global Selectors](https://vuejs.org/api/sfc-css-features.html#global-selectors) 49 | 50 | ## Implementation 51 | 52 | - [Rule source](https://github.com/future-architect/eslint-plugin-vue-scoped-css/blob/master/lib/rules/v-global-pseudo-style.ts) 53 | - [Test source](https://github.com/future-architect/eslint-plugin-vue-scoped-css/blob/master/tests/lib/rules/v-global-pseudo-style.ts) 54 | -------------------------------------------------------------------------------- /docs/rules/v-slotted-pseudo-style.md: -------------------------------------------------------------------------------- 1 | --- 2 | pageClass: "rule-details" 3 | sidebarDepth: 0 4 | title: "vue-scoped-css/v-slotted-pseudo-style" 5 | description: "enforce `:slotted()`/`::v-slotted()` style" 6 | --- 7 | # vue-scoped-css/v-slotted-pseudo-style 8 | 9 | > enforce `:slotted()`/`::v-slotted()` style 10 | 11 | - :gear: This rule is included in `"plugin:vue-scoped-css/all"`. 12 | - :wrench: The `--fix` option on the [command line](https://eslint.org/docs/user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule. 13 | 14 | ## :book: Rule Details 15 | 16 | This rule enforces slotted pseudo style which you should use `:slotted()` or `::v-slotted()`. 17 | 18 | 19 | 20 | ```vue 21 | 28 | ``` 29 | 30 | 31 | 32 | ## :wrench: Options 33 | 34 | ```json 35 | { 36 | "vue-scoped-css/v-slotted-pseudo-style": [ 37 | "error", 38 | ":slotted" // or "::v-slotted" 39 | ] 40 | } 41 | ``` 42 | 43 | - `":slotted"` (default) ... requires using `:slotted()`. 44 | - `"::v-slotted"` ... requires using `::v-slotted()`. 45 | 46 | ## :books: Further reading 47 | 48 | - [Vue.js - API SFC CSS Features > Slotted Selectors](https://vuejs.org/api/sfc-css-features.html#slotted-selectors) 49 | 50 | ## Implementation 51 | 52 | - [Rule source](https://github.com/future-architect/eslint-plugin-vue-scoped-css/blob/master/lib/rules/v-slotted-pseudo-style.ts) 53 | - [Test source](https://github.com/future-architect/eslint-plugin-vue-scoped-css/blob/master/tests/lib/rules/v-slotted-pseudo-style.ts) 54 | -------------------------------------------------------------------------------- /lib/configs/all.ts: -------------------------------------------------------------------------------- 1 | import { collectRules } from "../utils/rules"; 2 | import path from "path"; 3 | const base = require.resolve("./base"); 4 | const baseExtend = 5 | path.extname(`${base}`) === ".ts" ? "plugin:vue-scoped-css/base" : base; 6 | export = { 7 | extends: baseExtend, 8 | rules: collectRules(), 9 | }; 10 | -------------------------------------------------------------------------------- /lib/configs/base.ts: -------------------------------------------------------------------------------- 1 | export = { 2 | parser: require.resolve("vue-eslint-parser"), 3 | plugins: ["vue-scoped-css"], 4 | }; 5 | -------------------------------------------------------------------------------- /lib/configs/flat/all.ts: -------------------------------------------------------------------------------- 1 | import { collectRules } from "../../utils/rules"; 2 | import base from "./base"; 3 | 4 | export default [ 5 | ...base, 6 | { 7 | rules: collectRules(), 8 | name: "vue-scoped-css/flat/all", 9 | }, 10 | ]; 11 | -------------------------------------------------------------------------------- /lib/configs/flat/base.ts: -------------------------------------------------------------------------------- 1 | import type { ESLint } from "eslint"; 2 | import * as vueParser from "vue-eslint-parser"; 3 | export default [ 4 | { 5 | plugins: { 6 | // eslint-disable-next-line @typescript-eslint/naming-convention -- plugin name 7 | get "vue-scoped-css"(): ESLint.Plugin { 8 | return require("../../index"); 9 | }, 10 | }, 11 | name: "vue-scoped-css/flat/base/plugins", 12 | }, 13 | { 14 | files: ["*.vue", "**/*.vue"], 15 | languageOptions: { 16 | parser: vueParser, 17 | }, 18 | name: "vue-scoped-css/flat/base/options", 19 | }, 20 | ]; 21 | -------------------------------------------------------------------------------- /lib/configs/flat/recommended.ts: -------------------------------------------------------------------------------- 1 | import { collectRules } from "../../utils/rules"; 2 | import base from "./base"; 3 | 4 | export default [ 5 | ...base, 6 | { 7 | rules: collectRules("vue3-recommended"), 8 | name: "vue-scoped-css/flat/vue3-recommended", 9 | }, 10 | ]; 11 | -------------------------------------------------------------------------------- /lib/configs/flat/vue2-recommended.ts: -------------------------------------------------------------------------------- 1 | import { collectRules } from "../../utils/rules"; 2 | import base from "./base"; 3 | 4 | export default [ 5 | ...base, 6 | { 7 | rules: collectRules("vue2-recommended"), 8 | name: "vue-scoped-css/flat/vue2-recommended", 9 | }, 10 | ]; 11 | -------------------------------------------------------------------------------- /lib/configs/recommended.ts: -------------------------------------------------------------------------------- 1 | import { collectRules } from "../utils/rules"; 2 | import path from "path"; 3 | const base = require.resolve("./base"); 4 | const baseExtend = 5 | path.extname(`${base}`) === ".ts" ? "plugin:vue-scoped-css/base" : base; 6 | export = { 7 | extends: baseExtend, 8 | rules: collectRules("vue2-recommended"), 9 | }; 10 | -------------------------------------------------------------------------------- /lib/configs/vue3-recommended.ts: -------------------------------------------------------------------------------- 1 | import { collectRules } from "../utils/rules"; 2 | import path from "path"; 3 | const base = require.resolve("./base"); 4 | const baseExtend = 5 | path.extname(`${base}`) === ".ts" ? "plugin:vue-scoped-css/base" : base; 6 | export = { 7 | extends: baseExtend, 8 | rules: collectRules("vue3-recommended"), 9 | }; 10 | -------------------------------------------------------------------------------- /lib/index.ts: -------------------------------------------------------------------------------- 1 | import { rules as ruleList } from "./utils/rules"; 2 | import type { Rule } from "./types"; 3 | import flatBase from "./configs/flat/base"; 4 | import flatRecommended from "./configs/flat/recommended"; 5 | import flatVue2Recommended from "./configs/flat/vue2-recommended"; 6 | import flatAll from "./configs/flat/all"; 7 | 8 | const configs = { 9 | base: require("./configs/base"), 10 | recommended: require("./configs/recommended"), 11 | "vue3-recommended": require("./configs/vue3-recommended"), 12 | all: require("./configs/all"), 13 | "flat/base": flatBase, 14 | "flat/recommended": flatRecommended, 15 | "flat/vue2-recommended": flatVue2Recommended, 16 | "flat/all": flatAll, 17 | }; 18 | 19 | const rules = ruleList.reduce( 20 | (obj, r) => { 21 | obj[r.meta.docs?.ruleName || ""] = r; 22 | return obj; 23 | }, 24 | {} as { [key: string]: Rule }, 25 | ); 26 | 27 | export = { 28 | configs, 29 | rules, 30 | }; 31 | -------------------------------------------------------------------------------- /lib/options.ts: -------------------------------------------------------------------------------- 1 | import { toRegExp } from "./utils/regexp"; 2 | 3 | export interface QueryOptions { 4 | ignoreBEMModifier?: boolean; 5 | captureClassesFromDoc?: string[]; 6 | } 7 | 8 | export interface ParsedQueryOptions { 9 | ignoreBEMModifier: boolean; 10 | captureClassesFromDoc: RegExp[]; 11 | } 12 | 13 | /** 14 | * Parse options 15 | */ 16 | export function parseQueryOptions( 17 | options: QueryOptions | undefined, 18 | ): ParsedQueryOptions { 19 | const { ignoreBEMModifier, captureClassesFromDoc } = options || {}; 20 | 21 | return { 22 | ignoreBEMModifier: ignoreBEMModifier ?? false, 23 | captureClassesFromDoc: 24 | captureClassesFromDoc?.map((s) => toRegExp(s, "g")) ?? [], 25 | }; 26 | } 27 | -------------------------------------------------------------------------------- /lib/styles/parser/index.ts: -------------------------------------------------------------------------------- 1 | import { CSSParser } from "./css-parser"; 2 | import { SCSSParser } from "./scss-parser"; 3 | import { StylusParser } from "./stylus-parser"; 4 | import type { SourceCode, LineAndColumnData } from "../../types"; 5 | import type { VCSSStyleSheet } from "../ast"; 6 | import { isSupportedStyleLang } from "../utils"; 7 | 8 | const PARSERS = { 9 | scss: SCSSParser, 10 | css: CSSParser, 11 | stylus: StylusParser, 12 | }; 13 | 14 | /** 15 | * Parse the CSS. 16 | * @param {SourceCode} sourceCode the SourceCode object that you can use to work with the source that was passed to ESLint. 17 | * @param {LineAndColumnData} offsetLocation start location of css. 18 | * @param {string} css the CSS to parse 19 | * @param {string} lang the language of `"; 8 | 9 | for (const key of Object.keys(plugin.rules)) { 10 | const ruleId = `vue-scoped-css/${key}`; 11 | 12 | it(ruleId, () => { 13 | const linter = new Linter(); 14 | const config = { 15 | languageOptions: { 16 | ecmaVersion: 2015, 17 | parserOptions: { 18 | ecmaFeatures: { 19 | jsx: true, 20 | }, 21 | }, 22 | }, 23 | plugins: { "vue-scoped-css": plugin }, 24 | rules: { 25 | [ruleId]: "error", 26 | }, 27 | }; 28 | linter.verifyAndFix(code, config as any, "test.vue"); 29 | }); 30 | } 31 | }); 32 | -------------------------------------------------------------------------------- /tests/lib/rules/no-parent-of-v-global.ts: -------------------------------------------------------------------------------- 1 | import { RuleTester } from "../test-lib/eslint-compat"; 2 | import rule from "../../../lib/rules/no-parent-of-v-global"; 3 | 4 | import * as vueParser from "vue-eslint-parser"; 5 | 6 | const tester = new RuleTester({ 7 | languageOptions: { 8 | parser: vueParser, 9 | ecmaVersion: 2019, 10 | sourceType: "module", 11 | }, 12 | }); 13 | 14 | tester.run("no-parent-of-v-global", rule as any, { 15 | valid: [ 16 | ` 17 | 18 | 21 | `, 22 | ], 23 | invalid: [ 24 | { 25 | code: ` 26 | 27 | 30 | `, 31 | errors: [ 32 | { 33 | message: 34 | "The parent selector of the `::v-global()` pseudo-element is useless.", 35 | line: 4, 36 | column: 18, 37 | endColumn: 34, 38 | }, 39 | ], 40 | }, 41 | ], 42 | }); 43 | -------------------------------------------------------------------------------- /tests/lib/rules/require-v-deep-argument.ts: -------------------------------------------------------------------------------- 1 | import { RuleTester } from "../test-lib/eslint-compat"; 2 | import rule from "../../../lib/rules/require-v-deep-argument"; 3 | 4 | import * as vueParser from "vue-eslint-parser"; 5 | 6 | const tester = new RuleTester({ 7 | languageOptions: { 8 | parser: vueParser, 9 | ecmaVersion: 2019, 10 | sourceType: "module", 11 | }, 12 | }); 13 | 14 | tester.run("require-v-deep-argument", rule as any, { 15 | valid: [ 16 | ` 17 | 18 | 21 | `, 22 | ], 23 | invalid: [ 24 | { 25 | code: ` 26 | 27 | 31 | `, 32 | output: ` 33 | 34 | 38 | `, 39 | errors: [ 40 | { 41 | message: "Need to pass argument to the `::v-deep` pseudo-element.", 42 | line: 4, 43 | column: 23, 44 | endLine: 4, 45 | endColumn: 31, 46 | }, 47 | { 48 | message: "Need to pass argument to the `::v-deep` pseudo-element.", 49 | line: 5, 50 | column: 23, 51 | endLine: 5, 52 | endColumn: 33, 53 | }, 54 | ], 55 | }, 56 | ], 57 | }); 58 | -------------------------------------------------------------------------------- /tests/lib/rules/require-v-global-argument.ts: -------------------------------------------------------------------------------- 1 | import { RuleTester } from "../test-lib/eslint-compat"; 2 | import rule from "../../../lib/rules/require-v-global-argument"; 3 | 4 | import * as vueParser from "vue-eslint-parser"; 5 | 6 | const tester = new RuleTester({ 7 | languageOptions: { 8 | parser: vueParser, 9 | ecmaVersion: 2019, 10 | sourceType: "module", 11 | }, 12 | }); 13 | 14 | tester.run("require-v-global-argument", rule as any, { 15 | valid: [ 16 | ` 17 | 18 | 21 | `, 22 | ], 23 | invalid: [ 24 | { 25 | code: ` 26 | 27 | 31 | `, 32 | errors: [ 33 | { 34 | message: "Need to pass argument to the `::v-global` pseudo-element.", 35 | line: 4, 36 | column: 13, 37 | endLine: 4, 38 | endColumn: 23, 39 | }, 40 | { 41 | message: "Need to pass argument to the `::v-global` pseudo-element.", 42 | line: 5, 43 | column: 13, 44 | endLine: 5, 45 | endColumn: 25, 46 | }, 47 | ], 48 | }, 49 | ], 50 | }); 51 | -------------------------------------------------------------------------------- /tests/lib/rules/require-v-slotted-argument.ts: -------------------------------------------------------------------------------- 1 | import { RuleTester } from "../test-lib/eslint-compat"; 2 | import rule from "../../../lib/rules/require-v-slotted-argument"; 3 | 4 | import * as vueParser from "vue-eslint-parser"; 5 | 6 | const tester = new RuleTester({ 7 | languageOptions: { 8 | parser: vueParser, 9 | ecmaVersion: 2019, 10 | sourceType: "module", 11 | }, 12 | }); 13 | 14 | tester.run("require-v-slotted-argument", rule as any, { 15 | valid: [ 16 | ` 17 | 18 | 21 | `, 22 | ], 23 | invalid: [ 24 | { 25 | code: ` 26 | 27 | 31 | `, 32 | errors: [ 33 | { 34 | message: "Need to pass argument to the `::v-slotted` pseudo-element.", 35 | line: 4, 36 | column: 23, 37 | endLine: 4, 38 | endColumn: 34, 39 | }, 40 | { 41 | message: "Need to pass argument to the `::v-slotted` pseudo-element.", 42 | line: 5, 43 | column: 23, 44 | endLine: 5, 45 | endColumn: 36, 46 | }, 47 | ], 48 | }, 49 | ], 50 | }); 51 | -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | rules: { 3 | "@mysticatea/prettier": "off", 4 | }, 5 | } -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/index/@nest-concat01/selectors-text.json: -------------------------------------------------------------------------------- 1 | [ 2 | [ 3 | ".foo" 4 | ], 5 | [ 6 | ".foo-bar" 7 | ], 8 | [ 9 | ".foo", 10 | ".bar" 11 | ], 12 | [ 13 | ".foo", 14 | "#bar" 15 | ], 16 | [ 17 | ".foobar" 18 | ], 19 | [ 20 | ".foo__bar" 21 | ], 22 | [ 23 | "#foo" 24 | ], 25 | [ 26 | "#foo-bar" 27 | ], 28 | [ 29 | ":foo" 30 | ], 31 | [ 32 | ":foo-bar" 33 | ] 34 | ] -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/index/@nest-concat01/source.vue: -------------------------------------------------------------------------------- 1 | 4 | 30 | -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/index/@nest-concat02/selectors-text.json: -------------------------------------------------------------------------------- 1 | [ 2 | [ 3 | "-foo" 4 | ], 5 | [ 6 | ".bar-foo" 7 | ], 8 | [ 9 | ".foo" 10 | ], 11 | [ 12 | ".bar", 13 | ".foo" 14 | ], 15 | [ 16 | "#foo" 17 | ], 18 | [ 19 | ".bar", 20 | "#foo" 21 | ], 22 | [ 23 | "foo" 24 | ], 25 | [ 26 | ".barfoo" 27 | ], 28 | [ 29 | "__foo" 30 | ], 31 | [ 32 | ".bar__foo" 33 | ], 34 | [ 35 | "-foo" 36 | ], 37 | [ 38 | "#bar-foo" 39 | ], 40 | [ 41 | "-foo" 42 | ], 43 | [ 44 | ":bar-foo" 45 | ] 46 | ] -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/index/@nest-concat02/source.vue: -------------------------------------------------------------------------------- 1 | 4 | 40 | -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/index/@nest-concat03/selectors-text.json: -------------------------------------------------------------------------------- 1 | [ 2 | [ 3 | "-foo" 4 | ], 5 | [ 6 | ".bar-foo-baz" 7 | ], 8 | [ 9 | ".foo" 10 | ], 11 | [ 12 | ".bar", 13 | ".foo", 14 | ".baz" 15 | ], 16 | [ 17 | "#foo" 18 | ], 19 | [ 20 | ".bar", 21 | "#foo", 22 | ":baz" 23 | ], 24 | [ 25 | "foo" 26 | ], 27 | [ 28 | ".barfoobaz" 29 | ], 30 | [ 31 | "__foo" 32 | ], 33 | [ 34 | ".bar__foo--baz" 35 | ], 36 | [ 37 | "-foo" 38 | ], 39 | [ 40 | "#bar-foo-baz" 41 | ], 42 | [ 43 | "-foo" 44 | ], 45 | [ 46 | ":bar-foo-baz" 47 | ] 48 | ] -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/index/@nest-concat03/source.vue: -------------------------------------------------------------------------------- 1 | 4 | 40 | -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/index/@nest-concat04/selectors-text.json: -------------------------------------------------------------------------------- 1 | [ 2 | [ 3 | "-foo" 4 | ], 5 | [ 6 | ".bar-foo-baz" 7 | ], 8 | [ 9 | ".bar-foo", 10 | ">", 11 | "-baz" 12 | ], 13 | [ 14 | ".bar", 15 | ">", 16 | "-foo", 17 | ">", 18 | "-baz" 19 | ] 20 | ] -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/index/@nest-concat04/source.vue: -------------------------------------------------------------------------------- 1 | 4 | 14 | -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/index/@nest-deep01/selectors-text.json: -------------------------------------------------------------------------------- 1 | [ 2 | [ 3 | ".foo1" 4 | ], 5 | [ 6 | ".foo2" 7 | ], 8 | [ 9 | ".bar", 10 | ":not(.foo1)" 11 | ], 12 | [ 13 | ".bar", 14 | ":not(.foo2)" 15 | ], 16 | [ 17 | ":not(.foo1 .bar)" 18 | ], 19 | [ 20 | ":not(.foo2 .bar)" 21 | ] 22 | ] -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/index/@nest-deep01/source.vue: -------------------------------------------------------------------------------- 1 | 4 | 10 | -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/index/@nest-invalid01/selectors-text.json: -------------------------------------------------------------------------------- 1 | [ 2 | [ 3 | ".foo", 4 | ">", 5 | ".bar" 6 | ], 7 | [ 8 | ".foo" 9 | ], 10 | [ 11 | ".bar" 12 | ] 13 | ] -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/index/@nest-invalid01/source.vue: -------------------------------------------------------------------------------- 1 | 4 | 13 | -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/index/@nest01/selectors-text.json: -------------------------------------------------------------------------------- 1 | [ 2 | [ 3 | ".foo" 4 | ], 5 | [ 6 | ".foo", 7 | ">", 8 | ".bar" 9 | ] 10 | ] -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/index/@nest01/source.vue: -------------------------------------------------------------------------------- 1 | 4 | 10 | -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/index/@nest02/selectors-text.json: -------------------------------------------------------------------------------- 1 | [ 2 | [ 3 | ".foo" 4 | ], 5 | [ 6 | ".foo", 7 | ">", 8 | ".bar" 9 | ] 10 | ] -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/index/@nest02/source.vue: -------------------------------------------------------------------------------- 1 | 4 | 10 | -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/index/@nest03/selectors-text.json: -------------------------------------------------------------------------------- 1 | [ 2 | [ 3 | ".foo1" 4 | ], 5 | [ 6 | ".foo2" 7 | ], 8 | [ 9 | ".foo1", 10 | ">", 11 | ".bar" 12 | ], 13 | [ 14 | ".foo2", 15 | ">", 16 | ".bar" 17 | ] 18 | ] -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/index/@nest03/source.vue: -------------------------------------------------------------------------------- 1 | 4 | 10 | -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/index/attribute01/selectors-text.json: -------------------------------------------------------------------------------- 1 | [ 2 | [ 3 | "[href=\"foo\"]", 4 | " ", 5 | "[href='foo']", 6 | " ", 7 | "[href=foo]", 8 | " ", 9 | "[href]" 10 | ] 11 | ] -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/index/attribute01/source.vue: -------------------------------------------------------------------------------- 1 | 4 | 8 | -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/index/attribute02/selectors-text.json: -------------------------------------------------------------------------------- 1 | [ 2 | [ 3 | "a", 4 | "[href^=\"#\"]" 5 | ], 6 | [ 7 | "a", 8 | "[href*=\"example\"]" 9 | ], 10 | [ 11 | "a", 12 | "[href$=\".org\"]" 13 | ], 14 | [ 15 | "a", 16 | "[href*=\"cAsE\" s]" 17 | ], 18 | [ 19 | "a", 20 | "[href*=\"cAsE\" i]" 21 | ], 22 | [ 23 | "a", 24 | "[href*=\"cAsE\" S]" 25 | ], 26 | [ 27 | "a", 28 | "[href*=\"cAsE\" I]" 29 | ] 30 | ] -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/index/attribute02/source.vue: -------------------------------------------------------------------------------- 1 | 4 | 26 | -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/index/decl01/selectors-text.json: -------------------------------------------------------------------------------- 1 | [ 2 | [ 3 | "a" 4 | ] 5 | ] -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/index/decl01/selectors.json: -------------------------------------------------------------------------------- 1 | [ 2 | [ 3 | { 4 | "type": "VCSSTypeSelector", 5 | "loc": { 6 | "start": { 7 | "line": 5, 8 | "column": 0 9 | }, 10 | "end": { 11 | "line": 5, 12 | "column": 1 13 | } 14 | }, 15 | "start": 50, 16 | "end": 51, 17 | "range": [ 18 | 50, 19 | 51 20 | ], 21 | "value": "a", 22 | "selector": "a" 23 | } 24 | ] 25 | ] -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/index/decl01/source.vue: -------------------------------------------------------------------------------- 1 | 4 | 9 | -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/index/decl02/selectors-text.json: -------------------------------------------------------------------------------- 1 | [ 2 | [ 3 | "a" 4 | ] 5 | ] -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/index/decl02/selectors.json: -------------------------------------------------------------------------------- 1 | [ 2 | [ 3 | { 4 | "type": "VCSSTypeSelector", 5 | "loc": { 6 | "start": { 7 | "line": 5, 8 | "column": 0 9 | }, 10 | "end": { 11 | "line": 5, 12 | "column": 1 13 | } 14 | }, 15 | "start": 50, 16 | "end": 51, 17 | "range": [ 18 | 50, 19 | 51 20 | ], 21 | "value": "a", 22 | "selector": "a" 23 | } 24 | ] 25 | ] -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/index/decl02/source.vue: -------------------------------------------------------------------------------- 1 | 4 | 9 | -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/index/decl03/selectors-text.json: -------------------------------------------------------------------------------- 1 | [ 2 | [ 3 | "a" 4 | ] 5 | ] -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/index/decl03/selectors.json: -------------------------------------------------------------------------------- 1 | [ 2 | [ 3 | { 4 | "type": "VCSSTypeSelector", 5 | "loc": { 6 | "start": { 7 | "line": 5, 8 | "column": 0 9 | }, 10 | "end": { 11 | "line": 5, 12 | "column": 1 13 | } 14 | }, 15 | "start": 50, 16 | "end": 51, 17 | "range": [ 18 | 50, 19 | 51 20 | ], 21 | "value": "a", 22 | "selector": "a" 23 | } 24 | ] 25 | ] -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/index/decl03/source.vue: -------------------------------------------------------------------------------- 1 | 4 | 9 | -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/index/decl04/selectors-text.json: -------------------------------------------------------------------------------- 1 | [ 2 | [ 3 | "a" 4 | ], 5 | [ 6 | ".b" 7 | ] 8 | ] -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/index/decl04/selectors.json: -------------------------------------------------------------------------------- 1 | [ 2 | [ 3 | { 4 | "type": "VCSSTypeSelector", 5 | "loc": { 6 | "start": { 7 | "line": 5, 8 | "column": 0 9 | }, 10 | "end": { 11 | "line": 5, 12 | "column": 1 13 | } 14 | }, 15 | "start": 50, 16 | "end": 51, 17 | "range": [ 18 | 50, 19 | 51 20 | ], 21 | "value": "a", 22 | "selector": "a" 23 | } 24 | ], 25 | [ 26 | { 27 | "type": "VCSSClassSelector", 28 | "loc": { 29 | "start": { 30 | "line": 8, 31 | "column": 0 32 | }, 33 | "end": { 34 | "line": 8, 35 | "column": 2 36 | } 37 | }, 38 | "start": 80, 39 | "end": 82, 40 | "range": [ 41 | 80, 42 | 82 43 | ], 44 | "value": "b", 45 | "selector": ".b" 46 | } 47 | ] 48 | ] -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/index/decl04/source.vue: -------------------------------------------------------------------------------- 1 | 4 | 12 | -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/index/keyframes/selectors-text.json: -------------------------------------------------------------------------------- 1 | [] -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/index/keyframes/selectors.json: -------------------------------------------------------------------------------- 1 | [] -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/index/keyframes/source.vue: -------------------------------------------------------------------------------- 1 | 4 | 12 | -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/index/nest-invalid01/selectors-text.json: -------------------------------------------------------------------------------- 1 | [ 2 | [ 3 | ".foo" 4 | ], 5 | [ 6 | ">", 7 | ".bar" 8 | ], 9 | [ 10 | ">", 11 | ".bar" 12 | ], 13 | [ 14 | ".bar" 15 | ] 16 | ] -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/index/nest-invalid01/source.vue: -------------------------------------------------------------------------------- 1 | 4 | 14 | -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/index/nest-scss-deep/selectors-text.json: -------------------------------------------------------------------------------- 1 | [ 2 | [ 3 | ".foo1" 4 | ], 5 | [ 6 | ".foo2" 7 | ], 8 | [ 9 | ".bar", 10 | ":not(.foo1)" 11 | ], 12 | [ 13 | ".bar", 14 | ":not(.foo2)" 15 | ], 16 | [ 17 | ":not(.foo1 .bar)" 18 | ], 19 | [ 20 | ":not(.foo2 .bar)" 21 | ] 22 | ] -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/index/nest-scss-deep/source.vue: -------------------------------------------------------------------------------- 1 | 4 | 10 | -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/index/nest-scss01/selectors-text.json: -------------------------------------------------------------------------------- 1 | [ 2 | [ 3 | ".foo" 4 | ], 5 | [ 6 | ".foo", 7 | ">", 8 | ".bar" 9 | ], 10 | [ 11 | ".foo", 12 | ">", 13 | ".bar" 14 | ], 15 | [ 16 | ".foo", 17 | " ", 18 | ".bar" 19 | ], 20 | [ 21 | ".foo", 22 | ".bar" 23 | ], 24 | [ 25 | ".foo--bar" 26 | ], 27 | [ 28 | ".bar", 29 | " ", 30 | ".foo" 31 | ], 32 | [ 33 | ".foo", 34 | " ", 35 | ":hover" 36 | ], 37 | [ 38 | ".foo", 39 | ":hover" 40 | ] 41 | ] -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/index/nest-scss01/source.vue: -------------------------------------------------------------------------------- 1 | 4 | 24 | -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/index/nest-scss02/selectors-text.json: -------------------------------------------------------------------------------- 1 | [ 2 | [ 3 | ".foo" 4 | ], 5 | [ 6 | ".foo", 7 | "+", 8 | ".foo" 9 | ] 10 | ] -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/index/nest-scss02/source.vue: -------------------------------------------------------------------------------- 1 | 4 | 9 | -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/index/nest01/selectors-text.json: -------------------------------------------------------------------------------- 1 | [ 2 | [ 3 | ".foo" 4 | ], 5 | [ 6 | ".foo", 7 | ">", 8 | ".bar" 9 | ], 10 | [ 11 | ".foo", 12 | ">", 13 | ".bar" 14 | ], 15 | [ 16 | ".foo", 17 | " ", 18 | ".bar" 19 | ], 20 | [ 21 | ".foo", 22 | ".bar" 23 | ], 24 | [ 25 | ".foo", 26 | " ", 27 | ":hover" 28 | ], 29 | [ 30 | ".foo", 31 | ":hover" 32 | ] 33 | ] -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/index/nest01/source.vue: -------------------------------------------------------------------------------- 1 | 4 | 20 | -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/index/pseudo01/selectors-text.json: -------------------------------------------------------------------------------- 1 | [ 2 | [ 3 | "a", 4 | "::after" 5 | ] 6 | ] -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/index/pseudo01/selectors.json: -------------------------------------------------------------------------------- 1 | [ 2 | [ 3 | { 4 | "type": "VCSSTypeSelector", 5 | "loc": { 6 | "start": { 7 | "line": 5, 8 | "column": 0 9 | }, 10 | "end": { 11 | "line": 5, 12 | "column": 1 13 | } 14 | }, 15 | "start": 50, 16 | "end": 51, 17 | "range": [ 18 | 50, 19 | 51 20 | ], 21 | "value": "a", 22 | "selector": "a" 23 | }, 24 | { 25 | "type": "VCSSSelectorPseudo", 26 | "loc": { 27 | "start": { 28 | "line": 5, 29 | "column": 1 30 | }, 31 | "end": { 32 | "line": 5, 33 | "column": 8 34 | } 35 | }, 36 | "start": 51, 37 | "end": 58, 38 | "range": [ 39 | 51, 40 | 58 41 | ], 42 | "value": "::after", 43 | "nodes": [] 44 | } 45 | ] 46 | ] -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/index/pseudo01/source.vue: -------------------------------------------------------------------------------- 1 | 4 | 8 | -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/index/pseudo02/selectors-text.json: -------------------------------------------------------------------------------- 1 | [ 2 | [ 3 | "a", 4 | ":not(.b)" 5 | ] 6 | ] -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/index/pseudo02/source.vue: -------------------------------------------------------------------------------- 1 | 4 | 8 | -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/index/pseudo03/selectors-text.json: -------------------------------------------------------------------------------- 1 | [ 2 | [ 3 | ":nth-child(3n+4)" 4 | ] 5 | ] -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/index/pseudo03/source.vue: -------------------------------------------------------------------------------- 1 | 4 | 8 | -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/index/pseudo04/selectors-text.json: -------------------------------------------------------------------------------- 1 | [ 2 | [ 3 | "a", 4 | ":not(.b)" 5 | ] 6 | ] -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/index/pseudo04/source.vue: -------------------------------------------------------------------------------- 1 | 4 | 8 | -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/index/pseudo05/selectors-text.json: -------------------------------------------------------------------------------- 1 | [ 2 | [ 3 | "a", 4 | ":not(.b)" 5 | ] 6 | ] -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/index/pseudo05/source.vue: -------------------------------------------------------------------------------- 1 | 4 | 8 | -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/index/scss-comment01/selectors-text.json: -------------------------------------------------------------------------------- 1 | [ 2 | [ 3 | ".foo" 4 | ], 5 | [ 6 | ".foo", 7 | " ", 8 | ".bar" 9 | ], 10 | [ 11 | ".baz" 12 | ] 13 | ] -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/index/scss-comment01/source.vue: -------------------------------------------------------------------------------- 1 | 4 | 19 | -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/index/scss-comment02/selectors-text.json: -------------------------------------------------------------------------------- 1 | [ 2 | [ 3 | ".foo" 4 | ], 5 | [ 6 | ".foo", 7 | " ", 8 | ".bar" 9 | ], 10 | [ 11 | ".baz" 12 | ] 13 | ] -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/index/scss-comment02/source.vue: -------------------------------------------------------------------------------- 1 | 4 | 19 | -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/index/scss-comment03-in-selector/selectors-text.json: -------------------------------------------------------------------------------- 1 | [ 2 | [ 3 | ".foo", 4 | " ", 5 | ".bar" 6 | ], 7 | [ 8 | ".baz" 9 | ] 10 | ] -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/index/scss-comment03-in-selector/source.vue: -------------------------------------------------------------------------------- 1 | 4 | 10 | -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/index/scss-comment04-in-selector/selectors-text.json: -------------------------------------------------------------------------------- 1 | [ 2 | [ 3 | ".foo", 4 | " ", 5 | ".bar" 6 | ], 7 | [ 8 | ".baz" 9 | ] 10 | ] -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/index/scss-comment04-in-selector/source.vue: -------------------------------------------------------------------------------- 1 | 4 | 10 | -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/index/scss-interpolation01-selector/selectors-text.json: -------------------------------------------------------------------------------- 1 | [ 2 | [ 3 | "span", 4 | ".emoji-#{$name}" 5 | ], 6 | [ 7 | "tag#{$tag}", 8 | " ", 9 | "##{$id}", 10 | " ", 11 | ".#{$class}class", 12 | "[#{$attr}]", 13 | " ", 14 | "[attr=#{$attr-val}]", 15 | " ", 16 | "::pseudo#{$pseudo}", 17 | " ", 18 | ":pseudo2#{$pseudo}", 19 | " ", 20 | "::fn(.#{$in-pseudo})", 21 | "/#{$named-comb}/" 22 | ], 23 | [ 24 | "\"#{$wow}\"" 25 | ], 26 | [ 27 | ".class", 28 | " ", 29 | "\"#{$wow}\"" 30 | ], 31 | [ 32 | ".emoji-#{\n \n $name\n \n}" 33 | ] 34 | ] -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/index/scss-interpolation01-selector/source.vue: -------------------------------------------------------------------------------- 1 | 4 | 36 | -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/index/scss-nest-concat01/selectors-text.json: -------------------------------------------------------------------------------- 1 | [ 2 | [ 3 | "-foo" 4 | ], 5 | [ 6 | ".bar-foo-baz" 7 | ], 8 | [ 9 | ".bar-foo", 10 | ">", 11 | "-baz" 12 | ], 13 | [ 14 | ".bar", 15 | ">", 16 | "-foo", 17 | ">", 18 | "-baz" 19 | ], 20 | [ 21 | "-foo", 22 | ">" 23 | ], 24 | [ 25 | ".bar-foo", 26 | ">", 27 | "-baz" 28 | ], 29 | [ 30 | ".bar-foo", 31 | ">", 32 | ">", 33 | "-baz" 34 | ], 35 | [ 36 | ".bar", 37 | ">", 38 | "-foo", 39 | ">", 40 | ">", 41 | "-baz" 42 | ] 43 | ] -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/index/scss-nest-concat01/source.vue: -------------------------------------------------------------------------------- 1 | 4 | 23 | -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/index/scss-sample01/selectors-text.json: -------------------------------------------------------------------------------- 1 | [ 2 | [ 3 | "body" 4 | ], 5 | [ 6 | "nav" 7 | ], 8 | [ 9 | "nav", 10 | " ", 11 | "ul" 12 | ], 13 | [ 14 | "nav", 15 | " ", 16 | "li" 17 | ], 18 | [ 19 | "nav", 20 | " ", 21 | "a" 22 | ], 23 | [ 24 | "body" 25 | ], 26 | [ 27 | ".box" 28 | ], 29 | [ 30 | "%message-shared" 31 | ], 32 | [ 33 | "%equal-heights" 34 | ], 35 | [ 36 | ".message" 37 | ], 38 | [ 39 | ".success" 40 | ], 41 | [ 42 | ".error" 43 | ], 44 | [ 45 | ".warning" 46 | ], 47 | [ 48 | ".container" 49 | ], 50 | [ 51 | "article", 52 | "[role=\"main\"]" 53 | ], 54 | [ 55 | "aside", 56 | "[role=\"complementary\"]" 57 | ] 58 | ] -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/index/scss-sample01/source.vue: -------------------------------------------------------------------------------- 1 | 4 | 94 | -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/index/selector01/selectors-text.json: -------------------------------------------------------------------------------- 1 | [ 2 | [ 3 | ".foo" 4 | ], 5 | [ 6 | ".bar" 7 | ] 8 | ] -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/index/selector01/selectors.json: -------------------------------------------------------------------------------- 1 | [ 2 | [ 3 | { 4 | "type": "VCSSClassSelector", 5 | "loc": { 6 | "start": { 7 | "line": 5, 8 | "column": 5 9 | }, 10 | "end": { 11 | "line": 5, 12 | "column": 9 13 | } 14 | }, 15 | "start": 55, 16 | "end": 59, 17 | "range": [ 18 | 55, 19 | 59 20 | ], 21 | "value": "foo", 22 | "selector": ".foo" 23 | } 24 | ], 25 | [ 26 | { 27 | "type": "VCSSClassSelector", 28 | "loc": { 29 | "start": { 30 | "line": 5, 31 | "column": 22 32 | }, 33 | "end": { 34 | "line": 5, 35 | "column": 26 36 | } 37 | }, 38 | "start": 72, 39 | "end": 76, 40 | "range": [ 41 | 72, 42 | 76 43 | ], 44 | "value": "bar", 45 | "selector": ".bar" 46 | } 47 | ] 48 | ] -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/index/selector01/source.vue: -------------------------------------------------------------------------------- 1 | 4 | 8 | -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/index/string/selectors-text.json: -------------------------------------------------------------------------------- 1 | [ 2 | [ 3 | "\"wow\"" 4 | ] 5 | ] -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/index/string/selectors.json: -------------------------------------------------------------------------------- 1 | [ 2 | [ 3 | { 4 | "type": "VCSSUnknownSelector", 5 | "loc": { 6 | "start": { 7 | "line": 5, 8 | "column": 0 9 | }, 10 | "end": { 11 | "line": 5, 12 | "column": 5 13 | } 14 | }, 15 | "start": 50, 16 | "end": 55, 17 | "range": [ 18 | 50, 19 | 55 20 | ], 21 | "value": "\"wow\"", 22 | "selector": "\"wow\"" 23 | } 24 | ] 25 | ] -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/index/string/source.vue: -------------------------------------------------------------------------------- 1 | 4 | 8 | -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/index/stylus-@nest01/selectors-text.json: -------------------------------------------------------------------------------- 1 | [ 2 | [ 3 | ".foo" 4 | ], 5 | [ 6 | ".foo", 7 | ">", 8 | ".bar" 9 | ] 10 | ] -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/index/stylus-@nest01/source.vue: -------------------------------------------------------------------------------- 1 | 4 | 9 | -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/index/stylus-comments01/selectors-text.json: -------------------------------------------------------------------------------- 1 | [ 2 | [ 3 | ".foo" 4 | ], 5 | [ 6 | ".foo", 7 | " ", 8 | ".bar" 9 | ] 10 | ] -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/index/stylus-comments01/source.vue: -------------------------------------------------------------------------------- 1 | 4 | 13 | -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/index/stylus-comments02-in-selector/selectors-text.json: -------------------------------------------------------------------------------- 1 | [ 2 | [ 3 | ".foo" 4 | ], 5 | [ 6 | ".foo", 7 | " ", 8 | ".bar" 9 | ], 10 | [ 11 | ".foo", 12 | " ", 13 | ".baz" 14 | ], 15 | [ 16 | ".foo", 17 | " ", 18 | ".qux" 19 | ], 20 | [ 21 | ".foo", 22 | " ", 23 | ".quux" 24 | ] 25 | ] -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/index/stylus-comments02-in-selector/source.vue: -------------------------------------------------------------------------------- 1 | 4 | 14 | -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/index/stylus-nesting01/selectors-text.json: -------------------------------------------------------------------------------- 1 | [ 2 | [ 3 | "foo", 4 | " ", 5 | "bar", 6 | " ", 7 | "baz" 8 | ], 9 | [ 10 | "foo", 11 | " ", 12 | "bar", 13 | " ", 14 | "baz", 15 | ">", 16 | "input" 17 | ] 18 | ] -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/index/stylus-nesting01/source.vue: -------------------------------------------------------------------------------- 1 | 4 | 9 | -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/index/stylus-nesting02-comb/selectors-text.json: -------------------------------------------------------------------------------- 1 | [ 2 | [ 3 | "textarea" 4 | ], 5 | [ 6 | "input", 7 | ">" 8 | ], 9 | [ 10 | "textarea", 11 | " ", 12 | ".a" 13 | ], 14 | [ 15 | "input", 16 | ">", 17 | ".a" 18 | ] 19 | ] -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/index/stylus-nesting02-comb/source.vue: -------------------------------------------------------------------------------- 1 | 4 | 10 | -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/index/stylus-selector01-ruleset/selectors-text.json: -------------------------------------------------------------------------------- 1 | [ 2 | [ 3 | "textarea" 4 | ], 5 | [ 6 | "input" 7 | ], 8 | [ 9 | "textarea" 10 | ], 11 | [ 12 | "input" 13 | ] 14 | ] -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/index/stylus-selector01-ruleset/source.vue: -------------------------------------------------------------------------------- 1 | 4 | 12 | -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/index/stylus-selector02-parent-ref/selectors-text.json: -------------------------------------------------------------------------------- 1 | [ 2 | [ 3 | "textarea" 4 | ], 5 | [ 6 | "input" 7 | ], 8 | [ 9 | "textarea", 10 | ":hover" 11 | ], 12 | [ 13 | "input", 14 | ":hover" 15 | ] 16 | ] -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/index/stylus-selector02-parent-ref/source.vue: -------------------------------------------------------------------------------- 1 | 4 | 11 | -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/index/stylus-selector03-partial-ref/selectors-text.json: -------------------------------------------------------------------------------- 1 | [ 2 | [ 3 | ".foo" 4 | ], 5 | [ 6 | ".foo__bar" 7 | ], 8 | [ 9 | ".foo", 10 | ":hover", 11 | " ", 12 | ".foo__bar" 13 | ] 14 | ] -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/index/stylus-selector03-partial-ref/source.vue: -------------------------------------------------------------------------------- 1 | 4 | 12 | -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/index/stylus-selector04-partial-ref-minus/selectors-text.json: -------------------------------------------------------------------------------- 1 | [ 2 | [ 3 | ".foo" 4 | ], 5 | [ 6 | ".foo__bar" 7 | ], 8 | [ 9 | ".foo__bar_baz" 10 | ], 11 | [ 12 | ".foo__bar", 13 | ":hover", 14 | " ", 15 | ".foo__bar_baz" 16 | ] 17 | ] -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/index/stylus-selector04-partial-ref-minus/source.vue: -------------------------------------------------------------------------------- 1 | 4 | 13 | -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/index/stylus-selector05-range-partial-ref/selectors-text.json: -------------------------------------------------------------------------------- 1 | [ 2 | [ 3 | ".foo" 4 | ], 5 | [ 6 | ".foo", 7 | " ", 8 | ".bar" 9 | ], 10 | [ 11 | ".foo", 12 | ":hover", 13 | " ", 14 | ".bar" 15 | ] 16 | ] -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/index/stylus-selector05-range-partial-ref/source.vue: -------------------------------------------------------------------------------- 1 | 4 | 12 | -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/index/stylus-selector06-range-partial-ref/selectors-text.json: -------------------------------------------------------------------------------- 1 | [ 2 | [ 3 | ".foo" 4 | ], 5 | [ 6 | ".foo", 7 | " ", 8 | ".bar" 9 | ], 10 | [ 11 | ".foo", 12 | " ", 13 | ".bar", 14 | " ", 15 | ".baz" 16 | ], 17 | [ 18 | ".a", 19 | " ", 20 | ".bar", 21 | " ", 22 | ".baz" 23 | ], 24 | [ 25 | ".b", 26 | " ", 27 | ".bar", 28 | " ", 29 | ".baz" 30 | ] 31 | ] -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/index/stylus-selector06-range-partial-ref/source.vue: -------------------------------------------------------------------------------- 1 | 4 | 14 | -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/index/stylus-selector07-initial-ref/selectors-text.json: -------------------------------------------------------------------------------- 1 | [ 2 | [ 3 | ".block" 4 | ], 5 | [ 6 | ".block__element" 7 | ], 8 | [ 9 | ".block", 10 | ":hover", 11 | " ", 12 | ".block__element" 13 | ] 14 | ] -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/index/stylus-selector07-initial-ref/source.vue: -------------------------------------------------------------------------------- 1 | 4 | 10 | -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/index/stylus-selector08-relative-ref/selectors-text.json: -------------------------------------------------------------------------------- 1 | [ 2 | [ 3 | ".foo" 4 | ], 5 | [ 6 | ".foo", 7 | " ", 8 | ".bar" 9 | ], 10 | [ 11 | ".foo", 12 | " ", 13 | ".bar" 14 | ], 15 | [ 16 | ".foo", 17 | " ", 18 | ".baz" 19 | ] 20 | ] -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/index/stylus-selector08-relative-ref/source.vue: -------------------------------------------------------------------------------- 1 | 4 | 13 | -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/index/stylus-selector09-root-ref/selectors-text.json: -------------------------------------------------------------------------------- 1 | [ 2 | [ 3 | "textarea" 4 | ], 5 | [ 6 | "input" 7 | ], 8 | [ 9 | "textarea", 10 | ":hover" 11 | ], 12 | [ 13 | "input", 14 | ":hover" 15 | ], 16 | [ 17 | ".is-hovered" 18 | ] 19 | ] -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/index/stylus-selector09-root-ref/source.vue: -------------------------------------------------------------------------------- 1 | 4 | 12 | -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/index/stylus01/selectors-text.json: -------------------------------------------------------------------------------- 1 | [ 2 | [ 3 | "body" 4 | ], 5 | [ 6 | "a", 7 | ".button" 8 | ] 9 | ] -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/index/stylus01/selectors.json: -------------------------------------------------------------------------------- 1 | [ 2 | [ 3 | { 4 | "type": "VCSSTypeSelector", 5 | "loc": { 6 | "start": { 7 | "line": 10, 8 | "column": 0 9 | }, 10 | "end": { 11 | "line": 10, 12 | "column": 4 13 | } 14 | }, 15 | "start": 175, 16 | "end": 179, 17 | "range": [ 18 | 175, 19 | 179 20 | ], 21 | "value": "body", 22 | "selector": "body" 23 | } 24 | ], 25 | [ 26 | { 27 | "type": "VCSSTypeSelector", 28 | "loc": { 29 | "start": { 30 | "line": 13, 31 | "column": 0 32 | }, 33 | "end": { 34 | "line": 13, 35 | "column": 1 36 | } 37 | }, 38 | "start": 223, 39 | "end": 224, 40 | "range": [ 41 | 223, 42 | 224 43 | ], 44 | "value": "a", 45 | "selector": "a" 46 | }, 47 | { 48 | "type": "VCSSClassSelector", 49 | "loc": { 50 | "start": { 51 | "line": 13, 52 | "column": 1 53 | }, 54 | "end": { 55 | "line": 13, 56 | "column": 8 57 | } 58 | }, 59 | "start": 224, 60 | "end": 231, 61 | "range": [ 62 | 224, 63 | 231 64 | ], 65 | "value": "button", 66 | "selector": ".button" 67 | } 68 | ] 69 | ] -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/index/stylus01/source.vue: -------------------------------------------------------------------------------- 1 | 4 | 16 | -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/index/stylus02/selectors-text.json: -------------------------------------------------------------------------------- 1 | [ 2 | [ 3 | "body" 4 | ], 5 | [ 6 | "body", 7 | " ", 8 | "button" 9 | ], 10 | [ 11 | "body", 12 | " ", 13 | "button", 14 | ".button" 15 | ], 16 | [ 17 | "body", 18 | " ", 19 | "input", 20 | "[type='button']" 21 | ], 22 | [ 23 | "body", 24 | " ", 25 | "input", 26 | "[type='submit']" 27 | ] 28 | ] -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/index/stylus02/source.vue: -------------------------------------------------------------------------------- 1 | 4 | 13 | -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/index/stylus03/selectors-text.json: -------------------------------------------------------------------------------- 1 | [ 2 | [ 3 | "ul" 4 | ], 5 | [ 6 | "ul", 7 | " ", 8 | "li", 9 | " ", 10 | "a" 11 | ], 12 | [ 13 | "html", 14 | ".ie", 15 | " ", 16 | "ul", 17 | " ", 18 | "li", 19 | " ", 20 | "a" 21 | ], 22 | [ 23 | "ul", 24 | " ", 25 | "li", 26 | " ", 27 | "a", 28 | ":hover" 29 | ] 30 | ] -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/index/stylus03/source.vue: -------------------------------------------------------------------------------- 1 | 4 | 15 | -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/index/stylus04/selectors-text.json: -------------------------------------------------------------------------------- 1 | [ 2 | [ 3 | "table" 4 | ], 5 | [ 6 | "table", 7 | " ", 8 | "tr", 9 | ":nth-child({row})" 10 | ] 11 | ] -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/index/stylus04/source.vue: -------------------------------------------------------------------------------- 1 | 4 | 10 | -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/index/stylus05/selectors-text.json: -------------------------------------------------------------------------------- 1 | [ 2 | [ 3 | "#content" 4 | ] 5 | ] -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/index/stylus05/selectors.json: -------------------------------------------------------------------------------- 1 | [ 2 | [ 3 | { 4 | "type": "VCSSIDSelector", 5 | "loc": { 6 | "start": { 7 | "line": 13, 8 | "column": 0 9 | }, 10 | "end": { 11 | "line": 13, 12 | "column": 8 13 | } 14 | }, 15 | "start": 247, 16 | "end": 255, 17 | "range": [ 18 | 247, 19 | 255 20 | ], 21 | "value": "content", 22 | "selector": "#content" 23 | } 24 | ] 25 | ] -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/index/stylus05/source.vue: -------------------------------------------------------------------------------- 1 | 4 | 16 | -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/index/stylus06/selectors-text.json: -------------------------------------------------------------------------------- 1 | [ 2 | [ 3 | ".a" 4 | ], 5 | [ 6 | ".a" 7 | ] 8 | ] -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/index/stylus06/selectors.json: -------------------------------------------------------------------------------- 1 | [ 2 | [ 3 | { 4 | "type": "VCSSClassSelector", 5 | "loc": { 6 | "start": { 7 | "line": 5, 8 | "column": 0 9 | }, 10 | "end": { 11 | "line": 5, 12 | "column": 2 13 | } 14 | }, 15 | "start": 64, 16 | "end": 66, 17 | "range": [ 18 | 64, 19 | 66 20 | ], 21 | "value": "a", 22 | "selector": ".a" 23 | } 24 | ], 25 | [ 26 | { 27 | "type": "VCSSClassSelector", 28 | "loc": { 29 | "start": { 30 | "line": 8, 31 | "column": 0 32 | }, 33 | "end": { 34 | "line": 8, 35 | "column": 2 36 | } 37 | }, 38 | "start": 75, 39 | "end": 77, 40 | "range": [ 41 | 75, 42 | 77 43 | ], 44 | "value": "a", 45 | "selector": ".a" 46 | } 47 | ] 48 | ] -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/index/stylus06/source.vue: -------------------------------------------------------------------------------- 1 | 4 | 11 | -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/index/syntax-error01/selectors-text.json: -------------------------------------------------------------------------------- 1 | [ 2 | [ 3 | ".foo", 4 | ">", 5 | "li", 6 | ".bar" 7 | ], 8 | [] 9 | ] -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/index/syntax-error01/source.vue: -------------------------------------------------------------------------------- 1 | 4 | 7 | -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/index/test01/selectors-text.json: -------------------------------------------------------------------------------- 1 | [ 2 | [ 3 | ".foo", 4 | ">", 5 | "li", 6 | ".bar" 7 | ] 8 | ] -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/index/test01/source.vue: -------------------------------------------------------------------------------- 1 | 4 | 8 | -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/index/test02/selectors-text.json: -------------------------------------------------------------------------------- 1 | [ 2 | [ 3 | ".foo" 4 | ], 5 | [ 6 | "div", 7 | ".bar", 8 | ">", 9 | "li", 10 | ".baz", 11 | ">>>", 12 | "qux" 13 | ] 14 | ] -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/index/test02/source.vue: -------------------------------------------------------------------------------- 1 | 4 | 11 | -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/index/test03/selectors-text.json: -------------------------------------------------------------------------------- 1 | [ 2 | [ 3 | ".foo" 4 | ], 5 | [ 6 | "div", 7 | ".bar", 8 | ">", 9 | "li", 10 | ".baz", 11 | ">>>", 12 | "qux" 13 | ] 14 | ] -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/index/test03/source.vue: -------------------------------------------------------------------------------- 1 | 4 | 8 | -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/index/test04/selectors-text.json: -------------------------------------------------------------------------------- 1 | [ 2 | [ 3 | ".foo" 4 | ], 5 | [ 6 | "div", 7 | " ", 8 | ".bar", 9 | ">", 10 | "li", 11 | " ", 12 | ".baz", 13 | ">>>", 14 | "qux" 15 | ] 16 | ] -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/index/test04/source.vue: -------------------------------------------------------------------------------- 1 | 4 | 17 | -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/index/test05/selectors-text.json: -------------------------------------------------------------------------------- 1 | [ 2 | [ 3 | ".foo" 4 | ], 5 | [ 6 | ".bar" 7 | ] 8 | ] -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/index/test05/selectors.json: -------------------------------------------------------------------------------- 1 | [ 2 | [ 3 | { 4 | "type": "VCSSClassSelector", 5 | "loc": { 6 | "start": { 7 | "line": 5, 8 | "column": 0 9 | }, 10 | "end": { 11 | "line": 5, 12 | "column": 4 13 | } 14 | }, 15 | "start": 50, 16 | "end": 54, 17 | "range": [ 18 | 50, 19 | 54 20 | ], 21 | "value": "foo", 22 | "selector": ".foo" 23 | } 24 | ], 25 | [ 26 | { 27 | "type": "VCSSClassSelector", 28 | "loc": { 29 | "start": { 30 | "line": 5, 31 | "column": 6 32 | }, 33 | "end": { 34 | "line": 5, 35 | "column": 10 36 | } 37 | }, 38 | "start": 56, 39 | "end": 60, 40 | "range": [ 41 | 56, 42 | 60 43 | ], 44 | "value": "bar", 45 | "selector": ".bar" 46 | } 47 | ] 48 | ] -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/index/test05/source.vue: -------------------------------------------------------------------------------- 1 | 4 | 7 | -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/index/universal/selectors-text.json: -------------------------------------------------------------------------------- 1 | [ 2 | [ 3 | "*", 4 | ">", 5 | "div" 6 | ] 7 | ] -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/index/universal/selectors.json: -------------------------------------------------------------------------------- 1 | [ 2 | [ 3 | { 4 | "type": "VCSSUniversalSelector", 5 | "loc": { 6 | "start": { 7 | "line": 5, 8 | "column": 0 9 | }, 10 | "end": { 11 | "line": 5, 12 | "column": 1 13 | } 14 | }, 15 | "start": 50, 16 | "end": 51, 17 | "range": [ 18 | 50, 19 | 51 20 | ], 21 | "value": "*", 22 | "selector": "*" 23 | }, 24 | { 25 | "type": "VCSSSelectorCombinator", 26 | "loc": { 27 | "start": { 28 | "line": 5, 29 | "column": 2 30 | }, 31 | "end": { 32 | "line": 5, 33 | "column": 3 34 | } 35 | }, 36 | "start": 52, 37 | "end": 53, 38 | "range": [ 39 | 52, 40 | 53 41 | ], 42 | "value": ">", 43 | "selector": ">" 44 | }, 45 | { 46 | "type": "VCSSTypeSelector", 47 | "loc": { 48 | "start": { 49 | "line": 5, 50 | "column": 4 51 | }, 52 | "end": { 53 | "line": 5, 54 | "column": 7 55 | } 56 | }, 57 | "start": 54, 58 | "end": 57, 59 | "range": [ 60 | 54, 61 | 57 62 | ], 63 | "value": "div", 64 | "selector": "div" 65 | } 66 | ] 67 | ] -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/index/universal/source.vue: -------------------------------------------------------------------------------- 1 | 4 | 8 | -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/index/v-deep01/selectors-text.json: -------------------------------------------------------------------------------- 1 | [ 2 | [ 3 | "a", 4 | " ", 5 | "::v-deep", 6 | ".b" 7 | ], 8 | [ 9 | "a", 10 | " ", 11 | "::v-deep(.b)" 12 | ] 13 | ] -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/index/v-deep01/source.vue: -------------------------------------------------------------------------------- 1 | 4 | 13 | -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/selectors/query/adjacent-sibling01/query-result.json: -------------------------------------------------------------------------------- 1 | { 2 | ".foo>li.baz+li+li.bar": [ 3 | "ul.foo>li#d.bar" 4 | ] 5 | } -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/selectors/query/adjacent-sibling01/source.vue: -------------------------------------------------------------------------------- 1 | 11 | 15 | -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/selectors/query/bind-class-expression01/query-result.json: -------------------------------------------------------------------------------- 1 | { 2 | ".foo": [ 3 | "ul>li#a.{a ? 'foo' : 'bar'}", 4 | "ul>li#c.{[c ? 'foo' : bar]}", 5 | "ul>li#d.{[b ? foo : 'a']}" 6 | ], 7 | ".bar": [ 8 | "ul>li#a.{a ? 'foo' : 'bar'}", 9 | "ul>li#c.{[c ? 'foo' : bar]}" 10 | ] 11 | } -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/selectors/query/bind-class-expression01/source.vue: -------------------------------------------------------------------------------- 1 | 13 | 21 | 27 | -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/selectors/query/bind-class-expression02/query-result.json: -------------------------------------------------------------------------------- 1 | { 2 | ".foo": [ 3 | "ul>li#a.{a || 'foo'}", 4 | "ul>li#d.{d && foo}", 5 | "ul>li#e.{[foo || bar]}" 6 | ], 7 | ".bar": [ 8 | "ul>li#b.{b && 'bar'}", 9 | "ul>li#e.{[foo || bar]}", 10 | "ul>li#f.{[bar && 'b']}" 11 | ] 12 | } -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/selectors/query/bind-class-expression02/source.vue: -------------------------------------------------------------------------------- 1 | 17 | 28 | 34 | -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/selectors/query/bind-class01/query-result.json: -------------------------------------------------------------------------------- 1 | { 2 | ".bar": [ 3 | "ul>li#b.{'bar'}", 4 | "ul>li#d.{'qux bar'}", 5 | "ul>li#e.{'quux foo bar'}" 6 | ] 7 | } -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/selectors/query/bind-class01/source.vue: -------------------------------------------------------------------------------- 1 | 10 | 14 | -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/selectors/query/bind-class02/query-result.json: -------------------------------------------------------------------------------- 1 | { 2 | ".bar": [ 3 | "ul>li#b.{['bar',]}", 4 | "ul>li#d.{['qux', 'bar',]}", 5 | "ul>li#e.{['quux', 'foo', 'bar',]}" 6 | ] 7 | } -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/selectors/query/bind-class02/source.vue: -------------------------------------------------------------------------------- 1 | 10 | 14 | -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/selectors/query/bind-class03/query-result.json: -------------------------------------------------------------------------------- 1 | { 2 | ".bar": [ 3 | "ul>li#b.{{ bar: true , }}", 4 | "ul>li#d.{{ qux, bar, }}", 5 | "ul>li#e.{{ quux, foo, 'bar': true, }}", 6 | "ul>li#f.{{ grault, foo, bar: bar, }}", 7 | "ul>li#g.{{ foo, ...garply, }}", 8 | "ul>li#h.{{ [waldo]: true, }}" 9 | ] 10 | } -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/selectors/query/bind-class03/source.vue: -------------------------------------------------------------------------------- 1 | 13 | 17 | -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/selectors/query/bind-class04/query-result.json: -------------------------------------------------------------------------------- 1 | { 2 | ".bar": [ 3 | "ul>li#b.{'bar'}", 4 | "ul>li#d.{'qux'}" 5 | ] 6 | } -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/selectors/query/bind-class04/source.vue: -------------------------------------------------------------------------------- 1 | 19 | 23 | -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/selectors/query/bind-class05/query-result.json: -------------------------------------------------------------------------------- 1 | { 2 | ".bar": [ 3 | "ul>li#a.{classData}", 4 | "ul>li#c.{classComp}", 5 | "ul>li#e.{unknown}", 6 | "ul>li#f.{['foo',classData,]}", 7 | "ul>li#g.{classComp.unknownProp}" 8 | ] 9 | } -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/selectors/query/bind-class05/source.vue: -------------------------------------------------------------------------------- 1 | 30 | 41 | 45 | -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/selectors/query/bind-class06/query-result.json: -------------------------------------------------------------------------------- 1 | { 2 | ".bar": [ 3 | "ul>li#a.{classData}", 4 | "ul>li#c.{classComp}", 5 | "ul>li#e.{unknown}", 6 | "ul>li#f.{['foo',classData,]}", 7 | "ul>li#g.{classComp.unknownProp}" 8 | ] 9 | } -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/selectors/query/bind-class06/source.vue: -------------------------------------------------------------------------------- 1 | 29 | 40 | 44 | -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/selectors/query/bind-id01/query-result.json: -------------------------------------------------------------------------------- 1 | { 2 | "#b": [ 3 | "ul>li#{'b'}.bar", 4 | "ul>li#{b}.qux" 5 | ] 6 | } -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/selectors/query/bind-id01/source.vue: -------------------------------------------------------------------------------- 1 | 10 | 14 | -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/selectors/query/bind-id02/query-result.json: -------------------------------------------------------------------------------- 1 | { 2 | "#b": [ 3 | "ul>li#{'b'}.bar", 4 | "ul>li.qux" 5 | ] 6 | } -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/selectors/query/bind-id02/source.vue: -------------------------------------------------------------------------------- 1 | 20 | 24 | -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/selectors/query/bind-id03/query-result.json: -------------------------------------------------------------------------------- 1 | { 2 | "#b": [ 3 | "ul>li#{idData}.bar", 4 | "ul>li#{idComp}.qux", 5 | "ul>li#{unknown}.corge" 6 | ] 7 | } -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/selectors/query/bind-id03/source.vue: -------------------------------------------------------------------------------- 1 | 29 | 39 | 43 | -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/selectors/query/class-attr01/query-result.json: -------------------------------------------------------------------------------- 1 | { 2 | ".bar": [ 3 | "ul>li#b.bar", 4 | "ul>li#d.qux.bar", 5 | "ul>li#e.quux.foo.bar" 6 | ] 7 | } -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/selectors/query/class-attr01/source.vue: -------------------------------------------------------------------------------- 1 | 12 | 16 | -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/selectors/query/component-tag01/query-result.json: -------------------------------------------------------------------------------- 1 | { 2 | ".foo>div>li.bar": [ 3 | "ul.foo>component>li#a.bar", 4 | "ul.foo>component>li#d.bar" 5 | ] 6 | } -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/selectors/query/component-tag01/source.vue: -------------------------------------------------------------------------------- 1 | 13 | 17 | -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/selectors/query/deep01/query-result.json: -------------------------------------------------------------------------------- 1 | { 2 | "#g>>>.bar": [ 3 | "ul.foo>li#g>ul>li#h.bar", 4 | "ul.foo>li#g>ul>li#k.bar", 5 | "ul.foo>li#g>div#n.bar", 6 | "ul.foo>li#g>div#q.bar" 7 | ], 8 | "#g/deep/.bar": [ 9 | "ul.foo>li#g>ul>li#h.bar", 10 | "ul.foo>li#g>ul>li#k.bar", 11 | "ul.foo>li#g>div#n.bar", 12 | "ul.foo>li#g>div#q.bar" 13 | ], 14 | "#g ::v-deep.bar": [ 15 | "ul.foo>li#g>ul>li#h.bar", 16 | "ul.foo>li#g>ul>li#k.bar", 17 | "ul.foo>li#g>div#n.bar", 18 | "ul.foo>li#g>div#q.bar" 19 | ] 20 | } -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/selectors/query/deep01/source.vue: -------------------------------------------------------------------------------- 1 | 27 | 35 | 36 | -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/selectors/query/general-sibling01/query-result.json: -------------------------------------------------------------------------------- 1 | { 2 | ".foo>li.baz~li~li.bar": [ 3 | "ul.foo>li#d.bar" 4 | ] 5 | } -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/selectors/query/general-sibling01/source.vue: -------------------------------------------------------------------------------- 1 | 11 | 15 | -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/selectors/query/id-attr01/query-result.json: -------------------------------------------------------------------------------- 1 | { 2 | "#b": [ 3 | "ul>li#b.bar" 4 | ] 5 | } -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/selectors/query/id-attr01/source.vue: -------------------------------------------------------------------------------- 1 | 9 | 13 | -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/selectors/query/js-classlist01/query-result.json: -------------------------------------------------------------------------------- 1 | { 2 | ".foo": [ 3 | "ul" 4 | ], 5 | ".bar": [ 6 | "ul" 7 | ], 8 | ".baz": [ 9 | "ul", 10 | "ul>li#a", 11 | "ul>li#b" 12 | ] 13 | } -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/selectors/query/js-classlist01/source.vue: -------------------------------------------------------------------------------- 1 | 12 | 18 | 28 | -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/selectors/query/js-classlist02/query-result.json: -------------------------------------------------------------------------------- 1 | { 2 | ".foo": [ 3 | "ul>li#a" 4 | ], 5 | ".bar": [ 6 | "ul>li#b" 7 | ], 8 | ".baz": [ 9 | "ul>li#b" 10 | ], 11 | ".qux": [ 12 | "ul" 13 | ], 14 | ".quux": [ 15 | "ul" 16 | ] 17 | } -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/selectors/query/js-classlist02/source.vue: -------------------------------------------------------------------------------- 1 | 12 | 18 | 34 | -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/selectors/query/js-classlist03/query-result.json: -------------------------------------------------------------------------------- 1 | { 2 | ".foo": [ 3 | "ul", 4 | "ul>li#a", 5 | "ul>li#b" 6 | ], 7 | ".bar": [ 8 | "ul", 9 | "ul>li#a", 10 | "ul>li#b" 11 | ], 12 | ".baz": [] 13 | } -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/selectors/query/js-classlist03/source.vue: -------------------------------------------------------------------------------- 1 | 9 | 15 | 25 | -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/selectors/query/js-classlist04/query-result.json: -------------------------------------------------------------------------------- 1 | { 2 | ".foo": [], 3 | ".bar": [ 4 | "ul>li#a" 5 | ] 6 | } -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/selectors/query/js-classlist04/source.vue: -------------------------------------------------------------------------------- 1 | 16 | 22 | 29 | -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/selectors/query/js-classlist05/query-result.json: -------------------------------------------------------------------------------- 1 | { 2 | ".foo": [ 3 | "ul>li#a" 4 | ], 5 | ".bar": [ 6 | "ul>li#b" 7 | ], 8 | ".baz": [] 9 | } -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/selectors/query/js-classlist05/source.vue: -------------------------------------------------------------------------------- 1 | 16 | 22 | 32 | -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/selectors/query/js-comcat-literal01/query-result.json: -------------------------------------------------------------------------------- 1 | { 2 | ".foo-bar-baz": [ 3 | "div>div.{classes1}", 4 | "div>div.{classes2}", 5 | "div>div.{classes3}", 6 | "div>div.{classes4}" 7 | ], 8 | ".bar-baz": [ 9 | "div>div.{classes4}" 10 | ], 11 | ".bar": [] 12 | } -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/selectors/query/js-comcat-literal01/source.vue: -------------------------------------------------------------------------------- 1 | 9 | 35 | 43 | -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/selectors/query/js-template-literal01/query-result.json: -------------------------------------------------------------------------------- 1 | { 2 | ".foo-bar-baz": [ 3 | "div>div.{classes1}", 4 | "div>div.{classes2}" 5 | ], 6 | ".bar-baz": [] 7 | } -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/selectors/query/js-template-literal01/source.vue: -------------------------------------------------------------------------------- 1 | 7 | 21 | 27 | -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/selectors/query/scss-interpolation01-selector/query-result.json: -------------------------------------------------------------------------------- 1 | { 2 | ".emoji-#{$name}": [ 3 | "div.emoji-foo" 4 | ] 5 | } -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/selectors/query/scss-interpolation01-selector/source.vue: -------------------------------------------------------------------------------- 1 | 4 | 8 | -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/selectors/query/scss-interpolation02-selector-and-template/query-result.json: -------------------------------------------------------------------------------- 1 | { 2 | ".foo-#{$bar}-baz": [ 3 | "div.{classes}" 4 | ] 5 | } -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/selectors/query/scss-interpolation02-selector-and-template/source.vue: -------------------------------------------------------------------------------- 1 | 4 | 13 | 17 | -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/selectors/query/slot-tag01/query-result.json: -------------------------------------------------------------------------------- 1 | { 2 | ".foo>li.bar": [ 3 | "ul.foo>slot>li#a.bar", 4 | "ul.foo>slot>li#d.bar" 5 | ], 6 | ".foo li.bar": [ 7 | "ul.foo>slot>li#a.bar", 8 | "ul.foo>slot>li#d.bar" 9 | ], 10 | ".foo>div>li.bar": [], 11 | ".foo>div": [ 12 | "ul.foo>slot" 13 | ] 14 | } -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/selectors/query/slot-tag01/source.vue: -------------------------------------------------------------------------------- 1 | 13 | 26 | -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/selectors/query/stylus-interpolation01-selector/query-result.json: -------------------------------------------------------------------------------- 1 | { 2 | ".emoji-{$name}": [ 3 | "div.emoji-foo" 4 | ] 5 | } -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/selectors/query/stylus-interpolation01-selector/source.vue: -------------------------------------------------------------------------------- 1 | 4 | 8 | -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/selectors/query/template-tag01/query-result.json: -------------------------------------------------------------------------------- 1 | { 2 | ".foo>li.bar": [ 3 | "ul.foo>template>li#a.bar", 4 | "ul.foo>template>li#d.bar" 5 | ] 6 | } -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/selectors/query/template-tag01/source.vue: -------------------------------------------------------------------------------- 1 | 13 | 17 | -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/selectors/query/test01/query-result.json: -------------------------------------------------------------------------------- 1 | { 2 | ".foo>li.bar": [ 3 | "ul.foo>li#a.bar", 4 | "ul.foo>li#d.bar" 5 | ] 6 | } -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/selectors/query/test01/source.vue: -------------------------------------------------------------------------------- 1 | 21 | 25 | -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/selectors/query/test02/query-result.json: -------------------------------------------------------------------------------- 1 | { 2 | ".foo li.qux": [ 3 | "ul.foo>li#c.qux", 4 | "ul.foo>li#f.qux", 5 | "ul.foo>li#g>ul>li#j.qux", 6 | "ul.foo>li#g>ul>li#m.qux" 7 | ] 8 | } -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/selectors/query/test02/source.vue: -------------------------------------------------------------------------------- 1 | 21 | 25 | 26 | -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/selectors/query/test03/query-result.json: -------------------------------------------------------------------------------- 1 | { 2 | ".foo>li.qux+li": [ 3 | "ul.foo>li#d.bar", 4 | "ul.foo>li#g" 5 | ] 6 | } -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/selectors/query/test03/source.vue: -------------------------------------------------------------------------------- 1 | 21 | 25 | 26 | -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/selectors/query/test04/query-result.json: -------------------------------------------------------------------------------- 1 | { 2 | ".foo>li.qux~li": [ 3 | "ul.foo>li#d.bar", 4 | "ul.foo>li#e.baz", 5 | "ul.foo>li#f.qux", 6 | "ul.foo>li#g" 7 | ] 8 | } -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/selectors/query/test04/source.vue: -------------------------------------------------------------------------------- 1 | 21 | 25 | 26 | -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/selectors/query/test05/query-result.json: -------------------------------------------------------------------------------- 1 | { 2 | "#g>>>.bar": [ 3 | "ul.foo>li#g>ul>li#h.bar", 4 | "ul.foo>li#g>ul>li#k.bar" 5 | ] 6 | } -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/selectors/query/test05/source.vue: -------------------------------------------------------------------------------- 1 | 21 | 25 | 26 | -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/selectors/query/test06/query-result.json: -------------------------------------------------------------------------------- 1 | { 2 | "#g>*": [ 3 | "ul.foo>li#g>ul" 4 | ], 5 | ".foo>*>*": [ 6 | "ul.foo>li#g>ul" 7 | ] 8 | } -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/selectors/query/test06/source.vue: -------------------------------------------------------------------------------- 1 | 21 | 27 | 28 | -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/selectors/query/universal01/query-result.json: -------------------------------------------------------------------------------- 1 | { 2 | "*": [ 3 | "ul.foo", 4 | "ul.foo>li#a.bar", 5 | "ul.foo>li#b.baz", 6 | "ul.foo>li#c.qux", 7 | "ul.foo>li#d.bar", 8 | "ul.foo>li#e.baz", 9 | "ul.foo>li#f.qux", 10 | "ul.foo>li#g", 11 | "ul.foo>li#g>ul", 12 | "ul.foo>li#g>ul>li#h.bar", 13 | "ul.foo>li#g>ul>li#i.baz", 14 | "ul.foo>li#g>ul>li#j.qux", 15 | "ul.foo>li#g>ul>li#k.bar", 16 | "ul.foo>li#g>ul>li#l.baz", 17 | "ul.foo>li#g>ul>li#m.qux" 18 | ] 19 | } -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/selectors/query/universal01/source.vue: -------------------------------------------------------------------------------- 1 | 21 | 25 | 26 | -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/selectors/query/v-deep01/query-result.json: -------------------------------------------------------------------------------- 1 | { 2 | ".bar ::v-deep#a": [ 3 | "ul.bar>li#a" 4 | ], 5 | ".bar ::v-deep(#a)": [ 6 | "ul.bar>li#a" 7 | ], 8 | ".bar ::v-deep(#a,#b)": [ 9 | "ul.bar>li#a", 10 | "ul.bar>li#b" 11 | ] 12 | } -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/selectors/query/v-deep01/source.vue: -------------------------------------------------------------------------------- 1 | 9 | 17 | -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/selectors/query/v-global01/query-result.json: -------------------------------------------------------------------------------- 1 | { 2 | "::v-global(#a)": [ 3 | "ul.bar>li#a" 4 | ], 5 | "::v-global(#a,#b)": [ 6 | "ul.bar>li#a", 7 | "ul.bar>li#b" 8 | ], 9 | "::v-global(#c,#d)": [ 10 | "ul.bar>li#c", 11 | "ul.bar>li#d" 12 | ], 13 | ".foo ::v-global(#a)": [ 14 | "ul.bar>li#a" 15 | ], 16 | ".foo ::v-global(#a,#b)": [ 17 | "ul.bar>li#a", 18 | "ul.bar>li#b" 19 | ] 20 | } -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/selectors/query/v-global01/reverse-query-result.json: -------------------------------------------------------------------------------- 1 | { 2 | "::v-global(#a)": [ 3 | "ul.bar>li#a" 4 | ], 5 | "::v-global(#a,#b)": [ 6 | "ul.bar>li#a", 7 | "ul.bar>li#b" 8 | ], 9 | "::v-global(#c,#d)": [ 10 | "ul.bar>li#c", 11 | "ul.bar>li#d" 12 | ], 13 | ".foo ::v-global(#a)": [], 14 | ".foo ::v-global(#a,#b)": [] 15 | } -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/selectors/query/v-global01/source.vue: -------------------------------------------------------------------------------- 1 | 9 | 21 | -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/selectors/query/v-slotted01/query-result.json: -------------------------------------------------------------------------------- 1 | { 2 | ".bar ::v-slotted(#a,#c)": [ 3 | "ul.bar>slot", 4 | "ul.bar>slot>li#a" 5 | ], 6 | ".bar ::v-slotted(#a,#b,#c,#d)": [ 7 | "ul.bar>slot", 8 | "ul.bar>slot>li#a", 9 | "ul.bar>slot>li#b" 10 | ] 11 | } -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/selectors/query/v-slotted01/source.vue: -------------------------------------------------------------------------------- 1 | 11 | 17 | -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/selectors/query/vue-computed01/query-result.json: -------------------------------------------------------------------------------- 1 | { 2 | ".bar": [ 3 | "ul>li#a.{classComp}" 4 | ] 5 | } -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/selectors/query/vue-computed01/source.vue: -------------------------------------------------------------------------------- 1 | 13 | 19 | 23 | -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/selectors/query/vue-computed02/query-result.json: -------------------------------------------------------------------------------- 1 | { 2 | ".bar": [ 3 | "ul>li#a.{classComp}" 4 | ] 5 | } -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/selectors/query/vue-computed02/source.vue: -------------------------------------------------------------------------------- 1 | 15 | 21 | 25 | -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/selectors/query/vue-computed03/query-result.json: -------------------------------------------------------------------------------- 1 | { 2 | ".bar": [ 3 | "ul>li#a.{classComp}" 4 | ] 5 | } -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/selectors/query/vue-computed03/source.vue: -------------------------------------------------------------------------------- 1 | 9 | 15 | 19 | -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/selectors/query/vue-computed04/query-result.json: -------------------------------------------------------------------------------- 1 | { 2 | ".bar": [ 3 | "ul>li#a.{classComp}" 4 | ] 5 | } -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/selectors/query/vue-computed04/source.vue: -------------------------------------------------------------------------------- 1 | 15 | 21 | 25 | -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/selectors/query/vue-computed05/query-result.json: -------------------------------------------------------------------------------- 1 | { 2 | ".bar": [ 3 | "ul>li#a.{classComp}" 4 | ] 5 | } -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/selectors/query/vue-computed05/source.vue: -------------------------------------------------------------------------------- 1 | 17 | 23 | 27 | -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/selectors/query/vue-computed06/query-result.json: -------------------------------------------------------------------------------- 1 | { 2 | ".bar": [ 3 | "ul>li#a.{classComp}" 4 | ] 5 | } -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/selectors/query/vue-computed06/source.vue: -------------------------------------------------------------------------------- 1 | 13 | 19 | 23 | -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/selectors/query/vue-computed07/query-result.json: -------------------------------------------------------------------------------- 1 | { 2 | ".bar": [ 3 | "ul>li#a.{classComp}", 4 | "ul>li#b.{classComp2}" 5 | ] 6 | } -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/selectors/query/vue-computed07/source.vue: -------------------------------------------------------------------------------- 1 | 10 | 16 | 20 | -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/selectors/query/vue-computed08/query-result.json: -------------------------------------------------------------------------------- 1 | { 2 | ".bar": [ 3 | "ul>li#a.{classComp}", 4 | "ul>li#b.{classComp2}" 5 | ] 6 | } -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/selectors/query/vue-computed08/source.vue: -------------------------------------------------------------------------------- 1 | 11 | 17 | 21 | -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/selectors/query/vue-computed09/query-result.json: -------------------------------------------------------------------------------- 1 | { 2 | ".bar": [ 3 | "ul>li#a.{classComp}", 4 | "ul>li#b.{classComp2}" 5 | ] 6 | } -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/selectors/query/vue-computed09/source.vue: -------------------------------------------------------------------------------- 1 | 6 | 12 | 16 | -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/selectors/query/vue-computed10-trace-identifier/query-result.json: -------------------------------------------------------------------------------- 1 | { 2 | ".foo": [ 3 | "ul>li#a.{classComp}", 4 | "ul>li#b.{classComp2}", 5 | "ul>li#c.{classComp3}", 6 | "ul>li#d.{classComp4}" 7 | ], 8 | ".bar": [ 9 | "ul>li#c.{classComp3}" 10 | ] 11 | } -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/selectors/query/vue-computed10-trace-identifier/source.vue: -------------------------------------------------------------------------------- 1 | 29 | 37 | 43 | -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/selectors/query/vue-computed11-computed-string/query-result.json: -------------------------------------------------------------------------------- 1 | { 2 | ".foo": [ 3 | "ul>li#a.{classComp}", 4 | "ul>li#b.{classComp2}" 5 | ], 6 | ".bar": [ 7 | "ul>li#c.{classComp3}" 8 | ] 9 | } -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/selectors/query/vue-computed11-computed-string/source.vue: -------------------------------------------------------------------------------- 1 | 22 | 29 | 35 | -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/selectors/query/vue-computed12-spread-array/query-result.json: -------------------------------------------------------------------------------- 1 | { 2 | ".foo": [ 3 | "ul>li#a.{classComp}", 4 | "ul>li#b.{classComp2}" 5 | ], 6 | ".bar": [ 7 | "ul>li#a.{classComp}" 8 | ] 9 | } -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/selectors/query/vue-computed12-spread-array/source.vue: -------------------------------------------------------------------------------- 1 | 14 | 20 | 26 | -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/selectors/query/vue-data01/query-result.json: -------------------------------------------------------------------------------- 1 | { 2 | ".bar": [ 3 | "ul>li#a.{classData}" 4 | ] 5 | } -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/selectors/query/vue-data01/source.vue: -------------------------------------------------------------------------------- 1 | 11 | 17 | 21 | -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/selectors/query/vue-data02/query-result.json: -------------------------------------------------------------------------------- 1 | { 2 | ".bar": [ 3 | "ul>li#a.{classData}" 4 | ] 5 | } -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/selectors/query/vue-data02/source.vue: -------------------------------------------------------------------------------- 1 | 12 | 18 | 22 | -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/selectors/query/vue-data03/query-result.json: -------------------------------------------------------------------------------- 1 | { 2 | ".bar": [ 3 | "ul>li#a.{classData}" 4 | ] 5 | } -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/selectors/query/vue-data03/source.vue: -------------------------------------------------------------------------------- 1 | 9 | 15 | 19 | -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/selectors/query/vue-data04/query-result.json: -------------------------------------------------------------------------------- 1 | { 2 | ".bar": [ 3 | "ul>li#a.{classData}" 4 | ] 5 | } -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/selectors/query/vue-data04/source.vue: -------------------------------------------------------------------------------- 1 | 12 | 18 | 22 | -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/selectors/query/vue-data05/query-result.json: -------------------------------------------------------------------------------- 1 | { 2 | ".bar": [ 3 | "ul>li#a.{classData}" 4 | ] 5 | } -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/selectors/query/vue-data05/source.vue: -------------------------------------------------------------------------------- 1 | 9 | 15 | 19 | -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/selectors/query/vue-data06/query-result.json: -------------------------------------------------------------------------------- 1 | { 2 | ".bar": [ 3 | "ul>li#a.{classData}", 4 | "ul>li#b.{classData2}" 5 | ] 6 | } -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/selectors/query/vue-data06/source.vue: -------------------------------------------------------------------------------- 1 | 8 | 14 | 18 | -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/selectors/query/vue-data07/query-result.json: -------------------------------------------------------------------------------- 1 | { 2 | ".bar": [ 3 | "ul>li#a.{classData}", 4 | "ul>li#b.{classData2}" 5 | ] 6 | } -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/selectors/query/vue-data07/source.vue: -------------------------------------------------------------------------------- 1 | 11 | 17 | 21 | -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/selectors/query/vue-data08/query-result.json: -------------------------------------------------------------------------------- 1 | { 2 | ".bar": [ 3 | "ul>li#a.{classData}", 4 | "ul>li#b.{classData2}" 5 | ] 6 | } -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/selectors/query/vue-data08/source.vue: -------------------------------------------------------------------------------- 1 | 10 | 16 | 20 | -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/selectors/query/vue-data09/query-result.json: -------------------------------------------------------------------------------- 1 | { 2 | ".bar": [ 3 | "ul>li#a.{classData}" 4 | ] 5 | } -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/selectors/query/vue-data09/source.vue: -------------------------------------------------------------------------------- 1 | 11 | 17 | 21 | -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/selectors/query/vue-data10/query-result.json: -------------------------------------------------------------------------------- 1 | { 2 | ".bar": [ 3 | "ul>li#a.{classData}", 4 | "ul>li#b.{classData2}" 5 | ] 6 | } -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/selectors/query/vue-data10/source.vue: -------------------------------------------------------------------------------- 1 | 6 | 12 | 16 | -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/selectors/query/vue-transition-group01/query-result.json: -------------------------------------------------------------------------------- 1 | { 2 | ".v-enter": [ 3 | "div#example-2>transition-group>p#a", 4 | "div#example-2>transition-group>p#c" 5 | ], 6 | ".v-enter-from": [ 7 | "div#example-2>transition-group>p#a", 8 | "div#example-2>transition-group>p#c" 9 | ], 10 | ".v-enter-active": [ 11 | "div#example-2>transition-group>p#a", 12 | "div#example-2>transition-group>p#c" 13 | ], 14 | ".v-enter-to": [ 15 | "div#example-2>transition-group>p#a", 16 | "div#example-2>transition-group>p#c" 17 | ], 18 | ".v-leave": [ 19 | "div#example-2>transition-group>p#a", 20 | "div#example-2>transition-group>p#c" 21 | ], 22 | ".v-leave-from": [ 23 | "div#example-2>transition-group>p#a", 24 | "div#example-2>transition-group>p#c" 25 | ], 26 | ".v-leave-active": [ 27 | "div#example-2>transition-group>p#a", 28 | "div#example-2>transition-group>p#c" 29 | ], 30 | ".v-leave-to": [ 31 | "div#example-2>transition-group>p#a", 32 | "div#example-2>transition-group>p#c" 33 | ], 34 | ".v-move": [ 35 | "div#example-2>transition-group>p#a", 36 | "div#example-2>transition-group>p#c" 37 | ] 38 | } -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/selectors/query/vue-transition-group01/source.vue: -------------------------------------------------------------------------------- 1 | 23 | 43 | -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/selectors/query/vue-transition01/query-result.json: -------------------------------------------------------------------------------- 1 | { 2 | ".v-enter": [ 3 | "div#example-2>transition>p#a", 4 | "div#example-2>transition>p#c" 5 | ], 6 | ".v-enter-from": [ 7 | "div#example-2>transition>p#a", 8 | "div#example-2>transition>p#c" 9 | ], 10 | ".v-enter-active": [ 11 | "div#example-2>transition>p#a", 12 | "div#example-2>transition>p#c" 13 | ], 14 | ".v-enter-to": [ 15 | "div#example-2>transition>p#a", 16 | "div#example-2>transition>p#c" 17 | ], 18 | ".v-leave": [ 19 | "div#example-2>transition>p#a", 20 | "div#example-2>transition>p#c" 21 | ], 22 | ".v-leave-from": [ 23 | "div#example-2>transition>p#a", 24 | "div#example-2>transition>p#c" 25 | ], 26 | ".v-leave-active": [ 27 | "div#example-2>transition>p#a", 28 | "div#example-2>transition>p#c" 29 | ], 30 | ".v-leave-to": [ 31 | "div#example-2>transition>p#a", 32 | "div#example-2>transition>p#c" 33 | ] 34 | } -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/selectors/query/vue-transition01/source.vue: -------------------------------------------------------------------------------- 1 | 23 | 41 | -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/selectors/query/vue-transition02/query-result.json: -------------------------------------------------------------------------------- 1 | { 2 | ".custom-enter": [ 3 | "div#example-2>transition>p#b", 4 | "div#example-2>transition>p#c" 5 | ], 6 | ".custom-enter-from": [ 7 | "div#example-2>transition>p#b", 8 | "div#example-2>transition>p#c" 9 | ], 10 | ".custom-enter-active": [ 11 | "div#example-2>transition>p#b", 12 | "div#example-2>transition>p#c" 13 | ], 14 | ".custom-enter-to": [ 15 | "div#example-2>transition>p#b", 16 | "div#example-2>transition>p#c" 17 | ], 18 | ".custom-leave": [ 19 | "div#example-2>transition>p#b", 20 | "div#example-2>transition>p#c" 21 | ], 22 | ".custom-leave-from": [ 23 | "div#example-2>transition>p#b", 24 | "div#example-2>transition>p#c" 25 | ], 26 | ".custom-leave-active": [ 27 | "div#example-2>transition>p#b", 28 | "div#example-2>transition>p#c" 29 | ], 30 | ".custom-leave-to": [ 31 | "div#example-2>transition>p#b", 32 | "div#example-2>transition>p#c" 33 | ] 34 | } -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/selectors/query/vue-transition02/source.vue: -------------------------------------------------------------------------------- 1 | 23 | 41 | -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/selectors/query/vue-transition03/query-result.json: -------------------------------------------------------------------------------- 1 | { 2 | ".v-enter": [ 3 | "div#example-2>transition>p#a" 4 | ], 5 | ".v-enter-from": [ 6 | "div#example-2>transition>p#a" 7 | ], 8 | ".v-enter-active": [ 9 | "div#example-2>transition>p#a" 10 | ], 11 | ".v-enter-to": [ 12 | "div#example-2>transition>p#a" 13 | ], 14 | ".v-leave": [ 15 | "div#example-2>transition>p#a" 16 | ], 17 | ".v-leave-from": [ 18 | "div#example-2>transition>p#a" 19 | ], 20 | ".v-leave-active": [ 21 | "div#example-2>transition>p#a" 22 | ], 23 | ".v-leave-to": [ 24 | "div#example-2>transition>p#a" 25 | ] 26 | } -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/selectors/query/vue-transition03/source.vue: -------------------------------------------------------------------------------- 1 | 10 | 32 | 50 | -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/selectors/query/vue-transition04/query-result.json: -------------------------------------------------------------------------------- 1 | { 2 | ".custom-enter": [ 3 | "div#example-2>transition>p#b" 4 | ], 5 | ".custom-enter-from": [ 6 | "div#example-2>transition>p#b" 7 | ], 8 | ".custom-enter-active": [ 9 | "div#example-2>transition>p#b" 10 | ], 11 | ".custom-enter-to": [ 12 | "div#example-2>transition>p#b" 13 | ], 14 | ".custom-leave": [ 15 | "div#example-2>transition>p#b" 16 | ], 17 | ".custom-leave-from": [ 18 | "div#example-2>transition>p#b" 19 | ], 20 | ".custom-leave-active": [ 21 | "div#example-2>transition>p#b" 22 | ], 23 | ".custom-leave-to": [ 24 | "div#example-2>transition>p#b" 25 | ] 26 | } -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/selectors/query/vue-transition04/source.vue: -------------------------------------------------------------------------------- 1 | 10 | 32 | 50 | -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/selectors/query/vue-transition05/query-result.json: -------------------------------------------------------------------------------- 1 | { 2 | ".t-enter": [ 3 | "div#example-2>transition>p#c" 4 | ], 5 | ".t-enter-from": [ 6 | "div#example-2>transition>p#c" 7 | ], 8 | ".t-enter-active": [ 9 | "div#example-2>transition>p#c" 10 | ], 11 | ".t-enter-to": [ 12 | "div#example-2>transition>p#c" 13 | ], 14 | ".t-leave": [ 15 | "div#example-2>transition>p#c" 16 | ], 17 | ".t-leave-from": [ 18 | "div#example-2>transition>p#c" 19 | ], 20 | ".t-leave-active": [ 21 | "div#example-2>transition>p#c" 22 | ], 23 | ".t-leave-to": [ 24 | "div#example-2>transition>p#c" 25 | ] 26 | } -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/selectors/query/vue-transition05/source.vue: -------------------------------------------------------------------------------- 1 | 10 | 32 | 50 | -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/selectors/query/vue-transition06/query-result.json: -------------------------------------------------------------------------------- 1 | { 2 | ".ec": [ 3 | "div#example-2>transition>p#c" 4 | ], 5 | ".efc": [ 6 | "div#example-2>transition>p#c" 7 | ], 8 | ".eac": [ 9 | "div#example-2>transition>p#c" 10 | ], 11 | ".etc": [ 12 | "div#example-2>transition>p#c" 13 | ], 14 | ".lc": [ 15 | "div#example-2>transition>p#d" 16 | ], 17 | ".lfc": [ 18 | "div#example-2>transition>p#d" 19 | ], 20 | ".lac": [ 21 | "div#example-2>transition>p#d" 22 | ], 23 | ".ltc": [ 24 | "div#example-2>transition>p#d" 25 | ] 26 | } -------------------------------------------------------------------------------- /tests/lib/styles/fixtures/selectors/query/vue-transition07/query-result.json: -------------------------------------------------------------------------------- 1 | { 2 | ".foo": [ 3 | "div#example-2>transition>p#c", 4 | "div#example-2>transition>p#d" 5 | ] 6 | } -------------------------------------------------------------------------------- /tests/lib/test-lib/eslint-compat.ts: -------------------------------------------------------------------------------- 1 | import { 2 | getRuleTester, 3 | getRuleIdPrefix, 4 | } from "eslint-compat-utils/rule-tester"; 5 | import { getLegacyESLint, getESLint } from "eslint-compat-utils/eslint"; 6 | 7 | // eslint-disable-next-line @typescript-eslint/naming-convention -- Class name 8 | export const RuleTester = getRuleTester(); 9 | export const testRuleIdPrefix = getRuleIdPrefix(); 10 | 11 | // eslint-disable-next-line @typescript-eslint/naming-convention -- Class name 12 | export const LegacyESLint = getLegacyESLint(); 13 | // eslint-disable-next-line @typescript-eslint/naming-convention -- Class name 14 | export const ESLint = getESLint(); 15 | -------------------------------------------------------------------------------- /tools/lib/load-configs.ts: -------------------------------------------------------------------------------- 1 | import path from "path"; 2 | import fs from "fs"; 3 | import { isDefined } from "../../lib/utils/utils"; 4 | 5 | type Config = { 6 | name: string; 7 | configId: string; 8 | config: { rules?: Record; extends?: string | string[] }; 9 | path: string; 10 | extends: Config[]; 11 | }; 12 | 13 | /** 14 | * Get the all configs 15 | * @returns {Array} The all configs 16 | */ 17 | function readConfigs(): Config[] { 18 | const configsRoot = path.resolve(__dirname, "../../lib/configs"); 19 | const result = fs.readdirSync(configsRoot, { withFileTypes: true }); 20 | const configs = []; 21 | for (const dirent of result) { 22 | if (!dirent.isFile()) continue; 23 | const configName = dirent.name.replace(/\.ts$/u, ""); 24 | const configId = `plugin:vue-scoped-css/${configName}`; 25 | const configPath = require.resolve(path.join(configsRoot, dirent.name)); 26 | 27 | const config = require(configPath); 28 | configs.push({ 29 | name: configName, 30 | configId, 31 | config, 32 | path: configPath, 33 | extends: [], 34 | }); 35 | } 36 | return configs; 37 | } 38 | 39 | export const configs = readConfigs(); 40 | 41 | for (const config of configs) { 42 | const extendsList: string[] = !config.config.extends 43 | ? [] 44 | : Array.isArray(config.config.extends) 45 | ? config.config.extends 46 | : [config.config.extends]; 47 | config.extends = extendsList 48 | .map((p) => configs.find((c) => c.path === p)) 49 | .filter(isDefined); 50 | } 51 | -------------------------------------------------------------------------------- /tools/lib/load-rules.ts: -------------------------------------------------------------------------------- 1 | import path from "path"; 2 | import fs from "fs"; 3 | 4 | /** 5 | * Get the all rules 6 | * @returns {Array} The all rules 7 | */ 8 | function readRules() { 9 | // const rulesDistRoot = path.resolve(__dirname, "../../dist/rules") 10 | const rulesLibRoot = path.resolve(__dirname, "../../lib/rules"); 11 | const result = fs.readdirSync(rulesLibRoot); 12 | const rules = []; 13 | for (const name of result) { 14 | const ruleName = name.replace(/\.ts$/u, ""); 15 | const ruleId = `vue-scoped-css/${ruleName}`; 16 | const rule = require(path.join(rulesLibRoot, name)); 17 | 18 | rule.meta.docs.ruleName = ruleName; 19 | rule.meta.docs.ruleId = ruleId; 20 | 21 | rules.push(rule); 22 | } 23 | return rules; 24 | } 25 | 26 | export const rules = readRules(); 27 | -------------------------------------------------------------------------------- /tools/update-docs-rules-index.ts: -------------------------------------------------------------------------------- 1 | import path from "path"; 2 | import fs from "fs"; 3 | import renderRulesTableContent from "./render-rules"; 4 | 5 | // ----------------------------------------------------------------------------- 6 | const readmeFilePath = path.resolve(__dirname, "../docs/rules/index.md"); 7 | fs.writeFileSync( 8 | readmeFilePath, 9 | `--- 10 | sidebarDepth: 0 11 | --- 12 | 13 | # Available Rules 14 | 15 | 16 | ${renderRulesTableContent()}`, 17 | ); 18 | -------------------------------------------------------------------------------- /tools/update.ts: -------------------------------------------------------------------------------- 1 | import "./update-rules"; 2 | import "./update-docs"; 3 | import "./update-readme"; 4 | import "./update-docs-rules-index"; 5 | -------------------------------------------------------------------------------- /tsconfig.build.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "exclude": ["tests/**/*", "tools/**/*"], 4 | "compilerOptions": { 5 | "removeComments": true /* Do not emit comments to output. */, 6 | "declaration": true 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es2015", 4 | "module": "node16", 5 | "allowJs": true, 6 | "checkJs": true, 7 | "outDir": "./dist", 8 | "strict": true, 9 | "noImplicitAny": true, 10 | 11 | "noUnusedLocals": true, 12 | "noUnusedParameters": true, 13 | "noImplicitReturns": true, 14 | "noFallthroughCasesInSwitch": true, 15 | 16 | "baseUrl": ".", 17 | "paths": { 18 | "*": ["typings/*"] 19 | }, 20 | "esModuleInterop": true, 21 | 22 | "skipLibCheck": true 23 | }, 24 | "include": ["lib/**/*", "tests/**/*", "tools/**/*"] 25 | } 26 | -------------------------------------------------------------------------------- /typings/@eslint-community/eslint-utils/index.d.ts: -------------------------------------------------------------------------------- 1 | import type { AST } from "../../../lib/types"; 2 | import type { Scope } from "eslint-scope"; 3 | 4 | declare const utils: { 5 | getStaticValue: ( 6 | node: AST.ESLintExpression, 7 | scope: Scope, 8 | ) => null | { 9 | // eslint-disable-next-line @typescript-eslint/no-explicit-any -- ignore 10 | value: any; 11 | }; 12 | }; 13 | export default utils; 14 | -------------------------------------------------------------------------------- /typings/postcss-safe-parser/index.d.ts: -------------------------------------------------------------------------------- 1 | import postcss from "postcss"; 2 | 3 | export default postcss.parse; 4 | -------------------------------------------------------------------------------- /typings/postcss-scss/index.d.ts: -------------------------------------------------------------------------------- 1 | import type * as postcss from "postcss"; 2 | 3 | declare module "postcss-scss" { 4 | const parse: postcss.Parser, stringify: postcss.Stringifier; 5 | } 6 | -------------------------------------------------------------------------------- /typings/postcss-styl/index.d.ts: -------------------------------------------------------------------------------- 1 | import type * as postcss from "postcss"; 2 | 3 | declare module "postcss-styl" { 4 | const parse: postcss.Parser, stringify: postcss.Stringifier; 5 | } 6 | --------------------------------------------------------------------------------