eslint-plugin-vue-types integrates `vue-types` with `eslint-plugin-vue`, specifically addressing the `vue/require-default-prop` rule. It prevents ESLint from reporting errors for props defined using `vue-types` validators (e.g., `VueTypes.string` or `string().isRequired`). The plugin's current stable version is 2.1.0. It primarily serves environments using `eslint-plugin-vue` versions older than 7.0.0. For `eslint-plugin-vue@7` and later, this plugin is generally not needed as the upstream `vue/require-default-prop` rule inherently ignores call expressions and object properties, negating the problem this plugin solves. Its release cadence is sporadic, reacting to changes in its peer dependencies, especially `eslint-plugin-vue` and `vue-types`. A key differentiator is its focused scope on a single `vue-types`-specific rule extension.
npm install eslint-plugin-vue-typesVerified import paths — ran on the pinned version, not inferred.
Demonstrates the `.eslintrc.json` configuration for `eslint-plugin-vue-types` and a Vue component showcasing how the plugin prevents `vue/require-default-prop` errors for `vue-types` definitions, including custom namespaces and import sources.
Upgrade Node.js to version 10 or higher, or downgrade `eslint-plugin-vue-types` to a version prior to 1.0.0.
Consider upgrading `eslint-plugin-vue` to version 7 or later. If you do, you can likely remove `eslint-plugin-vue-types` from your project as it will no longer be necessary.
Always place `.isRequired` at the very end of your `vue-types` validator chain, e.g., `shape({}).loose.isRequired` is correct, while `shape({}).isRequired.loose` is incorrect.Add `"vue-types/namespace": ["MyCustomNamespace"]` to the `settings` object in your ESLint configuration.
Add `"vue-types/sources": ["~/utils/prop-types"]` to the `settings` object in your ESLint configuration, pointing to your custom validator modules.
Upgrade `eslint-plugin-vue-types` to version 1.0.1 or newer to resolve the `@typescript-eslint/parser` compatibility bug.
Ensure `plugin:vue-types/recommended` is included in your `extends` array *after* any `plugin:vue/*` presets. Verify that `eslint-plugin-vue` is at least version `^6.0.0` as required by peer dependencies. Also, check `.isRequired` placement and custom settings.