-
-
Notifications
You must be signed in to change notification settings - Fork 47
Closed
Labels
help wantedExtra attention is neededExtra attention is needed
Description
Tell us about your environment
- ESLint version: 9.18.0
- eslint-plugin-vue version: 9.32.0
- eslint-plugin-vue-i18n version: 3.2.0
- Node version: 20.11.0
- TypeScript version: 5.7.3
The problem you want to solve.
The plugin does not work well with ESLint TypeScript configuration files (i.e. eslint.config.ts
instead of eslint.config.js
) because there is no type declaration in the package.
The following TypeScript error is raised:
error TS7016: Could not find a declaration file for module '@intlify/eslint-plugin-vue-i18n'
Your take on the correct solution to problem.
Because the plugin is already written in TypeScript, it should probably work with the following modifications:
- In
tsconfig.build.json
, setcompilerOptions.declaration
totrue
- In
package.json
, settypes
todist/index.d.ts
Additional context
A workaround for the issue is to add a dummy declaration file eslint-plugin-vue-i18n.d.ts
that looks like this:
declare module '@intlify/eslint-plugin-vue' {
declare const plugin: {
configs: {
base: unknown
recommended: unknown
'flat/base': unknown
'flat/recommended': unknown
}
rules: {
'key-format-style': unknown
'no-deprecated-i18n-component': unknown
'no-deprecated-i18n-place-attr': unknown
'no-deprecated-i18n-places-prop': unknown
'no-deprecated-modulo-syntax': unknown
'no-deprecated-tc': unknown
'no-deprecated-v-t': unknown
'no-duplicate-keys-in-locale': unknown
'no-dynamic-keys': unknown
'no-html-messages': unknown
'no-i18n-t-path-prop': unknown
'no-missing-keys-in-other-locales': unknown
'no-missing-keys': unknown
'no-raw-text': unknown
'no-unknown-locale': unknown
'no-unused-keys': unknown
'no-v-html': unknown
'prefer-linked-key-with-paren': unknown
'prefer-sfc-lang-attr': unknown
'sfc-locale-attr': unknown
'valid-message-syntax': unknown
}
}
export default plugin
}
Of course, having the real type declarations would be better.
Metadata
Metadata
Assignees
Labels
help wantedExtra attention is neededExtra attention is needed