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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .github/agents/language-package.agent.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ Run these commands scoped to the files under review and include the results in y

- **Tests**: `pnpm vitest run <test-file>` — confirm the co-located test file exists and passes.
- **Type check**: `pnpm tsc --noEmit -p <package>/tsconfig.json` — confirm no type errors.
- **Lint**: `pnpm eslint <file>` — confirm no lint violations.
- **Lint**: `pnpm oxlint <file>` — confirm no lint violations.

If any of these fail, include the failure output as a finding.

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/changes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ permissions:

jobs:
changes:
if: ${{ github.actor != 'dependabot[bot]' && !startsWith(github.head_ref, 'publish/') }}
if: ${{ github.actor != 'dependabot[bot]' && !startsWith(github.head_ref, 'publish/') && !contains(github.event.pull_request.title, '[skip chg]') }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand Down
21 changes: 21 additions & 0 deletions .oxfmtrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"$schema": "./node_modules/oxfmt/configuration_schema.json",
"printWidth": 80,
"sortImports": true,
"sortPackageJson": false,
"ignorePatterns": [
"pnpm-lock.yaml",
"packages/babel-plugin-alloy/test/fixtures/**/*",
"packages/babel-plugin-jsx-dom-expressions/test/__*_fixtures__/**/*",
"packages/babel-plugin-jsx-dom-expressions/**",
"packages/docs/dist",
"packages/docs/dist-build",
"packages/docs/public",
"packages/docs/docs",
"packages/docs/src",
"packages/csharp/src/builtins",
".chronus/changes/",
"CHANGELOG.md",
"*.generated.*"
]
}
96 changes: 96 additions & 0 deletions .oxlintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
{
"$schema": "./node_modules/oxlint/configuration_schema.json",
"plugins": ["typescript", "vitest"],
"categories": {
"correctness": "error"
},
"ignorePatterns": [
"**/*.d.ts",
"**/dist/**/*",
"**/.temp/**/*",
"packages/*/vitest.config.ts",
"packages/*/babel.config.cjs",
"packages/babel-plugin-jsx-dom-expressions/**/*",
"packages/babel-plugin-alloy/**/*",
"packages/babel-preset-alloy/**/*",
"packages/devtools/**/*",
"packages/docs/**/*",
"samples/**/*",
"**/scripts/**/*",
"**/cmd/**/*"
],
"rules": {
"no-console": "warn",
"typescript/no-explicit-any": "off",
"typescript/no-empty-object-type": "off",
"no-unused-vars": [
"warn",
{
"varsIgnorePattern": "^_",
"argsIgnorePattern": ".*",
"caughtErrorsIgnorePattern": ".*",
"ignoreRestSiblings": true
}
],
"prefer-const": "warn",
"eqeqeq": ["warn", "always", { "null": "ignore" }],

// Rules oxlint enables by default (via the `correctness` category) that
// were not enforced by the previous ESLint setup. Disabled so the
// migration does not introduce new errors.
// `no-useless-catch`: the codebase intentionally re-throws in `try/catch`
// to preserve call stacks (previously suppressed inline everywhere).
"no-useless-catch": "off",
"no-useless-rename": "off",
"vitest/expect-expect": "off",
"vitest/no-conditional-expect": "off",
"vitest/require-mock-type-parameters": "off",
"vitest/require-to-throw-message": "off",
"vitest/valid-title": "off",

// Type-aware linting (via oxlint-tsgolint, enabled by `--type-aware`).
// We only opt into `no-floating-promises` to match the previous ESLint
// setup. The `--type-aware` flag only activates the type-aware rules that
// belong to an enabled category, so the list below is exactly the
// type-aware rules in `correctness` (minus `no-floating-promises`); all
// other type-aware rules live in categories that are off by default.
// Remove an entry here to progressively adopt more type-aware rules.
"typescript/no-floating-promises": "warn",
"typescript/await-thenable": "off",
"typescript/no-array-delete": "off",
"typescript/no-base-to-string": "off",
"typescript/no-duplicate-type-constituents": "off",
"typescript/no-for-in-array": "off",
"typescript/no-implied-eval": "off",
"typescript/no-meaningless-void-operator": "off",
"typescript/no-misused-spread": "off",
"typescript/no-redundant-type-constituents": "off",
"typescript/no-unsafe-unary-minus": "off",
"typescript/no-useless-default-assignment": "off",
"typescript/require-array-sort-compare": "off",
"typescript/restrict-template-expressions": "off",
"typescript/triple-slash-reference": "off",
"typescript/unbound-method": "off"
},
"overrides": [
{
"files": ["packages/trace-cli/**/*.ts"],
"rules": {
"no-console": "off"
}
},
{
"files": ["**/*.test.ts"],
"rules": {
"vitest/no-focused-tests": "warn",
"vitest/no-identical-title": "error",
"vitest/no-commented-out-tests": "warn",
"vitest/no-import-node-test": "warn",
"vitest/require-local-test-context-for-concurrent-snapshots": "warn",
"vitest/valid-describe-callback": "warn",
"vitest/valid-expect": "warn",
"typescript/no-non-null-asserted-optional-chain": "off"
}
}
]
}
20 changes: 0 additions & 20 deletions .prettierignore

This file was deleted.

3 changes: 0 additions & 3 deletions .prettierrc.yaml

This file was deleted.

3 changes: 3 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"recommendations": ["oxc.oxc-vscode"]
}
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.defaultFormatter": "oxc.oxc-vscode",
"editor.formatOnSave": true,
"oxc.fmt.experimental": true,
"search.exclude": {
"**/node_modules": true,
"**/.temp": true,
Expand Down
1 change: 1 addition & 0 deletions eng/pkg-pr-new.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { execSync } from "child_process";
import { readdir } from "fs/promises";

import { repoRoot } from "./utils/constants.ts";
import { listChangedFilesSince } from "./utils/git.ts";

Expand Down
3 changes: 2 additions & 1 deletion eng/prepare-release-pr.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { execSync } from "child_process";

/* eslint-disable no-console */
// @ts-check
import { context, getOctokit } from "@actions/github";
Expand All @@ -6,7 +8,6 @@ import {
renderReleasePlanAsMarkdown,
resolveCurrentReleasePlan,
} from "@chronus/chronus";
import { execSync } from "child_process";
const branchName = "publish/auto-release";

const plan = await resolveCurrentReleasePlan(NodeChronusHost, process.cwd());
Expand Down
8 changes: 5 additions & 3 deletions eng/sync-publish-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@
// node eng/sync-publish-config.ts --check # exit non-zero if anything is stale
/* eslint-disable no-console */
import { existsSync, readdirSync, readFileSync, writeFileSync } from "fs";

import { join } from "pathe";

import { repoRoot } from "./utils/constants.ts";

type Json = string | number | boolean | null | Json[] | { [key: string]: Json };
Expand Down Expand Up @@ -130,8 +132,8 @@ if (check && stale.length > 0) {

if (!check) {
console.log(
stale.length === 0 ?
"publishConfig already in sync."
: `Synced publishConfig for ${stale.length} package(s).`,
stale.length === 0
? "publishConfig already in sync."
: `Synced publishConfig for ${stale.length} package(s).`,
);
}
83 changes: 0 additions & 83 deletions eslint.config.js

This file was deleted.

18 changes: 8 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,29 +16,27 @@
"test": "vitest run",
"sync-publish-config": "node eng/sync-publish-config.ts",
"sync-publish-config:check": "node eng/sync-publish-config.ts --check",
"format": "prettier . --write",
"format:check": "prettier . --check",
"lint": "eslint . --max-warnings=0",
"lint:fix": "eslint --fix ."
"format": "oxfmt",
"format:check": "oxfmt --check",
"lint": "oxlint --type-aware --disable-nested-config --max-warnings=0",
"lint:fix": "oxlint --type-aware --disable-nested-config --fix"
},
"devDependencies": {
"@actions/github": "^9.1.1",
"@alloy-js/cli": "workspace:~",
"@chronus/chronus": "^1.1.0",
"@chronus/github": "^1.0.3",
"@chronus/github-pr-commenter": "^1.0.3",
"@eslint/js": "catalog:",
"@vitest/eslint-plugin": "catalog:",
"@types/node": "catalog:",
"concurrently": "catalog:",
"eslint": "catalog:",
"execa": "^9.6.0",
"oxfmt": "catalog:",
"oxlint": "catalog:",
"oxlint-tsgolint": "catalog:",
"pathe": "^2.0.3",
"prettier": "catalog:",
"prettier-plugin-organize-imports": "catalog:",
"rimraf": "catalog:",
"tsx": "^4.20.3",
"typedoc": "^0.28.8",
"typescript-eslint": "catalog:",
"vitest": "catalog:"
}
}
1 change: 1 addition & 0 deletions packages/babel-plugin-alloy/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import PrinterMod from "@babel/generator/lib/printer.js";
import SyntaxJSX from "@babel/plugin-syntax-jsx";
import { NodePath } from "@babel/traverse";
import * as t from "@babel/types";

import { transformJSX } from "./transform.js";
// when vite runs, PrinterMod is printer, otherwise PrinterMod.default is.
// esm is so much fun.
Expand Down
4 changes: 3 additions & 1 deletion packages/babel-plugin-alloy/test/basic.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { pluginTester } from "babel-plugin-tester";
import { join } from "node:path";

import { pluginTester } from "babel-plugin-tester";
import "vitest";

import plugin from "../src/index.js";

pluginTester({
Expand Down
3 changes: 2 additions & 1 deletion packages/babel-plugin-alloy/test/memo-naming.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { transformSync } from "@babel/core";
import { join } from "node:path";

import { transformSync } from "@babel/core";
import { describe, expect, it } from "vitest";

const pluginPath = join(
Expand Down
9 changes: 5 additions & 4 deletions packages/cli/src/babel.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import * as babel from "@babel/core";
import { mkdir, writeFile } from "node:fs/promises";

// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-expect-error
import typescriptPreset from "@babel/preset-typescript";
import alloyPreset from "@alloy-js/babel-preset";
import * as babel from "@babel/core";
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-expect-error
import alloyPreset from "@alloy-js/babel-preset";
import { mkdir, writeFile } from "node:fs/promises";
import typescriptPreset from "@babel/preset-typescript";
import { basename, dirname, join, relative } from "pathe";

export interface BuildOptions {
Expand Down
1 change: 1 addition & 0 deletions packages/cli/src/cli.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import pc from "picocolors";

import { buildCommand } from "./commands/build.js";
import { installAgentsCommand } from "./commands/install-agents.js";
import { installDocsCommand } from "./commands/install-docs.js";
Expand Down
2 changes: 2 additions & 0 deletions packages/cli/src/commands/build.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import { parseArgs } from "node:util";

import { join } from "pathe";
import pc from "picocolors";
import ts from "typescript";

import { buildAllFiles } from "../babel.js";
import { getParseCommandLine } from "../typescript.js";

Expand Down
Loading
Loading