redux-toolkit icon indicating copy to clipboard operation
redux-toolkit copied to clipboard

Centralize tooling configs in monorepo

Open aryaemami59 opened this issue 1 year ago • 11 comments

This PR:

  • [X] Creates dedicated repos housing shareable config files for:
  • ESLint
  • Prettier
  • TypeScript
  • Vitest

Part 1 of 3

This PR precedes #4606 and #4607.

This is the initial step in a three-part effort to centralize tooling configurations so they can be shared across multiple repos.

Subsequent PRs:

  • Part 2: Adopts the centralized tooling configurations across the codebase.
  • Part 3: Implements the necessary changes to comply with the new centralized configurations.

aryaemami59 avatar Jan 29 '24 20:01 aryaemami59

Review or Edit in CodeSandbox

Open the branch in Web EditorVS CodeInsiders
Open Preview

codesandbox[bot] avatar Jan 29 '24 20:01 codesandbox[bot]

Deploy Preview for redux-starter-kit-docs ready!

Name Link
Latest commit 260f9233489285150051bed1b119158bc5664cd7
Latest deploy log https://app.netlify.com/projects/redux-starter-kit-docs/deploys/68f8a66d586d5c00088881df
Deploy Preview https://deploy-preview-4138--redux-starter-kit-docs.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

netlify[bot] avatar Jan 29 '24 20:01 netlify[bot]

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 260f9233489285150051bed1b119158bc5664cd7:

Sandbox Source
@examples-query-react/basic Configuration
@examples-query-react/advanced Configuration
@examples-action-listener/counter Configuration
rtk-esm-cra Configuration

codesandbox-ci[bot] avatar Jan 29 '24 20:01 codesandbox-ci[bot]

Okay, what I think I'm seeing here is:

  • Added the configs
  • A lot of lint fixes, mostly around auto-sorting of imports and forcing type imports
  • Extracting some reusable TS types like AnyObject

Can I get a summary of what lint rules changed?

Also it looks like there's some commented out lint rules in the ESLint config

markerikson avatar Feb 08 '24 17:02 markerikson

@markerikson

Sure, so mostly what I did was, add 2 configs:

  • plugin:@typescript-eslint/recommended
  • plugin:@typescript-eslint/stylistic

Along with prettier which turns off ESLint rules that conflict with Prettier. Then I fixed all the lint issues, and the ones that were not worth fixing (or were too time consuming) I disabled. As for the commented out rules, I will probably put up another PR after this one, with those rules and configs enabled and make adjustments and fixes as needed. I just did not want to do it all in one PR because this PR is already way too large as it is.

aryaemami59 avatar Feb 08 '24 17:02 aryaemami59

could you add a "prepack": "yarn build" script to any of the packages with a build step? it means we can use our existing publish action with them

EskiMojo14 avatar Feb 08 '24 21:02 EskiMojo14

could you add a "prepack": "yarn build" script to any of the packages with a build step? it means we can use our existing publish action with them

Yeah sure!

aryaemami59 avatar Feb 08 '24 21:02 aryaemami59

Hey @aryaemami59, is ESLint being run in CI anywhere? I just noticed we're not running it on React Redux and it's been bugged for a while in that repo. Our first job is currently Lint, Test, Build & Pack, but it appears to only be Build & Pack 😬 Luckily we test in the TS matrix, but I don't think ESLint is run anywhere along the way.

timdorr avatar Jun 09 '24 20:06 timdorr

@timdorr yeah I kinda knew we weren't running ESLint during CI, I think we're only running it for Reselect. Honestly my plan was to add it to CI after we take care of this one. If you want I can take care of it tomorrow.

aryaemami59 avatar Jun 09 '24 22:06 aryaemami59

Can we separate out these changes into multiple PRs?

  • One to add all the new tooling configs
  • Second to actually switch to using the configs for testing and such
  • And a third to apply just any formatting changes

Also, why is yarn-4.1.0.cjs getting changed? Did it get formatted or something?

markerikson avatar Aug 11 '24 14:08 markerikson

I'm gonna split this into multiple PRs soon.

aryaemami59 avatar Aug 24 '24 22:08 aryaemami59