diff --git a/.eslintrc.cjs b/.eslintrc.cjs index 2572e2becd9..59f81c46ba9 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -119,5 +119,11 @@ module.exports = { 'no-undef': 'off', }, }, + { + files: ['website/**/*.mdx/**'], + rules: { + 'import/no-default-export': 'off', + }, + }, ], }; diff --git a/examples/svelte-code-file/eslint.config.js b/examples/svelte-code-file/eslint.config.js index 53f51e6574f..948fd269593 100644 --- a/examples/svelte-code-file/eslint.config.js +++ b/examples/svelte-code-file/eslint.config.js @@ -1,18 +1,28 @@ -import svelteParser from 'svelte-eslint-parser'; +import { mergeProcessors } from 'eslint-merge-processors'; +import eslintPluginSvelte from 'eslint-plugin-svelte'; +import processorVueBlocks from 'eslint-processor-vue-blocks'; import js from '@eslint/js'; import graphqlPlugin from '@graphql-eslint/eslint-plugin'; export default [ { - files: ['**/*.js', '**/*.svelte'], + files: ['**/*.js'], processor: graphqlPlugin.processor, rules: js.configs.recommended.rules, }, + ...eslintPluginSvelte.configs['flat/recommended'], { files: ['**/*.svelte'], - languageOptions: { - parser: svelteParser, - }, + // `eslint-plugin-svelte` will set a default processor for `.svelte` files + // we use `eslint-merge-processors` to extend it + processor: mergeProcessors([ + eslintPluginSvelte.processors.svelte, + processorVueBlocks({ + blocks: { + script: true, + }, + }), + ]), }, { files: ['**/*.graphql'], diff --git a/examples/svelte-code-file/package.json b/examples/svelte-code-file/package.json index a5abc781018..a8cd773a71e 100644 --- a/examples/svelte-code-file/package.json +++ b/examples/svelte-code-file/package.json @@ -13,8 +13,8 @@ "devDependencies": { "@graphql-eslint/eslint-plugin": "workspace:*", "eslint": "9.14.0", - "svelte": "5.2.4", - "svelte-eslint-parser": "0.43.0", - "svelte2tsx": "0.7.26" + "eslint-merge-processors": "^0.1.0", + "eslint-plugin-svelte": "^2.46.0", + "eslint-processor-vue-blocks": "^0.1.2" } } diff --git a/examples/svelte-code-file/test.svelte b/examples/svelte-code-file/test.svelte index 3418360b22d..58278e9e9bf 100644 --- a/examples/svelte-code-file/test.svelte +++ b/examples/svelte-code-file/test.svelte @@ -1,6 +1,4 @@