Skip to content

Commit

Permalink
chore: update eslint config
Browse files Browse the repository at this point in the history
  • Loading branch information
kwchang0831 committed Jul 7, 2024
1 parent 4ab2304 commit 757227c
Show file tree
Hide file tree
Showing 7 changed files with 245 additions and 125 deletions.
13 changes: 0 additions & 13 deletions .eslintignore

This file was deleted.

20 changes: 0 additions & 20 deletions .eslintrc.json

This file was deleted.

3 changes: 2 additions & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@
"bracketSameLine": true,
"bracketSpacing": true,
"arrowParens": "always",
"plugins": ["prettier-plugin-svelte"]
"plugins": ["prettier-plugin-svelte"],
"overrides": [{ "files": "*.svelte", "options": { "parser": "svelte" } }]
}
1 change: 0 additions & 1 deletion QWER/mdify/lib/katex.cjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable @typescript-eslint/no-var-requires */
const katex = require('katex');
require('katex/contrib/mhchem');

Expand Down
43 changes: 43 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
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';

/** @type {import('eslint').Linter.FlatConfig[]} */
export default [
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,
},
},
},
{
ignores: ['build/', '.svelte-kit/', 'dist/'],
},
{
rules: {
'@typescript-eslint/no-namespace': 'off',
'@typescript-eslint/no-unused-vars': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-require-imports': 'off',
'svelte/no-at-html-tags': 'off',
'@typescript-eslint/no-unused-expressions': 'off',
},
},
];
7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
"lint": "prettier --check . && eslint .",
"lint:fix": "prettier --write . && eslint . --fix",
"format": "prettier --write .",
"up:deps": "pnpm up -L -i",
"up:QWER-deps": "cd QWER && pnpm up -L -i",
Expand Down Expand Up @@ -76,6 +77,7 @@
"@sveltejs/vite-plugin-svelte": "^3.1.1",
"@types/flexsearch": "^0.7.6",
"@types/nprogress": "^0.2.3",
"@types/eslint": "^8.56.7",
"@typescript-eslint/eslint-plugin": "^7.15.0",
"@typescript-eslint/parser": "^7.15.0",
"@unocss/core": "^0.61.3",
Expand All @@ -89,8 +91,8 @@
"cross-env": "^7.0.3",
"eslint": "^9.6.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.1.3",
"eslint-plugin-svelte": "^2.41.0",
"eslint-plugin-svelte": "^2.36.0",
"globals": "^15.0.0",
"flexsearch": "^0.7.43",
"gitmoji-cli": "^9.4.0",
"husky": "^9.0.11",
Expand All @@ -113,6 +115,7 @@
"tslib": "^2.6.3",
"typesafe-i18n": "^5.26.2",
"typescript": "^5.5.3",
"typescript-eslint": "^8.0.0-alpha.20",
"unocss": "^0.61.3",
"unocss-preset-scrollbar": "^0.3.1",
"vite": "^5.3.3",
Expand Down
Loading

0 comments on commit 757227c

Please sign in to comment.