Skip to content

Commit

Permalink
Merge pull request #72 from mainmatter/eslint-v9
Browse files Browse the repository at this point in the history
chore: upgrade eslint to v9 and flat config
  • Loading branch information
paoloricciuti authored May 17, 2024
2 parents 4049402 + 8615745 commit 6f47350
Show file tree
Hide file tree
Showing 5 changed files with 242 additions and 139 deletions.
21 changes: 0 additions & 21 deletions .eslintignore

This file was deleted.

31 changes: 0 additions & 31 deletions .eslintrc.cjs

This file was deleted.

62 changes: 62 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
import js from '@eslint/js';
import eslintConfigPrettier from 'eslint-config-prettier';
import eslintPluginSvelte from 'eslint-plugin-svelte';
import globals from 'globals';
import svelteParser from 'svelte-eslint-parser';
import tsEslint from 'typescript-eslint';
import playwright from 'eslint-plugin-playwright';

export default tsEslint.config(
js.configs.recommended,
...tsEslint.configs.recommended,
...eslintPluginSvelte.configs['flat/recommended'],
eslintConfigPrettier,
{
...playwright.configs['flat/recommended'],
files: ['tests/**'],
},
{
languageOptions: {
ecmaVersion: 2020,
sourceType: 'module',
globals: {
...globals.node,
...globals.browser,
...globals.es2017,
},
parser: tsEslint.parser,
parserOptions: {
extraFileExtensions: ['.svelte'],
},
},
plugins: {
'@typescript-eslint': tsEslint.plugin,
},
},
{
files: ['**/*.svelte'],
languageOptions: {
parser: svelteParser,
parserOptions: {
parser: tsEslint.parser,
svelteFeatures: {
experimentalGenerics: true,
},
},
},
},
{
ignores: [
'**/.svelte-kit',
'**/build',
'**/node_modules',
'**/static',
'**/test-results',
'**/expected-transforms',
'**/dist',
'**/coverage',
'CHANGELOG.md',
'.release-plan-json',
],
},
);
7 changes: 6 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,17 @@
"@testing-library/jest-dom": "^6.4.2",
"@testing-library/svelte": "^5.0.0",
"@types/eslint": "8.56.10",
"@types/eslint-config-prettier": "^6.11.3",
"@types/eslint__js": "^8.42.3",
"@typescript-eslint/eslint-plugin": "^7.0.0",
"@typescript-eslint/parser": "^7.0.0",
"@vitest/coverage-v8": "^1.6.0",
"@vitest/ui": "^1.4.0",
"eslint": "^8.57.0",
"eslint": "^9.2.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-playwright": "^1.6.1",
"eslint-plugin-svelte": "^2.35.1",
"globals": "^15.2.0",
"happy-dom": "^14.3.9",
"prettier": "^3.2.5",
"prettier-plugin-svelte": "^3.2.2",
Expand All @@ -76,6 +80,7 @@
"tslib": "^2.6.2",
"tsm": "^2.3.0",
"typescript": "^5.4.2",
"typescript-eslint": "^7.9.0",
"vite": "^5.1.5",
"vitest": "^1.3.1"
},
Expand Down
Loading

0 comments on commit 6f47350

Please sign in to comment.