noodle-run / noodle

Rethinking Student Productivity
https://noodle.run
GNU Affero General Public License v3.0
12.02k stars 763 forks source link

Consistent configuration filetype #341

Closed Erb3 closed 1 year ago

Erb3 commented 1 year ago

Currently, the configuration files all use different filetypes:

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 commented 1 year ago

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 commented 1 year ago

Got it :+1:, in that case there is not much to change