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
2 changes: 0 additions & 2 deletions .prettierignore

This file was deleted.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
"type": "module",
"scripts": {
"build": "pnpm --filter './packages/**' build",
"check:format": "prettier . --check --experimental-cli",
"check:format": "rs fmt --check",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Run formatting through the source CLI before builds

On a fresh checkout after pnpm install, both formatting scripts now resolve the workspace rs binary, whose packages/rstack/bin/rs.js:16 imports the gitignored dist/index.js; because installation no longer builds that package, pnpm check:format and pnpm format fail until contributors manually run a build. Use the repository source entry point (node scripts/rs.js fmt ...) as the existing prepare script does so these documented formatting commands remain usable independently of a build.

AGENTS.md reference: AGENTS.md:L19-L23

Useful? React with 👍 / 👎.

"check:spell": "pnpm dlx cspell && heading-case",
"doc": "pnpm --dir website dev",
"doc:build": "node --run build && pnpm --dir website build",
"format": "prettier . --write --experimental-cli && heading-case --write",
"format": "rs fmt && heading-case --write",
"lint": "rs lint --type-check",
"prepare": "node scripts/rs.js setup",
"test": "pnpm --filter './packages/**' test"
Expand Down
6 changes: 0 additions & 6 deletions prettier.config.mjs

This file was deleted.

16 changes: 10 additions & 6 deletions rstack.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,15 @@ define.lint(async () => {
];
});

define.fmt({
ignorePatterns: ['**/dist/**', 'pnpm-lock.yaml'],
// TODO: Enable after rs fmt supports resolving Prettier plugins from the project root.
// plugins: ['prettier-plugin-packagejson'],
printWidth: 100,
singleQuote: true,
});

define.staged({
'*.{js,jsx,ts,tsx,mjs,cjs,mts,cts}': [
'rs lint --fix',
'prettier --write --experimental-cli --no-error-on-unmatched-pattern',
],
'*.{json,jsonc,md,mdx,css,html,yml,yaml}':
'prettier --write --experimental-cli --no-error-on-unmatched-pattern',
'*.{js,jsx,ts,tsx,mjs,cjs,mts,cts}': ['rs lint --fix', 'rs fmt'],
'*.{json,jsonc,md,mdx,css,html,yml,yaml}': 'rs fmt',
});