intlify / eslint-plugin-svelte

ESLint plugin for internationalization with Svelte
MIT License
4 stars 2 forks source link

Example eslint v9 config #17

Open LucasHillDex opened 1 week ago

LucasHillDex commented 1 week ago

Would it be possible to provide a config that will work with the new flat config format in eslint v9?

I see that support was added in this PR: https://github.com/intlify/eslint-plugin-svelte/pull/12

However, when I look at the code I don't see an exported config that is compatible with v9. All the exported configs use the old "extends" format https://github.com/intlify/eslint-plugin-svelte/blob/main/lib/configs/recommended.ts. I could totally be missing it though.

Thanks!

LucasHillDex commented 1 week ago

I was able to get this working by using the eslint compat helper..

import { fixupPluginRules } from '@eslint/compat';
import intlifySvelte from '@intlify/eslint-plugin-svelte';

const intlifyFixedPlugin = fixupPluginRules(intlifySvelte);

export default [
  {
    plugins: {
      '@intlify/svelte': intlifyFixedPlugin
    },
    rules: {
      '@intlify/svelte/no-raw-text': 'error'
    },
    ignores: ['**/*.test.svelte']
  },

But a native flat config format would be great!

ota-meshi commented 1 week ago

Oh, the plugin doesn't provide flat config yet. Could you please consider opening a PR if possible?