Skip to content

Commit

Permalink
chore: update eslint (#243)
Browse files Browse the repository at this point in the history
  • Loading branch information
maalni authored May 31, 2024
1 parent efddbcd commit 7adecd8
Show file tree
Hide file tree
Showing 10 changed files with 295 additions and 310 deletions.
16 changes: 0 additions & 16 deletions .eslintignore

This file was deleted.

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

This file was deleted.

18 changes: 0 additions & 18 deletions .prettierrc

This file was deleted.

2 changes: 1 addition & 1 deletion commitlint.config.cjs → commitlint.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module.exports = {
export default {
extends: ['@commitlint/config-conventional'],
rules: {
'subject-case': [0, 'never']
Expand Down
61 changes: 61 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
// @ts-check

import tseslint from 'typescript-eslint';
import svelteParser from 'svelte-eslint-parser';
import eslintPluginSvelte from 'eslint-plugin-svelte';
import eslintPluginPrettier from 'eslint-plugin-prettier/recommended';

export default tseslint.config(
{
ignores: [
'.github/*',
'.husky/*',
'.svelte-kit/*',
'.node_modules/*',
'src/lib/components/ui/*',
'**/.DS_Store',
'.env*',
'pnpm-lock.yaml'
]
},
{
plugins: {
'@typescript-eslint': tseslint.plugin
},
languageOptions: {
parser: tseslint.parser,
parserOptions: {
project: true,
sourceType: 'module',
ecmaVersion: 2020,
extraFileExtensions: ['.svelte']
}
},
rules: {
'@typescript-eslint/no-unused-vars': [
'error',
{
argsIgnorePattern: '^_',
varsIgnorePattern: '^_',
caughtErrorsIgnorePattern: '^_'
}
]
}
},
...eslintPluginSvelte.configs['flat/prettier'],
{
// disable type-aware linting on JS files
files: ['**/*.js'],
...tseslint.configs.disableTypeChecked
},
{
files: ['src/**/*.svelte'],
languageOptions: {
parser: svelteParser,
parserOptions: {
parser: tseslint.parser
}
}
},
eslintPluginPrettier
);
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,10 @@
"@types/d3-scale": "^4.0.8",
"@types/d3-shape": "^3.1.6",
"@types/eslint": "8.56.10",
"@typescript-eslint/eslint-plugin": "^7.0.0",
"@typescript-eslint/parser": "^6.21.0",
"@vite-pwa/assets-generator": "^0.2.4",
"@vite-pwa/sveltekit": "^0.5.0",
"autoprefixer": "^10.4.19",
"eslint": "^8.57.0",
"eslint": "^9.3.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.1.3",
"eslint-plugin-svelte": "^2.39.0",
Expand All @@ -63,15 +61,18 @@
"sass": "^1.77.4",
"svelte": "^4.2.17",
"svelte-check": "^3.7.1",
"svelte-eslint-parser": "^0.36.0",
"svelte-headless-table": "^0.18.2",
"svelte-lucide": "^1.0.5",
"tailwindcss": "^3.4.3",
"tslib": "^2.4.1",
"typescript": "^5.4.5",
"typescript-eslint": "^7.11.0",
"vite": "^5.2.12",
"vite-plugin-pwa": "^0.20.0"
},
"engines": {
"node": ">=20.0.0",
"pnpm": ">= 9",
"npm": "please-use-pnpm",
"yarn": "please-use-pnpm"
Expand Down
Loading

0 comments on commit 7adecd8

Please sign in to comment.