eslint-stylistic / eslint-stylistic

Monorepo for ESLint Stylistic plugins and configs
https://eslint.style
MIT License
1.34k stars 90 forks source link

Merge js/ts/jsx into single package #482

Open antfu opened 1 month ago

antfu commented 1 month ago

https://github.com/eslint-stylistic/eslint-stylistic/pull/466#issuecomment-2254248750

✅ Stage 1

We can first colocate js and its implementations inside the same package, but keep them as separate files. For example:

|- packages/eslint-plugin/rules
   |- indent
      | indent-js.ts
      | indent-ts.ts
      | indent.ts
      | indent-js.test.ts
      | indent-ts.test.ts

Where we also have package/eslint-plugin-js/indent/indent.ts re-export from package/eslint-plugin/indent/indent-js.ts

We don't touch the content of those files at all, but only the file structure. This way we can move forward and doing releases without changing the runtime implementation at all.

👉 Stage 2

We can then refactor those files under each folder and make sure the ts version passes both js/ts tests. We can start to use the indent-ts to replace the js rules

Stage 3

We merge the implantation of indent-js and indent-ts without touching the tests, where the tests guard us to make sure we don't break the behavior.

Stage 4

Deprecate sub packages, refactoring docs and project structure. Release as v3.0

antfu commented 2 weeks ago

/cc @9romise now we are reaching stage 2 - feel free to work on that if you are still interested in helping migrate. Thanks!