Added more oxfmt settings - #2
Conversation
- Created `.vscode/extensions.json` to recommend the `oxc-vscode` extension. - Added `.vscode/settings.json` to configure default formatter and formatting options. - Refactored code in `sample.ts`, `base.ts`, `react.ts`, `shared.ts`, and `index.ts` for consistent formatting. - Updated `oxfmt` configuration with new formatting options and overrides for Markdown files. - Adjusted test file patterns in `vitest/base.ts` for improved clarity.
There was a problem hiding this comment.
This one was migrated using the oxfmt --migrate command against the base skuba config, what's all the other stuff?
There was a problem hiding this comment.
There is intellisense on every property
| tabWidth: 2, | ||
| trailingComma: 'all', | ||
| printWidth: 80, | ||
| endOfLine: 'lf', |
There was a problem hiding this comment.
ensure we don't have a mix of crlf and lf
There was a problem hiding this comment.
There is intellisense on every property
| sortImports: { | ||
| groups: ['builtin', 'external', ['internal', 'subpath'], ['parent', 'sibling', 'index'], 'unknown'], | ||
| newlinesBetween: true, | ||
| ignoreCase: false, | ||
| order: 'asc', | ||
| }, |
There was a problem hiding this comment.
Eslint raised an issue on this but here we just do the formatting for you
There was a problem hiding this comment.
oxc look to have moved this to more of a formatting concern
| arrowParens: 'always', | ||
| bracketSpacing: true, | ||
| quoteProps: 'as-needed', | ||
| proseWrap: 'always', |
There was a problem hiding this comment.
I am not sure this should be added as a part of the first release, just in the name of consistency.
Also seems it only applies to Markdown, MDX and YAML 🤔
https://oxc.rs/docs/guide/usage/formatter/config-file-reference.html#prosewrap
We've already removed Markdown from that list and as someone who owns too much mdx I am not sure we'd want it on that either... and at that point is it worth it just for yaml 🤷
There was a problem hiding this comment.
commented in other line, yes this should not be for md or yaml
| files: ['*.md'], | ||
| options: { | ||
| proseWrap: 'preserve', | ||
| }, |
There was a problem hiding this comment.
don't do word wrapping in markdown as that breaks the markdown
There was a problem hiding this comment.
@zbrydon this ensures that it wont affect markdown, we can add yaml and yml here as well
zbrydon
left a comment
There was a problem hiding this comment.
I'll have to find some time to have a proper look but initially my thoughts on the direction we should take is attempt to replicate the prettier and eslint behaviour exactly introducing no changes that we don't have to then where there are inherent differences we come to a consensus on what direction we want to go with.
From there we can start adding any/all the new fancy settings as we se fit in such a away that is easier to digest than a migration and rule changes for consumers
| arrowParens: 'always', | ||
| bracketSpacing: true, | ||
| quoteProps: 'as-needed', | ||
| proseWrap: 'always', |
There was a problem hiding this comment.
I am not sure this should be added as a part of the first release, just in the name of consistency.
Also seems it only applies to Markdown, MDX and YAML 🤔
https://oxc.rs/docs/guide/usage/formatter/config-file-reference.html#prosewrap
We've already removed Markdown from that list and as someone who owns too much mdx I am not sure we'd want it on that either... and at that point is it worth it just for yaml 🤷
| semi: true, | ||
| arrowParens: 'always', | ||
| bracketSpacing: true, | ||
| quoteProps: 'as-needed', |
There was a problem hiding this comment.
What are our thoughts on explicitly setting defaults?
There was a problem hiding this comment.
we can remove most but bracketSpacing: true, does come up a lot, it would be great to keep just this one
Settings added to cover some things that eslint did that oxfmt does
.vscode/extensions.jsonto recommend theoxc-vscodeextension..vscode/settings.jsonto configure default formatter and formatting options.sample.ts,base.ts,react.ts,shared.ts, andindex.tsfor consistent formatting.oxfmtconfiguration with new formatting options and overrides for Markdown files.vitest/base.tsfor improved clarity.