Skip to content

Commit e0e76f4

Browse files
committed
Configure ESLint
1 parent 7ffcbca commit e0e76f4

File tree

8 files changed

+858
-31
lines changed

8 files changed

+858
-31
lines changed

.github/workflows/ci.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,19 @@ jobs:
2020
- name: Check Astro project for errors
2121
run: pnpm astro check
2222

23+
eslint-check:
24+
name: ESLint check
25+
runs-on: ubuntu-latest
26+
steps:
27+
- name: Checkout
28+
uses: actions/checkout@v4
29+
30+
- name: Setup
31+
uses: ./.github/actions/setup
32+
33+
- name: Check Astro project for errors
34+
run: pnpm eslint
35+
2336
prettier-check:
2437
name: Prettier check
2538
runs-on: ubuntu-latest

eslint.config.mjs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import globals from "globals";
2+
import pluginJs from "@eslint/js";
3+
import pluginAstro from "eslint-plugin-astro";
4+
import tseslint from "typescript-eslint";
5+
6+
/** @type {import('eslint').Linter.Config[]} */
7+
export default [
8+
{ files: ["**/*.{js,mjs,cjs,ts,astro}"] },
9+
{ languageOptions: { globals: globals.node } },
10+
pluginJs.configs.recommended,
11+
...tseslint.configs.recommended,
12+
...pluginAstro.configs.all,
13+
];

package.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,23 @@
99
"devDependencies": {
1010
"@astrojs/check": "^0.9.4",
1111
"@astrojs/tailwind": "^5.1.2",
12+
"@eslint/js": "^9.15.0",
1213
"@fontsource-variable/sometype-mono": "^5.1.0",
1314
"@tailwindcss/typography": "^0.5.15",
1415
"@types/luxon": "^3.4.2",
1516
"astro": "^4.16.10",
17+
"eslint": "^9.15.0",
18+
"eslint-plugin-astro": "^1.3.1",
19+
"globals": "^15.12.0",
1620
"luxon": "^3.5.0",
1721
"prettier": "^3.3.3",
1822
"prettier-plugin-astro": "^0.14.1",
1923
"prettier-plugin-packagejson": "^2.5.3",
2024
"prettier-plugin-tailwindcss": "^0.6.8",
2125
"sass": "^1.80.6",
2226
"tailwindcss": "^3.4.14",
23-
"typescript": "^5.6.3"
27+
"typescript": "^5.6.3",
28+
"typescript-eslint": "^8.15.0"
2429
},
2530
"packageManager": "[email protected]+sha256.24235772cc4ac82a62627cd47f834c72667a2ce87799a846ec4e8e555e2d4b8b",
2631
"engines": {

0 commit comments

Comments
 (0)