Skip to content

Commit 2272d54

Browse files
committed
update
1 parent db0ce8f commit 2272d54

20 files changed

+2095
-2731
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* text=auto eol=lf

.prettierrc

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,16 @@
11
{
2-
"useTabs": true,
3-
"singleQuote": true,
4-
"trailingComma": "none",
5-
"printWidth": 100,
6-
"plugins": ["prettier-plugin-svelte"],
7-
"overrides": [{ "files": "*.svelte", "options": { "parser": "svelte" } }]
2+
"useTabs": false,
3+
"singleQuote": true,
4+
"trailingComma": "all",
5+
"printWidth": 100,
6+
"endOfLine": "lf",
7+
"plugins": ["prettier-plugin-svelte", "prettier-plugin-tailwindcss"],
8+
"overrides": [
9+
{
10+
"files": "*.svelte",
11+
"options": {
12+
"parser": "svelte"
13+
}
14+
}
15+
]
816
}

eslint.config.js

Lines changed: 36 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,40 @@
1+
import prettier from 'eslint-config-prettier';
12
import js from '@eslint/js';
2-
import ts from 'typescript-eslint';
3+
import { includeIgnoreFile } from '@eslint/compat';
34
import svelte from 'eslint-plugin-svelte';
4-
import prettier from 'eslint-config-prettier';
55
import globals from 'globals';
6+
import { fileURLToPath } from 'node:url';
7+
import ts from 'typescript-eslint';
8+
import svelteConfig from './svelte.config.js';
9+
10+
const gitignorePath = fileURLToPath(new URL('./.gitignore', import.meta.url));
611

7-
/** @type {import('eslint').Linter.FlatConfig[]} */
8-
export default [
9-
js.configs.recommended,
10-
...ts.configs.recommended,
11-
...svelte.configs['flat/recommended'],
12-
prettier,
13-
...svelte.configs['flat/prettier'],
14-
{
15-
languageOptions: {
16-
globals: {
17-
...globals.browser,
18-
...globals.node
19-
}
20-
}
21-
},
22-
{
23-
files: ['**/*.svelte'],
24-
languageOptions: {
25-
parserOptions: {
26-
parser: ts.parser
27-
}
28-
}
29-
},
30-
{
31-
ignores: ['build/', '.svelte-kit/', 'dist/']
32-
}
33-
];
12+
export default ts.config(
13+
includeIgnoreFile(gitignorePath),
14+
js.configs.recommended,
15+
...ts.configs.recommended,
16+
...svelte.configs.recommended,
17+
prettier,
18+
...svelte.configs.prettier,
19+
{
20+
languageOptions: {
21+
globals: { ...globals.browser, ...globals.node },
22+
},
23+
rules: {
24+
'no-undef': 'off',
25+
'@typescript-eslint/no-unused-vars': 'warn',
26+
},
27+
},
28+
{
29+
files: ['**/*.svelte', '**/*.svelte.ts', '**/*.svelte.js'],
30+
ignores: ['eslint.config.js', 'svelte.config.js'],
31+
languageOptions: {
32+
parserOptions: {
33+
projectService: true,
34+
extraFileExtensions: ['.svelte'],
35+
parser: ts.parser,
36+
svelteConfig,
37+
},
38+
},
39+
},
40+
);

0 commit comments

Comments
 (0)