Skip to content

Commit c86ee69

Browse files
committed
chore: apply eslint
1 parent f811814 commit c86ee69

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+2409
-549
lines changed

.github/workflows/ci-check.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ jobs:
4040
run: pnpm install --frozen-lockfile
4141
working-directory: ${{ env.BUILD_PATH }}
4242

43+
- name: Lint
44+
run: pnpm check
45+
4346
- name: Check with Astro
4447
run: |
4548
pnpm astro check

.vscode/settings.json

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
11
{
2+
"cSpell.language": "en,de-ch",
23
"cSpell.words": [
34
"Astro"
45
],
5-
"typescript.tsdk": "node_modules/typescript/lib"
6+
"typescript.tsdk": "node_modules/typescript/lib",
7+
"editor.rulers": [
8+
120
9+
],
10+
"[astro]": {
11+
"editor.defaultFormatter": "esbenp.prettier-vscode"
12+
},
13+
"[typescript]": {
14+
"editor.defaultFormatter": "esbenp.prettier-vscode"
15+
},
616
}

astro.config.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,5 @@ export default defineConfig({
5151
}),
5252
],
5353
},
54-
integrations: [
55-
search(),
56-
mdx(),
57-
sitemap({ i18n: { defaultLocale: C.DEFAULT_LOCALE, locales: C.LOCALES } }),
58-
],
54+
integrations: [search(), mdx(), sitemap({ i18n: { defaultLocale: C.DEFAULT_LOCALE, locales: C.LOCALES } })],
5955
});

eslint.config.ts

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
import js from "@eslint/js";
2+
import typescriptParser from "@typescript-eslint/parser";
3+
import astroEslintParser from "astro-eslint-parser";
4+
import eslintPluginAstro from "eslint-plugin-astro";
5+
import globals from "globals";
6+
import tseslint from "typescript-eslint";
7+
import prettier from "eslint-config-prettier";
8+
import eslintPluginPrettierRecommended from "eslint-plugin-prettier/recommended";
9+
10+
export default [
11+
js.configs.recommended,
12+
...eslintPluginAstro.configs["flat/recommended"],
13+
...tseslint.configs.recommended,
14+
eslintPluginPrettierRecommended,
15+
prettier,
16+
{
17+
languageOptions: {
18+
globals: {
19+
...globals.browser,
20+
...globals.node,
21+
},
22+
},
23+
},
24+
{
25+
files: ["**/*.astro"],
26+
languageOptions: {
27+
parser: astroEslintParser,
28+
parserOptions: {
29+
parser: tseslint.parser,
30+
extraFileExtensions: [".astro"],
31+
},
32+
},
33+
},
34+
{
35+
files: ["**/*.{js,jsx,astro}"],
36+
rules: {
37+
"no-mixed-spaces-and-tabs": ["error", "smart-tabs"],
38+
},
39+
},
40+
{
41+
files: ["**/*.{ts,tsx}", "**/*.astro/*.js"],
42+
languageOptions: {
43+
parser: typescriptParser,
44+
},
45+
rules: {
46+
"no-unused-vars": "off",
47+
"@typescript-eslint/no-unused-vars": [
48+
"error",
49+
{
50+
argsIgnorePattern: "^_",
51+
destructuredArrayIgnorePattern: "^_",
52+
},
53+
],
54+
"@typescript-eslint/no-non-null-assertion": "off",
55+
},
56+
},
57+
{
58+
files: ["**/*.astro/*.ts"],
59+
rules: {
60+
"prettier/prettier": "off",
61+
},
62+
},
63+
{
64+
ignores: ["dist", "node_modules", ".github", "types.generated.d.ts", ".astro"],
65+
},
66+
];

package.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
"astro": "astro",
2121
"test": "vitest",
2222
"coverage": "vitest --coverage",
23+
"check": "eslint . --max-warnings 0",
2324
"format": "prettier . --write",
2425
"version": "changeset version",
2526
"release": "changeset publish",
@@ -45,15 +46,26 @@
4546
},
4647
"devDependencies": {
4748
"@changesets/cli": "^2.29.6",
49+
"@eslint/js": "^9.33.0",
4850
"@openscript/unplugin-favicons": "^1.1.7",
4951
"@types/mdast": "^4.0.4",
5052
"@types/node": "^24.3.0",
53+
"@typescript-eslint/parser": "^8.40.0",
5154
"@vitest/coverage-v8": "3.2.4",
55+
"astro-eslint-parser": "^1.2.2",
56+
"eslint": "^9.33.0",
57+
"eslint-config-prettier": "^10.1.8",
58+
"eslint-plugin-astro": "^1.3.1",
59+
"eslint-plugin-jsx-a11y": "^6.10.2",
60+
"eslint-plugin-prettier": "^5.5.4",
5261
"favicons": "^7.2.0",
62+
"globals": "^16.3.0",
63+
"jiti": "^2.5.1",
5364
"prettier": "^3.6.2",
5465
"prettier-plugin-astro": "^0.14.1",
5566
"sirv": "^3.0.1",
5667
"typescript": "^5.9.2",
68+
"typescript-eslint": "^8.40.0",
5769
"vitest": "3.2.4"
5870
},
5971
"pnpm": {

0 commit comments

Comments
 (0)