diff --git a/docs/.vitepress/build-system/src/eslint.mjs b/docs/.vitepress/build-system/src/eslint.mjs index 6604e0bb4..ed193b58b 100644 --- a/docs/.vitepress/build-system/src/eslint.mjs +++ b/docs/.vitepress/build-system/src/eslint.mjs @@ -1,5 +1,8 @@ // @ts-nocheck -import * as all from '../../../../node_modules/eslint/lib/linter/linter.js' -const Linter = all.Linter -export { Linter } -export default { Linter } +/* eslint-disable unicorn/prefer-export-from -- exporting as named and default is less duplication without `export…from` */ + +import { Linter } from '../../../../node_modules/eslint/lib/linter/linter.js' +import SourceCode from '../../../../node_modules/eslint/lib/source-code/source-code.js' + +export { Linter, SourceCode } +export default { Linter, SourceCode } diff --git a/docs/rules/define-macros-order.md b/docs/rules/define-macros-order.md index 5d8dda56c..6dbe5ef07 100644 --- a/docs/rules/define-macros-order.md +++ b/docs/rules/define-macros-order.md @@ -2,20 +2,20 @@ pageClass: rule-details sidebarDepth: 0 title: vue/define-macros-order -description: enforce order of `defineEmits` and `defineProps` compiler macros +description: enforce order of compiler macros (`defineProps`, `defineEmits`, etc.) since: v8.7.0 --- # vue/define-macros-order -> enforce order of `defineEmits` and `defineProps` compiler macros +> enforce order of compiler macros (`defineProps`, `defineEmits`, etc.) - :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. - :bulb: Some problems reported by this rule are manually fixable by editor [suggestions](https://eslint.org/docs/developer-guide/working-with-rules#providing-suggestions). ## :book: Rule Details -This rule reports the `defineProps` and `defineEmits` compiler macros when they are not the first statements in ` +``` + + + + + +```vue + + +``` + + + ### `{ "defineExposeLast": true }` diff --git a/docs/rules/define-props-declaration.md b/docs/rules/define-props-declaration.md index 5c72d538a..40c5ea0b0 100644 --- a/docs/rules/define-props-declaration.md +++ b/docs/rules/define-props-declaration.md @@ -47,7 +47,7 @@ const props = defineProps({ ### `"runtime"` - + ```vue +``` + + + +### `{ maxProps: 5 }` + + + +```vue + + +``` + + + +## :rocket: Version + +This rule was introduced in eslint-plugin-vue v9.28.0 + +## :mag: Implementation + +- [Rule source](https://github.com/vuejs/eslint-plugin-vue/blob/master/lib/rules/max-props.js) +- [Test source](https://github.com/vuejs/eslint-plugin-vue/blob/master/tests/lib/rules/max-props.js) diff --git a/docs/rules/max-template-depth.md b/docs/rules/max-template-depth.md new file mode 100644 index 000000000..42ee4da88 --- /dev/null +++ b/docs/rules/max-template-depth.md @@ -0,0 +1,70 @@ +--- +pageClass: rule-details +sidebarDepth: 0 +title: vue/max-template-depth +description: enforce maximum depth of template +since: v9.28.0 +--- + +# vue/max-template-depth + +> enforce maximum depth of template + +## :book: Rule Details + +This rule enforces a maximum depth of the template in a Vue SFC, in order to aid in maintainability and reduce complexity. + +## :wrench: Options + +This rule takes an object, where you can specify the maximum depth allowed in a Vue SFC template block. +There is one property that can be specified for the object. + +- `maxDepth` ... Specify the maximum template depth `template` block. + +### `{ maxDepth: 3 }` + + + +```vue + + +``` + + + + + +```vue + + +``` + + + +## :rocket: Version + +This rule was introduced in eslint-plugin-vue v9.28.0 + +## :mag: Implementation + +- [Rule source](https://github.com/vuejs/eslint-plugin-vue/blob/master/lib/rules/max-template-depth.js) +- [Test source](https://github.com/vuejs/eslint-plugin-vue/blob/master/tests/lib/rules/max-template-depth.js) diff --git a/docs/rules/no-computed-properties-in-data.md b/docs/rules/no-computed-properties-in-data.md index 35bf62f1d..26c49cbbc 100644 --- a/docs/rules/no-computed-properties-in-data.md +++ b/docs/rules/no-computed-properties-in-data.md @@ -2,13 +2,13 @@ pageClass: rule-details sidebarDepth: 0 title: vue/no-computed-properties-in-data -description: disallow accessing computed properties in `data`. +description: disallow accessing computed properties in `data` since: v7.20.0 --- # vue/no-computed-properties-in-data -> disallow accessing computed properties in `data`. +> disallow accessing computed properties in `data` - :gear: This rule is included in all of `"plugin:vue/vue3-essential"`, `*.configs["flat/essential"]`, `"plugin:vue/essential"`, `*.configs["flat/vue2-essential"]`, `"plugin:vue/vue3-strongly-recommended"`, `*.configs["flat/strongly-recommended"]`, `"plugin:vue/strongly-recommended"`, `*.configs["flat/vue2-strongly-recommended"]`, `"plugin:vue/vue3-recommended"`, `*.configs["flat/recommended"]`, `"plugin:vue/recommended"` and `*.configs["flat/vue2-recommended"]`. diff --git a/docs/rules/no-template-shadow.md b/docs/rules/no-template-shadow.md index 29eacacc0..9d74e1f12 100644 --- a/docs/rules/no-template-shadow.md +++ b/docs/rules/no-template-shadow.md @@ -55,7 +55,7 @@ This rule takes one optional object option, with the property `"allow"`. ```json { - "no-template-shadow": ["error", { "allow": [] }] + "vue/no-template-shadow": ["error", { "allow": [] }] } ``` diff --git a/docs/rules/one-component-per-file.md b/docs/rules/one-component-per-file.md index 6fbede339..5e6b37518 100644 --- a/docs/rules/one-component-per-file.md +++ b/docs/rules/one-component-per-file.md @@ -49,6 +49,10 @@ export default { Nothing. +## :couple: Related Rules + +- [vue/require-default-export](./require-default-export.md) + ## :books: Further Reading - [Style guide - Component files](https://vuejs.org/style-guide/rules-strongly-recommended.html#component-files) diff --git a/docs/rules/prefer-define-options.md b/docs/rules/prefer-define-options.md index b63207957..5653cb011 100644 --- a/docs/rules/prefer-define-options.md +++ b/docs/rules/prefer-define-options.md @@ -2,13 +2,13 @@ pageClass: rule-details sidebarDepth: 0 title: vue/prefer-define-options -description: enforce use of `defineOptions` instead of default export. +description: enforce use of `defineOptions` instead of default export since: v9.13.0 --- # vue/prefer-define-options -> enforce use of `defineOptions` instead of default export. +> enforce use of `defineOptions` instead of default export - :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. diff --git a/docs/rules/quote-props.md b/docs/rules/quote-props.md index d568a952b..4d2b62d03 100644 --- a/docs/rules/quote-props.md +++ b/docs/rules/quote-props.md @@ -2,13 +2,13 @@ pageClass: rule-details sidebarDepth: 0 title: vue/quote-props -description: Require quotes around object literal property names in `