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

fix(esm): get lint working #10152

Merged
merged 26 commits into from Mar 9, 2024
Merged

fix(esm): get lint working #10152

merged 26 commits into from Mar 9, 2024

Conversation

jtoar
Copy link
Contributor

@jtoar jtoar commented Mar 8, 2024

Started this PR so that an ESM project could run yarn rw lint (right now you'd get the following error:

Oops! Something went wrong! :(

ESLint: 8.55.0

Error [ERR_REQUIRE_ESM]: require() of ES Module ~/redwood-app/prettier.config.js from ~/redwood-app/node_modules/prettier/third-party.js not supported.
Instead change the require of prettier.config.js in ~/redwood-app/node_modules/prettier/third-party.js to a dynamic import() which is available in all CommonJS modules.

) but didn't quite fix that yet—that seems to require Prettier v3 which may be possible to release in a minor thanks to @Josh-Walker-GM's efforts porting us over to Vitest!

While this PR doesn't get yarn rw lint working, it does get a bunch of generators and setup commands working that use Prettier since they were using require to import the prettier config file.

@jtoar jtoar added the release:fix This PR is a fix label Mar 8, 2024
@jtoar jtoar added this to the next-release-patch milestone Mar 8, 2024
@jtoar jtoar marked this pull request as ready for review March 8, 2024 16:43
@jtoar jtoar added fixture-ok Override the test project fixture check and removed fixture-ok Override the test project fixture check labels Mar 8, 2024
@jtoar jtoar merged commit dac624c into main Mar 9, 2024
41 checks passed
@jtoar jtoar deleted the ds-esm/get-lint-working branch March 9, 2024 17:21
jtoar added a commit that referenced this pull request Mar 9, 2024
Started this PR so that an ESM project could run `yarn rw lint` (right
now you'd get the following error:

```
Oops! Something went wrong! :(

ESLint: 8.55.0

Error [ERR_REQUIRE_ESM]: require() of ES Module ~/redwood-app/prettier.config.js from ~/redwood-app/node_modules/prettier/third-party.js not supported.
Instead change the require of prettier.config.js in ~/redwood-app/node_modules/prettier/third-party.js to a dynamic import() which is available in all CommonJS modules.
```

) but didn't quite fix that yet—that seems to require Prettier v3 which
may be possible to release in a minor thanks to @Josh-Walker-GM's
efforts porting us over to Vitest!

While this PR doesn't get `yarn rw lint` working, it does get a bunch of
generators and setup commands working that use Prettier since they were
using `require` to import the prettier config file.

---------

Co-authored-by: Josh GM Walker <56300765+Josh-Walker-GM@users.noreply.github.com>
@jtoar jtoar modified the milestones: next-release-patch, v7.2.0 Mar 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release:fix This PR is a fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants