Update 03-eslint.mdx to allow EsLint work properly with prettier #74235
+1
−1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Title: Fix: Prettier Integration in eslint.config.mjs
Description: Documenting the fix for the Prettier extension in the eslint.config.mjs file
Date: 2024-12-23
Contribution: Fix Prettier Integration in
eslint.config.mjs
Overview
This document details the fix implemented for an issue with the Prettier extension configuration in the
eslint.config.mjs
.Problem Statement
The Prettier extension configuration in the Next.js documentation did not work as intended. Specifically, the following code snippet caused issues:
Root Cause
The issue stemmed from using
'prettier'
in theextends
array. This configuration does not properly enable the Prettier integration with ESLint in Next.js projects.Solution
The fix involved replacing
'prettier'
with'plugin:prettier/recommended'
in theextends
array. This adjustment ensures that Prettier is correctly integrated with ESLint.Changes Made
Here is the corrected configuration:
Steps Followed
Cloning the Repository
Install Prettier
Identifying the Issue
.prettierrc
file in root directoryIdentifying the Issue
Implementing the Fix
'prettier'
with'plugin:prettier/recommended'
in theextends
array as shown above.Testing the Fix
.prettierrc
file.Conclusion
This fix updates the documentation to provide a working Prettier integration configuration for Next.js projects, improving the developer experience and ensuring consistent code formatting.
Related Links
If you have any questions or feedback about this contribution, feel free to leave a comment on the pull request!