Skip to content

Commit

Permalink
Migrated eslint to new flat config
Browse files Browse the repository at this point in the history
  • Loading branch information
DaveKeehl committed Aug 25, 2024
1 parent f690c32 commit 727669f
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 46 deletions.
13 changes: 0 additions & 13 deletions examples/with-sveltekit/.eslintignore

This file was deleted.

26 changes: 0 additions & 26 deletions examples/with-sveltekit/.eslintrc.cjs

This file was deleted.

45 changes: 45 additions & 0 deletions examples/with-sveltekit/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -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
}
}
}
];
13 changes: 6 additions & 7 deletions packages/svelte-reveal/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -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';

Expand Down Expand Up @@ -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'
}
Expand Down

0 comments on commit 727669f

Please sign in to comment.