From 815bed4bc58986641393c27ad911a71f6063deb0 Mon Sep 17 00:00:00 2001 From: Daniel Waltz Date: Mon, 20 Jun 2022 14:05:29 -0400 Subject: [PATCH] feat: support script setup and css var inj for vue 2.7 Closes #1916 --- docs/rules/no-unsupported-features.md | 5 +-- lib/rules/no-unsupported-features.js | 14 ++++---- lib/rules/syntaxes/script-setup.js | 2 +- .../syntaxes/style-css-vars-injection.js | 2 +- .../no-unsupported-features/script-setup.js | 8 ++++- .../style-css-vars-injection.js | 33 +++++++++++++++++-- 6 files changed, 51 insertions(+), 13 deletions(-) diff --git a/docs/rules/no-unsupported-features.md b/docs/rules/no-unsupported-features.md index 799b456cb..cc9efab3a 100644 --- a/docs/rules/no-unsupported-features.md +++ b/docs/rules/no-unsupported-features.md @@ -36,11 +36,12 @@ The `"ignores"` option accepts an array of the following strings. - Vue.js 3.1.0+ - `"is-attribute-with-vue-prefix"` ... [`is` attribute with `vue:` prefix](https://v3.vuejs.org/api/special-attributes.html#is) - Vue.js 3.0.0+ - - `"style-css-vars-injection"` ... [SFC CSS variable injection][Vue RFCs - 0043-sfc-style-variables] - - `"script-setup"` ... [``, options: buildOptions() }, + { + code: ` + `, + options: buildOptions({ version: '^2.7.0' }) + }, { code: ` + + `, + options: buildOptions({ version: '^2.7.0' }) + }, + { + code: ` + + @@ -98,7 +127,7 @@ tester.run('no-unsupported-features/style-css-vars-injection', rule, { errors: [ { message: - 'SFC CSS variable injection is not supported until Vue.js "3.0.3".', + 'SFC CSS variable injection is not supported until Vue.js ">=3.0.3 || >=2.7.0 <3.0.0".', line: 21, column: 18, endLine: 21, @@ -106,7 +135,7 @@ tester.run('no-unsupported-features/style-css-vars-injection', rule, { }, { message: - 'SFC CSS variable injection is not supported until Vue.js "3.0.3".', + 'SFC CSS variable injection is not supported until Vue.js ">=3.0.3 || >=2.7.0 <3.0.0".', line: 24, column: 22, endLine: 24,