Skip to content
Open
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 2 additions & 2 deletions .agents/rules/landing-the-plane.md
Original file line number Diff line number Diff line change
Expand Up @@ -301,8 +301,8 @@ This rule should be used in conjunction with:

- **Test command**: `mise run test` or `./node_modules/.bin/jest`
- **Lint command**: `mise run lint` or ESLint directly
- **Flow check**: `mise run flow` or `./node_modules/.bin/flow`
- **Prettier**: `mise run pretty` or `./node_modules/.bin/pretty-quick`
- **Type check**: `mise run typecheck` or `./node_modules/.bin/tsc --noEmit`
- **Prettier**: `mise run prettier`
- **Build validation**: `mise run build` (if changes affect build process)
- **Issue prefix**: Use `gobbldygook-` for all issue IDs in this project
- **Branch naming**: Follow existing patterns (e.g., `feature/`, `fix/`, `chore/`)
Expand Down
38 changes: 0 additions & 38 deletions .flowconfig

This file was deleted.

55 changes: 50 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ on:
workflow_dispatch:

jobs:
flow:
name: Flow Type Checking
typecheck:
name: TypeScript Type Checking
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
Expand All @@ -21,8 +21,8 @@ jobs:
- name: Install dependencies
run: npm ci

- name: Run Flow
run: mise run flow check --quiet
- name: Run TypeScript
run: mise run typecheck

test:
name: Jest Tests
Expand Down Expand Up @@ -77,7 +77,7 @@ jobs:

- name: Check formatting
run: |
mise run pretty
mise run prettier
git diff --exit-code

build:
Expand All @@ -99,3 +99,48 @@ jobs:
with:
name: web-build
path: ./modules/gob-web/build

e2e:
name: End-to-End Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
- uses: jdx/mise-action@c37c93293d6b742fc901e1406b8f764f6fb19dac # v2

- name: Install dependencies
run: npm ci

- name: Install Playwright Browsers
run: npx playwright install --with-deps chromium

- name: Run Playwright tests
run: mise run test:e2e

- name: Upload Playwright Report
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
if: always()
with:
name: playwright-report
path: playwright-report/
retention-days: 30

check-peg-parser:
name: Check PEG Parser is Up-to-Date
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
- uses: jdx/mise-action@c37c93293d6b742fc901e1406b8f764f6fb19dac # v2

- name: Install dependencies
run: npm ci

- name: Build PEG parser
run: mise run build-peg

- name: Check for changes
run: |
if ! git diff --exit-code modules/gob-hanson-format/parse-hanson-string.js; then
echo "Error: parse-hanson-string.js is not up-to-date!"
echo "Please run 'mise run build-peg' and commit the changes."
exit 1
fi
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,7 @@ node_modules/
build*/
coverage/
flow-coverage*/

# Playwright test artifacts
test-results/
playwright-report/
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Repository tasks (build, test, lint, etc.) are defined in `mise.toml`. Use `mise
- `mise run lint` - Run ESLint
- `mise run flow` - Run Flow type checker
- `mise run test` - Run Jest tests
- `mise run pretty` - Format code with Prettier
- `mise run prettier` - Format code with Prettier
- `mise run build` - Build the web application

Run `mise tasks` to see all available tasks.
Expand Down
2 changes: 1 addition & 1 deletion babel.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module.exports = {
presets: [
"@babel/preset-react",
"@babel/preset-flow",
"@babel/preset-typescript",
[
"@babel/preset-env",
{
Expand Down
6 changes: 6 additions & 0 deletions e2e/gobbldygook.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { test, expect } from '@playwright/test';

test('homepage loads with Gobbldygook text', async ({ page }) => {
await page.goto('http://localhost:3000/');
await expect(page.locator('body')).toContainText('Gobbldygook', { ignoreCase: true });
});
118 changes: 82 additions & 36 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
// @ts-check
const babelParser = require("@babel/eslint-parser")
const tseslint = require("@typescript-eslint/eslint-plugin")
const tsParser = require("@typescript-eslint/parser")
const react = require("eslint-plugin-react")
const ftFlow = require("eslint-plugin-ft-flow")
const importPlugin = require("eslint-plugin-import")
const prettierConfig = require("eslint-config-prettier")
const js = require("@eslint/js")
Expand All @@ -18,23 +19,19 @@ module.exports = [
"**/.cache/**",
"**/*.min.js",
"**/parse-hanson-string.js", // Generated parser file
"**/flow-typed/**",
"**/parse-hanson-string.ts", // Generated parser file
],
},

// Base configuration for all JS files
// Base configuration for legacy JS files (if any remain)
{
files: ["**/*.js", "**/*.jsx"],
languageOptions: {
parser: babelParser,
parserOptions: {
requireConfigFile: false,
babelOptions: {
presets: [
"@babel/preset-react",
"@babel/preset-flow",
"@babel/preset-env",
],
presets: ["@babel/preset-react", "@babel/preset-env"],
},
},
ecmaVersion: 2021,
Expand All @@ -53,35 +50,67 @@ module.exports = [
},
plugins: {
react,
"ft-flow": ftFlow,
import: importPlugin,
},
settings: {
react: {
version: "16.5",
flowVersion: "0.81",
},
},
},

// ESLint recommended rules
js.configs.recommended,
// TypeScript configuration
{
files: ["**/*.ts", "**/*.tsx"],
languageOptions: {
parser: tsParser,
parserOptions: {
ecmaVersion: 2021,
sourceType: "module",
},
globals: {
...globals.browser,
...globals.node,

// React recommended rules (flat config)
react.configs.flat.recommended,
// Webpack DefinePlugin
VERSION: "readonly",
APP_BASE: "readonly",

// Flow type rules (manual config since no flat config available)
{
files: ["**/*.js", "**/*.jsx"],
// Test globals
TESTING: "readonly",
},
},
plugins: {
"@typescript-eslint": tseslint,
react,
import: importPlugin,
},
settings: {
react: {
version: "16.5",
},
},
rules: {
...ftFlow.configs.recommended.rules,
"ft-flow/no-types-missing-file-annotation": "off",
...tseslint.configs.recommended.rules,
// Allow any types for now during migration
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/ban-ts-comment": "off",
"@typescript-eslint/no-require-imports": "off",
"@typescript-eslint/no-empty-object-type": "off",
"@typescript-eslint/prefer-as-const": "off",
"@typescript-eslint/no-unused-expressions": "off",
},
},

// Custom project rules
// ESLint recommended rules
js.configs.recommended,

// React recommended rules (flat config)
react.configs.flat.recommended,

// Custom project rules for all files
{
files: ["**/*.js", "**/*.jsx"],
files: ["**/*.js", "**/*.jsx", "**/*.ts", "**/*.tsx"],
rules: {
// Best practices
"array-callback-return": "warn",
Expand Down Expand Up @@ -113,16 +142,7 @@ module.exports = [
"no-underscore-dangle": "off",
"no-unmodified-loop-condition": "error",
"no-unused-labels": "error",
"no-unused-vars": [
"warn",
{
args: "after-used",
varsIgnorePattern: "^_",
argsIgnorePattern: "^_",
caughtErrorsIgnorePattern: "^_",
ignoreRestSiblings: true,
},
],
"no-unused-vars": "off", // Disabled in favor of TypeScript's unused variable checking
"no-useless-constructor": "error",
"no-var": "error",
"prefer-spread": "warn",
Expand All @@ -139,12 +159,29 @@ module.exports = [
},
},

// TypeScript-specific rules
{
files: ["**/*.ts", "**/*.tsx"],
rules: {
"@typescript-eslint/no-unused-vars": [
"warn",
{
args: "after-used",
varsIgnorePattern: "^_",
argsIgnorePattern: "^_",
caughtErrorsIgnorePattern: "^_",
ignoreRestSiblings: true,
},
],
},
},

// CLI-specific configuration
{
files: [
"modules/gob-cli/**/*.js",
"modules/gob-hanson-format-cli/**/*.js",
"modules/gob-search-queries-cli/**/*.js",
"modules/gob-cli/**/*.{js,ts}",
"modules/gob-hanson-format-cli/**/*.{js,ts}",
"modules/gob-search-queries-cli/**/*.{js,ts}",
],
rules: {
"no-process-exit": "off",
Expand All @@ -154,15 +191,24 @@ module.exports = [

// Web Worker-specific configuration
{
files: ["**/*.worker.js", "**/workers/**/*.js"],
files: ["**/*.worker.{js,ts}", "**/workers/**/*.{js,ts}"],
languageOptions: {
globals: {
DedicatedWorkerGlobalScope: "readonly",
},
},
rules: {
"consistent-this": "off",
},
},

// Test-specific configuration
{
files: ["**/__tests__/**/*.js", "**/*.test.js", "**/*.spec.js"],
files: [
"**/__tests__/**/*.{js,ts,tsx}",
"**/*.test.{js,ts,tsx}",
"**/*.spec.{js,ts,tsx}",
],
languageOptions: {
globals: {
...globals.jest,
Expand Down
4 changes: 0 additions & 4 deletions flow-typed/npm/@babel/polyfill_v7.x.x.js

This file was deleted.

18 changes: 0 additions & 18 deletions flow-typed/npm/@babel/runtime_vx.x.x.js

This file was deleted.

Loading
Loading