diff --git a/examples/with-sveltekit/.eslintignore b/examples/with-sveltekit/.eslintignore deleted file mode 100644 index 3897265..0000000 --- a/examples/with-sveltekit/.eslintignore +++ /dev/null @@ -1,13 +0,0 @@ -.DS_Store -node_modules -/build -/.svelte-kit -/package -.env -.env.* -!.env.example - -# Ignore files for PNPM, NPM and YARN -pnpm-lock.yaml -package-lock.json -yarn.lock diff --git a/examples/with-sveltekit/.eslintrc.cjs b/examples/with-sveltekit/.eslintrc.cjs deleted file mode 100644 index 350b10b..0000000 --- a/examples/with-sveltekit/.eslintrc.cjs +++ /dev/null @@ -1,26 +0,0 @@ -/** @type { import("eslint").Linter.Config } */ -module.exports = { - root: true, - extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended', 'plugin:svelte/recommended', 'prettier'], - parser: '@typescript-eslint/parser', - plugins: ['@typescript-eslint'], - parserOptions: { - sourceType: 'module', - ecmaVersion: 2020, - extraFileExtensions: ['.svelte'] - }, - env: { - browser: true, - es2017: true, - node: true - }, - overrides: [ - { - files: ['*.svelte'], - parser: 'svelte-eslint-parser', - parserOptions: { - parser: '@typescript-eslint/parser' - } - } - ] -}; diff --git a/examples/with-sveltekit/eslint.config.mjs b/examples/with-sveltekit/eslint.config.mjs new file mode 100644 index 0000000..ea3e493 --- /dev/null +++ b/examples/with-sveltekit/eslint.config.mjs @@ -0,0 +1,45 @@ +import js from '@eslint/js'; +import ts from 'typescript-eslint'; +import svelte from 'eslint-plugin-svelte'; +import prettier from 'eslint-config-prettier'; +import globals from 'globals'; + +export default [ + { + ignores: [ + '.DS_Store', + 'node_modules/', + 'build/', + '.svelte-kit/', + 'package/', + 'dist/', + '.env', + '.env.*', + '!.env.example', + 'pnpm-lock.yaml', + 'package-lock.json', + 'yarn.lock' + ] + }, + js.configs.recommended, + ...ts.configs.recommended, + ...svelte.configs['flat/recommended'], + prettier, + ...svelte.configs['flat/prettier'], + { + languageOptions: { + globals: { + ...globals.browser, + ...globals.node + } + } + }, + { + files: ['**/*.svelte'], + languageOptions: { + parserOptions: { + parser: ts.parser + } + } + } +]; diff --git a/packages/svelte-reveal/eslint.config.mjs b/packages/svelte-reveal/eslint.config.mjs index 22c1dcd..0f752d5 100644 --- a/packages/svelte-reveal/eslint.config.mjs +++ b/packages/svelte-reveal/eslint.config.mjs @@ -1,6 +1,5 @@ -import tseslint from '@typescript-eslint/eslint-plugin'; -import tsParser from '@typescript-eslint/parser'; -import eslint from '@eslint/js'; +import js from '@eslint/js'; +import ts from 'typescript-eslint'; import turbo from 'eslint-config-turbo'; import prettier from 'eslint-config-prettier'; @@ -33,14 +32,14 @@ export default [ '**/next-env.d.ts' ] }, - eslint.configs.recommended, - ...tseslint.configs.recommended, + js.configs.recommended, + ...ts.configs.recommended, turbo, prettier, { - plugins: { '@typescript-eslint': typescriptEslint }, + plugins: { '@typescript-eslint': ts.plugin }, languageOptions: { - parser: tsParser, + parser: ts.parser, ecmaVersion: 'latest', sourceType: 'module' }