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

feat(eslint): rename eslint.config.js to eslint.config.cjs to resolve them as CommonJS #29334

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jaysoo
Copy link
Member

@jaysoo jaysoo commented Dec 12, 2024

This PR updates our generators to use eslint.config.cjs instead of eslint.config.js so that Node resolution will treat it as CommonJS. This solves an issue where having "type": "module" in package.json will result in an error when Node tries to resolve the config file as ESM.

Also allows us to clean up out Remix generators to not have to rename to eslint.config.cjs to solve the same issue.

Current Behavior

Expected Behavior

Related Issue(s)

Fixes #

Copy link

vercel bot commented Dec 12, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
nx-dev ✅ Ready (Inspect) Visit Preview Dec 13, 2024 9:21pm

Copy link

nx-cloud bot commented Dec 12, 2024

Your CI Pipeline Execution ↗ for commit f27e9c6 ⏳ is in progress.

Command Status Duration Result
nx affected --targets=lint,test,build,e2e,e2e-c... ❌ Failed 31m, 24s View ↗
nx run-many -t check-imports check-commit check... ✅ Succeeded 1m, 1s View ↗
nx-cloud record -- nx format:check --base=a8de7... ✅ Succeeded 23s View ↗
nx-cloud record -- nx-cloud conformance:check ✅ Succeeded 0s View ↗
nx-cloud record -- nx sync:check ✅ Succeeded 17s View ↗
nx documentation --no-dte ✅ Succeeded 41s View ↗

Last updated at 2024-12-13 21:49:06UTC

Sent with 💌 from NxCloud.

@jaysoo jaysoo force-pushed the feat/eslint_config_cjs branch from 144e881 to 0fa0b93 Compare December 13, 2024 04:24
@jaysoo jaysoo force-pushed the feat/eslint_config_cjs branch from 0fa0b93 to 224a3ee Compare December 13, 2024 14:15
@jaysoo jaysoo force-pushed the feat/eslint_config_cjs branch from 224a3ee to 29bb7fe Compare December 13, 2024 14:45
@jaysoo jaysoo force-pushed the feat/eslint_config_cjs branch 4 times, most recently from 4506885 to b6aa8af Compare December 13, 2024 16:00
@jaysoo jaysoo force-pushed the feat/eslint_config_cjs branch from b6aa8af to 5d373e1 Compare December 13, 2024 18:23
@jaysoo jaysoo force-pushed the feat/eslint_config_cjs branch from 5d373e1 to 3126725 Compare December 13, 2024 19:28
@jaysoo jaysoo force-pushed the feat/eslint_config_cjs branch from 3126725 to 053838f Compare December 13, 2024 19:57
@jaysoo jaysoo marked this pull request as ready for review December 13, 2024 19:59
@jaysoo jaysoo requested review from a team and Coly010 as code owners December 13, 2024 19:59
@jaysoo jaysoo requested a review from xiongemi December 13, 2024 19:59
@@ -51,7 +51,7 @@ export function updateFilesForRootProjects(
if (!allowedExt.includes(ext)) {
continue;
}
if (file === '.eslintrc.json' || file === 'eslint.config.js') {
if (file === '.eslintrc.json' || file === 'eslint.config.cjs') {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why was this one a replacement when others were applied in addition to the existing?

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

Successfully merging this pull request may close these issues.

3 participants