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

Error in New Projects: ␍ eslint/prettier issue with file logging. #6

Open
EngenMe opened this issue Oct 16, 2024 · 0 comments
Open

Comments

@EngenMe
Copy link

EngenMe commented Oct 16, 2024

When creating a new project using this repo, I encountered an issue while trying to log to any file in the route. The following error appears in the console:

Delete ␍ eslintprettier/prettier

image

I think that the issue occurs due to a mismatch in the line endings used across different systems (Windows vs. Unix-based systems). The error stems from the presence of carriage return (␍) characters, which are common in Windows environments but not expected by the default ESLint/Prettier configuration in the repo.

Steps to Reproduce:

  1. Create a new project using this repo.
  2. run npm i to install all dependencies.
  3. Log any file in the route.
  4. Observe the ESLint/Prettier error in the terminal or editor.

Proposed Solution:

To fix the issue, simply add the following line to the .eslintrc file:
"prettier/prettier": ["error", { "endOfLine": "auto" }]

This will make Prettier automatically handle the line endings based on the user's environment, preventing the error from occurring.

After adding this line, the error disappears, and logging works as expected across different environments.

@EngenMe EngenMe closed this as completed Oct 17, 2024
@EngenMe EngenMe reopened this Oct 17, 2024
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

No branches or pull requests

1 participant