Skip to content
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

Makes codeblock language and filename extensions consistent #51056

Merged
merged 9 commits into from Jun 12, 2023

Conversation

manovotny
Copy link
Contributor

There was mismatched usage of js, jsx, ts, and tsx. Just tried to get them all in sync.

@ijjk ijjk added area: documentation Font (next/font) Related to Next.js Font Optimization. labels Jun 9, 2023
errors/css-global.md Outdated Show resolved Hide resolved
@delbaoliveira
Copy link
Contributor

My preferences (though I don't feel strongly). Reasons:

  • For most of the codebases I've seen, people rarely use the .jsx extension even for React component files.
  • We have to use ```jsx annotation in code blocks to properly highlight JSX code, even if we use the .js extension.
  • We have to use .tsx extension for files that contain JSX because TypeScript will throw errors for JSX code inside .ts files.
Annotation Extension
JavaScript files with JSX code ```jsx .js
JavaScript files without JSX ```js .js
TypeScript files with JSX ```tsx .tsx
TypeScript files without JSX ```ts .ts

@manovotny
Copy link
Contributor Author

@delbaoliveira I updated everything according to your table and also added your table to the contribution guide.

delbaoliveira
delbaoliveira previously approved these changes Jun 12, 2023
Copy link
Member

@styfle styfle left a comment

Choose a reason for hiding this comment

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

Can we automate this with a lint rule?

Otherwise the mismatch will happen again in the future.

@kodiakhq kodiakhq bot merged commit a973ad6 into canary Jun 12, 2023
60 of 62 checks passed
@kodiakhq kodiakhq bot deleted the lang-and-filename-consistency branch June 12, 2023 18:55
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 13, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants