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

Consistent configuration filetype #341

Closed
Erb3 opened this issue Oct 31, 2023 · 2 comments
Closed

Consistent configuration filetype #341

Erb3 opened this issue Oct 31, 2023 · 2 comments

Comments

@Erb3
Copy link
Contributor

Erb3 commented Oct 31, 2023

Currently, the configuration files all use different filetypes:

  • ts
  • js
  • mjs
  • cjs
  • json
  • yml

I believe for the sake of consistency, we should try to keep the amount of different filetypes to a minimal.
I've made a table below about what software supports what filetypes:

Software json ts ESModule CommonJS
Tailwind ✔️ ✔️ ✔️
Prettier ✔️ ✔️ ✔️
PostCSS ✔️
Next ✔️ ✔️
Drizzle ✔️ ✔️ ✔️
ESLint ✔️ ✔️ ✔️
@ixahmedxi
Copy link
Collaborator

So my opinion on configuration files is the following:

It doesn't matter if they are all the same filetype or not, what matters the most is the type-safety, it's one of the core values of this project and so with that here is the order in which configuration files should be in by their compatibility:

  1. TypeScript
  2. ESModule
  3. CJS
  4. JSON

Typescript just comes with the type-safety built-in and it's my preferred choice for config files, ESM and CJS both are the next best thing because you can still use jsdoc comments and checkJS in the tsconfig to get type-checking in them, and if all fails then json it is.

@Erb3
Copy link
Contributor Author

Erb3 commented Nov 1, 2023

Got it 👍, in that case there is not much to change

@Erb3 Erb3 closed this as not planned Won't fix, can't repro, duplicate, stale Nov 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants