Skip to content

Commit 78e1f45

Browse files
committed
ci: set up linting and github actions
1 parent 94a231a commit 78e1f45

File tree

6 files changed

+38
-3
lines changed

6 files changed

+38
-3
lines changed

.github/workflows/lint.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
name: CI
2+
on: [push, pull_request]
3+
jobs:
4+
build:
5+
runs-on: ubuntu-latest
6+
steps:
7+
- uses: actions/checkout@v4
8+
- uses: oven-sh/setup-bun@v2
9+
- name: Install modules
10+
run: bun install --frozen-lockfile
11+
- name: Run ESLint
12+
run: bun run lint

bun.lockb

37 KB
Binary file not shown.

eslint.config.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import eslintPluginAstro from "eslint-plugin-astro"
2+
import js from "@eslint/js"
3+
import tseslint from "typescript-eslint"
4+
5+
export default tseslint.config(
6+
// add more generic rule sets here, such as:
7+
js.configs.recommended,
8+
eslintPluginAstro.configs.recommended,
9+
{
10+
rules: {
11+
// override/add rules settings here, such as:
12+
// "astro/no-set-html-directive": "error"
13+
},
14+
}
15+
)

package.json

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,20 @@
77
"build": "astro build",
88
"preview": "astro preview",
99
"astro": "astro",
10-
"format": "prettier --write ."
10+
"format": "prettier --write .",
11+
"lint": "eslint ."
1112
},
1213
"dependencies": {
1314
"astro": "^5.1.1"
1415
},
1516
"devDependencies": {
17+
"@eslint/eslintrc": "^3.2.0",
18+
"@typescript-eslint/eslint-plugin": "^8.18.2",
19+
"@typescript-eslint/parser": "^8.18.2",
20+
"eslint": "^9.17.0",
21+
"eslint-plugin-astro": "^1.3.1",
1622
"prettier": "^3.4.2",
17-
"prettier-plugin-astro": "^0.14.1"
23+
"prettier-plugin-astro": "^0.14.1",
24+
"typescript-eslint": "^8.18.2"
1825
}
1926
}

src/components/Welcome.astro

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
import astroLogo from "@/assets/astro.svg"
33
import background from "@/assets/background.svg"
4+
const a = ""
45
---
56

67
<div id="container">

tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"extends": "astro/tsconfigs/strict",
3-
"include": [".astro/types.d.ts", "**/*", ".prettierrc.mjs"],
3+
"include": [".astro/types.d.ts", "**/*", ".prettierrc.mjs", "eslint.config.js"],
44
"exclude": ["dist"],
55
"compilerOptions": {
66
"paths": {

0 commit comments

Comments
 (0)