Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
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
1 change: 1 addition & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pnpm exec lint-staged
3 changes: 3 additions & 0 deletions .lintstagedrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
'*': 'prettier --write --ignore-unknown',
};
4 changes: 4 additions & 0 deletions library/.lintstagedrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export default {
'*.{ts,js,json,md}': 'prettier --write',
'src/**/*.ts': ['prettier --write', 'eslint --fix'],
};
5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,13 @@
"private": true,
"devDependencies": {
"@trivago/prettier-plugin-sort-imports": "^5.2.2",
"husky": "^9.1.7",
"lint-staged": "^16.1.6",
"prettier": "^3.5.2",
"prettier-plugin-tailwindcss": "^0.6.11",
"typescript": "^5.7.3"
},
"scripts": {
"prepare": "husky"
}
}
4 changes: 4 additions & 0 deletions packages/i18n/.lintstagedrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export default {
'*.{ts,js,json,md}': 'prettier --write',
'src/**/*.ts': ['prettier --write', () => 'tsc -p tsconfig.json --noEmit'],
Copy link

Copilot AI Sep 17, 2025

Choose a reason for hiding this comment

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

The arrow function returning a string will not execute the TypeScript compiler. The function should return a command that lint-staged can execute, or use a string directly like 'tsc -p tsconfig.json --noEmit'.

Suggested change
'src/**/*.ts': ['prettier --write', () => 'tsc -p tsconfig.json --noEmit'],
'src/**/*.ts': ['prettier --write', 'tsc -p tsconfig.json --noEmit'],

Copilot uses AI. Check for mistakes.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

It seems like we should check the entire project to determine whether a file has the correct types. Therefore, we don't need to provide a path to a specific file, as lint-staged does. This is recommended by the creators of lint-staged.

https://github.com/lint-staged/lint-staged?tab=readme-ov-file#example-run-tsc-on-changes-to-typescript-files-but-do-not-pass-any-filename-arguments

};
4 changes: 4 additions & 0 deletions packages/to-json-schema/.lintstagedrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export default {
'*.{ts,js,json,md}': 'prettier --write',
'src/**/*.ts': ['prettier --write', 'eslint --fix'],
};
332 changes: 281 additions & 51 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions website/.lintstagedrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export default {
'*.{ts,js,cjs,json,md}': 'prettier --write',
'src/**/*.css': 'prettier --write',
'src/**/*.{ts,tsx}': ['prettier --write', 'eslint --fix'],
Copy link
Owner

Choose a reason for hiding this comment

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

I think we need to add MDX here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you. I added mdx for prettier, eslint is not configured for mdx yet.

};