-
-
Notifications
You must be signed in to change notification settings - Fork 44
ESLint flat config support #484
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@ota-meshi thank you for the update! The flat config support is a good step forward! However, there's another issue after installing
import vueI18n from '@intlify/eslint-plugin-vue-i18n'
import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended'
import vitest from 'eslint-plugin-vitest'
import withNuxt from './.nuxt/eslint.config.mjs'
/** @type {import('eslint').Linter.FlatConfig[]} */
export default withNuxt([
{
ignores: [
'.nitro/**',
'.nuxt/**',
'.output/**',
'.vscode/**',
'dist/**',
'node_modules/**',
'coverage/**',
],
},
{
files: ['**/*.ts', '**/*.tsx', '**/*.mts', '**/*.cts', '**/*.vue'],
rules: {
'@typescript-eslint/no-unused-vars': [
'error',
{
argsIgnorePattern: '^_',
varsIgnorePattern: '^_',
},
],
'vue/no-v-html': 'off',
},
},
{
files: ['tests/**'],
plugins: {
vitest,
},
rules: {
...vitest.configs.recommended.rules,
},
languageOptions: {
globals: {
...vitest.environments.env.globals,
},
},
},
eslintPluginPrettierRecommended,
// Refers to https://eslint-plugin-vue-i18n.intlify.dev/started.html
...vueI18n.configs['flat/recommended'],
{
rules: {
// Optional.
'@intlify/vue-i18n/no-dynamic-keys': 'error',
'@intlify/vue-i18n/no-unused-keys': [
'error',
{
extensions: ['.js', '.ts', '.vue'],
},
],
},
settings: {
'vue-i18n': {
// extension is glob formatting!
localeDir: './locales/*.{json,json5,yaml,yml}',
// Specify the version of `vue-i18n` you are using.
// If not specified, the message will be parsed twice.
messageSyntaxVersion: '^9.0.0',
},
},
},
]) |
@maxdzin eslint-plugin-vue-i18n supports flat config and this issue of flat config support has been resolved. flat config can be debugged with config-inspector. Thank you! |
Tell us about your environment
The problem you want to solve.
A possibility to use the
@intlify/eslint-plugin-vue-i18n
plugin, its rules, etc. in theeslint.config.mjs
configuration file.Your take on the correct solution to problem.
I tried to import the plugin but it seems not working or I'm doing it wrong. Here's how I tried to use that:
Additional context
And so the error I got:
The text was updated successfully, but these errors were encountered: