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
32 changes: 19 additions & 13 deletions .github/workflows/typescript.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:

jobs:
build-compiler:
name: Build Rules Compiler
name: Build and Test Rules Compiler
runs-on: ubuntu-latest
defaults:
run:
Expand All @@ -32,14 +32,20 @@ jobs:
run: npx tsc --noEmit

- name: Lint
run: npx eslint . || true
run: npx eslint src/

build-rules:
name: Build Rules API
- name: Build
run: npm run build

- name: Test
run: npm test

build-website:
name: Build Website
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./rules/Api
working-directory: ./src/website

steps:
- uses: actions/checkout@v4
Expand All @@ -48,13 +54,13 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
cache-dependency-path: './src/website/package-lock.json'

- name: Install dependencies
run: |
cd ../../src/rules-compiler-typescript
npm ci

- name: Type check Rules API
run: |
cd ../../src/rules-compiler-typescript
npx tsc --noEmit ../../rules/Api/cli.ts
run: npm ci

- name: Build Gatsby site
run: npm run build
env:
NODE_ENV: production
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -481,4 +481,11 @@ $RECYCLE.BIN/
.env.*
!.env.example
*.env

# TypeScript build output
src/rules-compiler-typescript/dist/
src/rules-compiler-typescript/frontend-rust/target/

# Gatsby
src/website/public/
src/website/.cache/
40 changes: 40 additions & 0 deletions src/rules-compiler-typescript/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
// @ts-check

import eslint from '@eslint/js';
import tseslint from 'typescript-eslint';

export default tseslint.config(
eslint.configs.recommended,
...tseslint.configs.recommendedTypeChecked,
{
languageOptions: {
parserOptions: {
projectService: true,
tsconfigRootDir: import.meta.dirname,
},
},
},
{
files: ['**/*.js'],
...tseslint.configs.disableTypeChecked,
languageOptions: {
globals: {
module: 'readonly',
require: 'readonly',
__dirname: 'readonly',
},
},
},
{
files: ['**/*.test.ts'],
rules: {
'@typescript-eslint/no-unsafe-assignment': 'off',
'@typescript-eslint/no-unsafe-call': 'off',
'@typescript-eslint/no-unsafe-member-access': 'off',
'@typescript-eslint/no-unsafe-argument': 'off',
},
},
{
ignores: ['dist/', 'coverage/', 'node_modules/', 'frontend-rust/', '*.config.js', 'src/mod.ts'],
},
);
Loading
Loading