Repository navigation
Migrate to oxfmt oxlint #4068
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Migrate to oxfmt oxlint #4068
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
594a9c6
chore: migrate from XO+Prettier to oxlint+oxfmt, upgrade to TypeScript 7
amitsingh-007 8084935
style: sort imports via oxfmt sortImports
amitsingh-007 18ffe6c
style: sort tailwind classes via oxfmt sortTailwindcss
amitsingh-007 0f91668
chore: remove tooling orphaned by the oxc migration
amitsingh-007 b551c22
fix: complete TypeScript 7 integration (Next build + VS Code)
amitsingh-007 5cb544b
fix: stream Footer in Suspense; disable Next agentRules generation
amitsingh-007 a01eb3e
chore: address PR review — enable sortPackageJson, shorten lefthook c…
amitsingh-007 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,14 @@ | ||
| pre-commit: | ||
| parallel: true | ||
| parallel: false | ||
| commands: | ||
| xo: | ||
| # lint --fix first, then oxfmt last (avoids write races); stage_fixed re-stages edits | ||
| oxlint: | ||
| priority: 1 | ||
| glob: '*.{js,mjs,ts,tsx}' | ||
| run: pnpm xo {staged_files} | ||
| run: pnpm oxlint --fix {staged_files} | ||
| stage_fixed: true | ||
| oxfmt: | ||
| priority: 2 | ||
| glob: '*.{js,mjs,ts,tsx}' | ||
| run: pnpm oxfmt {staged_files} | ||
| stage_fixed: true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| { | ||
| "$schema": "./node_modules/oxfmt/configuration_schema.json", | ||
| "singleQuote": true, | ||
| "tabWidth": 2, | ||
| "printWidth": 80, | ||
| "trailingComma": "es5", | ||
| "bracketSpacing": true, | ||
| "endOfLine": "lf", | ||
| "sortPackageJson": true, | ||
| "sortTailwindcss": { | ||
| "stylesheet": "packages/ui/src/styles/globals.css", | ||
| "functions": ["clsx", "cn", "cva"] | ||
| }, | ||
| "sortImports": { | ||
| "internalPattern": [ | ||
| "@/", | ||
| "@app/", | ||
| "@ui/", | ||
| "@public/", | ||
| "@background/", | ||
| "@helpers/", | ||
| "@popup/", | ||
| "@store/" | ||
| ] | ||
| }, | ||
| "ignorePatterns": [ | ||
| "packages/ui/src", | ||
| "**/.output/**", | ||
| "**/.next/**", | ||
| "**/.wxt/**" | ||
| ] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,85 @@ | ||
| { | ||
| "$schema": "./node_modules/oxlint/configuration_schema.json", | ||
| "plugins": ["typescript", "unicorn", "oxc", "react", "import", "promise"], | ||
| "jsPlugins": ["oxlint-tailwindcss"], | ||
| "categories": { | ||
| "correctness": "error" | ||
| }, | ||
| "settings": { | ||
| "next": { | ||
| "rootDir": "apps/web/" | ||
| }, | ||
| "tailwindcss": { | ||
| "entryPoint": "packages/ui/src/styles/globals.css" | ||
| } | ||
| }, | ||
| "options": { | ||
| "typeAware": true, | ||
| "reportUnusedDisableDirectives": "warn" | ||
| }, | ||
| "rules": { | ||
| "react/react-in-jsx-scope": "off", | ||
|
|
||
| "typescript/no-unsafe-assignment": "off", | ||
| "typescript/no-unsafe-return": "off", | ||
| "typescript/no-unsafe-argument": "off", | ||
| "typescript/no-unsafe-call": "off", | ||
| "typescript/no-dynamic-delete": "off", | ||
| "typescript/triple-slash-reference": "off", | ||
|
|
||
| "typescript/no-floating-promises": "off", | ||
| "typescript/no-useless-default-assignment": "off", | ||
| "typescript/unbound-method": "off", | ||
|
|
||
| "typescript/no-unused-vars": ["error", { "argsIgnorePattern": "^_" }], | ||
| "typescript/consistent-type-definitions": ["error", "interface"], | ||
| "typescript/no-confusing-void-expression": [ | ||
| "error", | ||
| { "ignoreArrowShorthand": true } | ||
| ], | ||
| "typescript/no-base-to-string": [ | ||
| "error", | ||
| { "ignoredTypeNames": ["TRPCError", "URL", "URLSearchParams"] } | ||
| ], | ||
| "typescript/restrict-template-expressions": [ | ||
| "error", | ||
| { "allow": ["TRPCError", "Date"] } | ||
| ], | ||
| "typescript/switch-exhaustiveness-check": [ | ||
| "error", | ||
| { | ||
| "considerDefaultExhaustiveForUnions": true, | ||
| "requireDefaultForNonUnion": true | ||
| } | ||
| ], | ||
|
|
||
| "tailwindcss/no-unknown-classes": [ | ||
| "error", | ||
| { "allowlist": ["max-w-panel"] } | ||
| ], | ||
| "tailwindcss/no-conflicting-classes": "error", | ||
| "tailwindcss/no-duplicate-classes": "error", | ||
| "tailwindcss/no-deprecated-classes": "error" | ||
| }, | ||
| "overrides": [ | ||
| { | ||
| "files": ["apps/web/**/*.{ts,tsx}"], | ||
| "plugins": ["nextjs"] | ||
| }, | ||
| { | ||
| "files": [ | ||
| "apps/extension/**/*.{ts,tsx}", | ||
| "packages/shared/**/*.{ts,tsx}" | ||
| ], | ||
| "rules": { | ||
| "react/react-compiler": "warn" | ||
| } | ||
| } | ||
| ], | ||
| "ignorePatterns": [ | ||
| "apps/web/next-env.d.ts", | ||
| "apps/extension/.output/**", | ||
| "apps/extension/.wxt/**", | ||
| "packages/ui/**" | ||
|
amitsingh-007 marked this conversation as resolved.
|
||
| ] | ||
| } | ||
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| { | ||
| "recommendations": ["oxc.oxc-vscode", "TypeScriptTeam.native-preview"] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,21 @@ | ||
| { | ||
| "js/ts.tsdk.path": "node_modules/typescript/lib" | ||
| "js/ts.experimental.useTsgo": true, | ||
| "js/ts.tsdk.path": "./node_modules/typescript", | ||
|
|
||
| "oxc.enable": true, | ||
| "oxc.enable.oxfmt": true, | ||
| "oxc.lint.run": "onSave", | ||
| "oxc.typeAware": true, | ||
|
|
||
| "editor.defaultFormatter": "oxc.oxc-vscode", | ||
| "editor.formatOnSave": true, | ||
| "editor.formatOnSaveMode": "file", | ||
| "editor.codeActionsOnSave": { | ||
| "source.fixAll.oxc": "explicit" | ||
| }, | ||
|
|
||
| "[typescript]": { "editor.defaultFormatter": "oxc.oxc-vscode" }, | ||
| "[typescriptreact]": { "editor.defaultFormatter": "oxc.oxc-vscode" }, | ||
| "[javascript]": { "editor.defaultFormatter": "oxc.oxc-vscode" }, | ||
| "[javascriptreact]": { "editor.defaultFormatter": "oxc.oxc-vscode" } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 3 additions & 2 deletions
5
apps/extension/src/entrypoints/background/redirections/index.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
apps/extension/src/entrypoints/background/redirections/mapper.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletion
3
apps/extension/src/entrypoints/background/utils/receiveRuntimeMessage.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
apps/extension/src/entrypoints/background/websites/storageSync.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
apps/extension/src/entrypoints/popup/components/ContextMenu.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
apps/extension/src/entrypoints/popup/components/PopupRoutes.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletion
3
apps/extension/src/entrypoints/popup/components/StoreListener.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.