Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions .github/workflows/typescript.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: TypeScript lint

on:
push:
branches:
- master
- main
paths:
- "web/**/*.ts"
- "web/tsconfig.json"
- "web/package.json"
- "web/package-lock.json"
- "package.json"
- "package-lock.json"
- "eslint.config.mjs"
- ".github/workflows/typescript.yml"
pull_request:
paths:
- "web/**/*.ts"
- "web/tsconfig.json"
- "web/package.json"
- "web/package-lock.json"
- "package.json"
- "package-lock.json"
- "eslint.config.mjs"
- ".github/workflows/typescript.yml"

permissions:
contents: read

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "22"
cache: npm
cache-dependency-path: |
package-lock.json
web/package-lock.json
- run: npm ci
- run: npm ci
working-directory: web
- run: npm run lint
32 changes: 32 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import tseslint from "typescript-eslint";

const typeAware = {
languageOptions: {
parser: tseslint.parser,
parserOptions: {
project: ["./web/tsconfig.json"],
tsconfigRootDir: import.meta.dirname,
},
},
plugins: { "@typescript-eslint": tseslint.plugin },
};

export default tseslint.config(
{
ignores: ["web/.astro/**", "web/dist/**"],
},
{
files: ["web/**/*.ts"],
...typeAware,
rules: {
"@typescript-eslint/no-unnecessary-type-assertion": "error",
},
},
{
files: ["web/**/*.tsx"],
...typeAware,
rules: {
"@typescript-eslint/prefer-readonly-parameter-types": ["error", { ignoreInferredTypes: true }],
},
}
);
Loading
Loading