Next.js Discord

Discord Forum

Fixed: ESLint ignoring rules

Answered
Rough harvester ant posted this in #help-forum
Open in Discord
Rough harvester antOP
Error: Expected linebreaks to be 'LF' but found 'CRLF'. linebreak-style during linting in builds.


Context:

Using Next.js with ESLint

linebreak-style error not going away (Expected linebreaks to be 'LF' but found 'CRLF')

Trying to disable or bypass it completely

Tried so far:

Created .eslintrc.js in project root with 'linebreak-style': 'off'

Verified ESLint is installed and running via npx next lint

Restarted VS Code to clear any caching

Checked for nested .eslintrc.* files in subdirectories (none found or removed)

Ran ESLint manually using npx eslint . --ext js,ts,tsx --no-eslintrc --config .eslintrc.js

Checked .prettierrc and .editorconfig for conflicting endOfLine settings

Updated Git config: core.autocrlf set to input
Answered by Rough harvester ant
Fixed - I had a typescript.js file where
'linebreak-style': ['error', 'unix']

Should have been
'linebreak-style': ['error', 'windows']
View full answer

1 Reply

Rough harvester antOP
Fixed - I had a typescript.js file where
'linebreak-style': ['error', 'unix']

Should have been
'linebreak-style': ['error', 'windows']
Answer