Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
9e26d48
Cleanup: Move oxfmt config to root and reenable for all repo
huang-julien Mar 20, 2026
99f24be
revert docs changes
huang-julien Mar 20, 2026
a274e07
move commands to root and exclude docs dir
huang-julien Mar 20, 2026
ba49cc8
chore: update lockfile
huang-julien Mar 20, 2026
8aa4774
Merge remote-tracking branch 'origin/next' into chore/root_oxfmt
huang-julien Mar 20, 2026
5958b03
revert: yaml, test-storybooks and yml format
huang-julien Mar 20, 2026
68ad75d
fix: add default formatter
huang-julien Mar 20, 2026
1762b42
fix: move lint-staged to root
huang-julien Mar 20, 2026
d7c463d
docs: update serena files
huang-julien Mar 20, 2026
ab1902e
chore: dedupe
huang-julien Mar 20, 2026
5b6c42e
Only enforce formatting check on pre-commit hooks
Sidnioulz Mar 20, 2026
bdfd129
revert: revert back md mdx and ignore again mdd mdx for another pr
huang-julien Mar 20, 2026
b1f9ec9
fix: fmt on save
huang-julien Mar 20, 2026
2aaffe8
fix iframe
huang-julien Mar 20, 2026
04f63b2
fix: scope again pretty-docs
huang-julien Mar 20, 2026
2ebbb32
chore: apply suggestion
huang-julien Mar 23, 2026
3b3f305
feat: move script oxfmt to root
huang-julien Mar 23, 2026
9fc5e26
Merge remote-tracking branch 'origin/next' into chore/root_oxfmt
huang-julien Mar 23, 2026
418da9b
yarn dedupe
huang-julien Mar 23, 2026
3495c62
chor: run format
huang-julien Mar 23, 2026
19c6662
Merge remote-tracking branch 'origin/next' into chore/root_oxfmt
huang-julien Mar 23, 2026
5209020
chore: format
huang-julien Mar 23, 2026
ecba25d
Merge remote-tracking branch 'origin/next' into chore/root_oxfmt
huang-julien Mar 23, 2026
5939851
feat: conditionnally check or write based on human or agent
huang-julien Mar 24, 2026
bffb4a3
Merge remote-tracking branch 'origin/next' into chore/root_oxfmt
huang-julien Mar 24, 2026
a512303
revert: lib/eslint-plugin formatting
huang-julien Mar 24, 2026
e398aa8
ci: deduplicate fmt
huang-julien Mar 24, 2026
c9ad52a
chore: remove fmt from lint script
huang-julien Mar 24, 2026
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
2 changes: 1 addition & 1 deletion .github/workflows/nx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:

runs-on: ubuntu-latest
env:
ALL_TASKS: compile,check,knip,test,pretty-docs,lint,sandbox,build,e2e-tests,e2e-tests-dev,test-runner,vitest-integration,check-sandbox,e2e-ui,jest,vitest,playwright-ct
ALL_TASKS: compile,check,knip,test,lint,sandbox,build,e2e-tests,e2e-tests-dev,test-runner,vitest-integration,check-sandbox,e2e-ui,jest,vitest,playwright-ct
steps:
- uses: actions/checkout@v4
with:
Expand Down
4 changes: 0 additions & 4 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
if [ -z "$SKIP_STORYBOOK_GIT_HOOKS" ]; then
cd code
yarn lint-staged

cd ../scripts
yarn lint-staged
fi
11 changes: 11 additions & 0 deletions .lintstagedrc.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { detectAgent } from 'std-env';

const fmtCmd = detectAgent().name ? 'oxfmt' : 'oxfmt --check';

export default {
'code/**/*.{js,jsx,mjs,ts,tsx,html,json}': [fmtCmd, 'yarn --cwd code lint:js:cmd'],
'scripts/**/*.{html,js,json,jsx,mjs,ts,tsx}': ['yarn --cwd scripts lint:js:cmd'],
'docs/_snippets/**/*.{js,jsx,mjs,ts,tsx,html,json}': [fmtCmd],
'**/*.ejs': ['yarn --cwd scripts exec ejslint'],
'**/package.json': ['yarn --cwd scripts lint:package'],
};
1 change: 0 additions & 1 deletion .nx/workflows/distribution-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ assignment-rules:
- targets:
- check
- lint
- pretty-docs
- knip
run-on:
- agent: linux-js
Expand Down
64 changes: 53 additions & 11 deletions .oxfmtrc.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"$schema": "./node_modules/oxfmt/configuration_schema.json",
"printWidth": 100,
"tabWidth": 2,
"bracketSpacing": true,
Expand All @@ -7,20 +8,61 @@
"arrowParens": "always",
"sortPackageJson": false,
"ignorePatterns": [
"code",
"test-storybooks",
"node_modules",
"*.bundle.js",
"*.js.map",
".yarn",
".nx",
".vscode",
".github",
"*.md",
"*.mdx",
".nx/cache",
".nx/workspace-data",
"dist",
"build",
"bench",
"coverage",
"node_modules",
"storybook-static",
"built-storybooks",
"ember-output",
"code/core/assets",
"code/core/report",
"code/core/src/core-server/presets/common-manager.ts",
"code/core/src/core-server/utils/__search-files-tests__",
"code/core/src/core-server/utils/__mockdata__/src/Empty.stories.ts",
"code/lib/codemod/src/transforms/__testfixtures__",
"code/frameworks/angular/template/**",
"code/lib/eslint-plugin",
".prettierrc",
"test-storybooks",
"*.yml",
"*.yaml",
"docs/versions",
"CHANGELOG*",
"MIGRATION*",
"CONTRIBUTING*"
"*.md",
"*.mdx",
"!docs/_snippets/**"
],
"overrides": [
{
"files": ["docs/_snippets/**"],
"options": {
"trailingComma": "all"
}
},
{
"files": ["*.md", "*.mdx"],
"options": {
"importOrderSeparation": false,
"importOrderSortSpecifiers": false
}
},
{
"files": ["*.component.html"],
"options": {
"parser": "angular"
}
},
{
"files": ["**/frameworks/angular/src/**/*.ts", "**/frameworks/angular/template/**/*.ts"],
"options": {
"parser": "babel-ts"
}
}
]
}
5 changes: 3 additions & 2 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"dbaeumer.vscode-eslint",
"EditorConfig.EditorConfig",
"unifiedjs.vscode-mdx",
"yzhang.markdown-all-in-one"
"yzhang.markdown-all-in-one",
"oxc.oxc-vscode"
]
}
}
39 changes: 20 additions & 19 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,30 +1,25 @@
{
"[javascript]": {
"editor.defaultFormatter": "dbaeumer.vscode-eslint",
"editor.formatOnSave": true
},
"[javascriptreact]": {
"editor.defaultFormatter": "dbaeumer.vscode-eslint",
"editor.formatOnSave": true
},
"[typescript]": {
"[javascript][javascriptreact][typescript][typescriptreact][json][jsonc]": {
"editor.defaultFormatter": "oxc.oxc-vscode",
"editor.formatOnSave": true
},
"[typescriptreact]": {
"editor.defaultFormatter": "dbaeumer.vscode-eslint",
"editor.formatOnSave": true
},
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit"
"source.fixAll.eslint": "explicit",
"source.fixAll.oxc": "explicit"
},
"editor.formatOnSave": true,
"editor.tabSize": 2,
"eslint.format.enable": true,
"eslint.options": {
"cache": true,
"cacheLocation": ".cache/eslint",
"extensions": [".js", ".jsx", ".mjs", ".json", ".ts", ".tsx"]
"extensions": [
".js",
".jsx",
".mjs",
".json",
".ts",
".tsx"
]
},
"eslint.useESLintClass": true,
"eslint.validate": [
Expand All @@ -35,9 +30,13 @@
"typescript",
"typescriptreact"
],
"eslint.workingDirectories": ["./code", "./scripts"],
"eslint.workingDirectories": [
"./code",
"./scripts"
],
"files.associations": {
"*.js": "javascriptreact"
"*.js": "javascriptreact",
".oxfmtrc.json": "json"
},
"javascript.preferences.importModuleSpecifier": "relative",
"javascript.preferences.quoteStyle": "single",
Expand All @@ -51,4 +50,6 @@
"typescript.tsdk": "./typescript/lib",
"vitest.workspaceConfig": "./code/vitest.workspace.ts",
"vitest.rootConfig": "./code/vitest.workspace.ts",
}
"oxc.fmt.configPath": ".oxfmtrc.json",
"oxc.enable.oxlint": false,
}
2 changes: 2 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,8 @@ Use Storybook loggers instead of raw `console.*` in normal code paths:
- Server-side: `storybook/internal/node-logger`
- Client-side: `storybook/internal/client-logger`

The pre-commit hook automatically detects AI agents (via `std-env`) and switches from check-only to write mode, so formatting is auto-fixed when agents commit.

Avoid `console.log`, `console.warn`, and `console.error` unless the file is isolated enough that importing the logger is not reasonable.

## Troubleshooting
Expand Down
34 changes: 0 additions & 34 deletions code/.oxfmtrc.json

This file was deleted.

8 changes: 4 additions & 4 deletions code/builders/builder-vite/input/iframe.html
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,10 @@
if (hostname !== 'localhost' && globalThis.CONFIG_TYPE === 'DEVELOPMENT') {
const message = `Failed to load the Storybook preview file 'vite-app.js':

It looks like you're visiting the Storybook development server on another hostname than localhost: '${hostname}', but you haven't configured the necessary security features to support this.
Please re-run your Storybook development server with the '--host ${hostname}' flag, or manually configure your Vite allowedHosts configuration with viteFinal.
It looks like you're visiting the Storybook development server on another hostname than localhost: '${hostname}', but you haven't configured the necessary security features to support this.
Please re-run your Storybook development server with the '--host ${hostname}' flag, or manually configure your Vite allowedHosts configuration with viteFinal.

See:`;
See:`;
const docs = [
'https://storybook.js.org/docs/api/cli-options#dev',
'https://storybook.js.org/docs/api/main-config/main-config-vite-final',
Expand All @@ -85,7 +85,7 @@
`<p style="color: red; max-width: 70ch">${message.replaceAll(
'\n',
'<br/>'
)}<ul>${docs.map((doc) => `<li><a href='${doc}' target='_blank'>${doc}</a></li>`).join('')}<ul></p>`;
)}<ul>${docs.map((doc) => `<li><a href='${doc}' target='_blank'>${doc}</a></li>`).join('')}</ul></p>`;
return;
}
}
Expand Down
8 changes: 4 additions & 4 deletions code/lib/eslint-plugin/docs/rules/await-interactions.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,28 +13,28 @@ Storybook provides an instrumented version of the testing library in the [storyb
Examples of **incorrect** code for this rule:

```js
import { userEvent, within } from 'storybook/test';
import { userEvent, within } from "storybook/test";

// or from the legacy package "@storybook/testing-library";

MyStory.play = (context) => {
const canvas = within(context.canvasElement);
// not awaited!
userEvent.click(canvas.getByRole('button'));
userEvent.click(canvas.getByRole("button"));
};
```

Examples of **correct** code for this rule:

```js
import { userEvent, within } from 'storybook/test';
import { userEvent, within } from "storybook/test";

// or from the legacy package "@storybook/testing-library";

MyStory.play = async (context) => {
const canvas = within(context.canvasElement);
// awaited 👍
await userEvent.click(canvas.getByRole('button'));
await userEvent.click(canvas.getByRole("button"));
};
```

Expand Down
4 changes: 2 additions & 2 deletions code/lib/eslint-plugin/docs/rules/csf-component.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ Examples of **incorrect** code for this rule:

```js
export default {
title: 'Button',
title: "Button",
};
```

Examples of **correct** code for this rule:

```js
export default {
title: 'Button',
title: "Button",
component: Button,
};
```
Expand Down
2 changes: 1 addition & 1 deletion code/lib/eslint-plugin/docs/rules/default-exports.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Examples of **correct** code for this rule:

```js
export default {
title: 'Button',
title: "Button",
args: { primary: true },
component: Button,
};
Expand Down
4 changes: 2 additions & 2 deletions code/lib/eslint-plugin/docs/rules/hierarchy-separator.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Examples of **incorrect** code for this rule:

```js
export default {
title: 'Components|Forms/Input',
title: "Components|Forms/Input",
component: Input,
};
```
Expand All @@ -23,7 +23,7 @@ Examples of **correct** code for this rule:

```js
export default {
title: 'Components/Forms/Input',
title: "Components/Forms/Input",
component: Input,
};
```
Expand Down
4 changes: 2 additions & 2 deletions code/lib/eslint-plugin/docs/rules/meta-inline-properties.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ This rule encourages you to use inline property definitions for the default expo
Examples of **incorrect** code for this rule:

```js
const title = 'Button';
const title = "Button";
const args = { primary: true };

export default {
Expand All @@ -27,7 +27,7 @@ Examples of **correct** code for this rule:

```js
export default {
title: 'Button',
title: "Button",
args: { primary: true },
component: Button,
};
Expand Down
8 changes: 4 additions & 4 deletions code/lib/eslint-plugin/docs/rules/meta-satisfies-type.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ Examples of **incorrect** code for this rule:

```ts
export default {
title: 'Button',
title: "Button",
args: { primary: true },
component: Button,
};
```

```ts
const meta: Meta<typeof Button> = {
title: 'Button',
title: "Button",
args: { primary: true },
component: Button,
};
Expand All @@ -35,15 +35,15 @@ Examples of **correct** code for this rule:

```ts
export default {
title: 'Button',
title: "Button",
args: { primary: true },
component: Button,
} satisfies Meta<typeof Button>;
```

```ts
const meta = {
title: 'Button',
title: "Button",
args: { primary: true },
component: Button,
} satisfies Meta<typeof Button>;
Expand Down
Loading
Loading