bulletproof-react icon indicating copy to clipboard operation
bulletproof-react copied to clipboard

chore: create .gitattributes file specifying LF line endings due to ESLint "error on line ending CRLF" behavior from rule "prettier/prettier: ["error"]"

Open DoctorDerek opened this issue 4 years ago • 1 comments
trafficstars

tl;dr This forces LF endings (instead of auto / CRLF line endings) resolving "every line is an ESLint error" behavior on Windows that results from the ESLint rule "prettier/prettier: ['error']"

Otherwise, I'll just quote myself from @tailwind-nextjs-starter-blog#19

There once was a man from Nantucket,
who developed on a Macintosh bucket.
He set up his ESLint to flag Prettier errors,
And Windows developers got CR* terrors.
The man was no fan, so he hatched up a plan:
He would ask Git to enforce LF** characters.
So now developers rejoice, because of his choice:
They can keep their Windows kit, not chuck it.

*Carriage Return, **Line Feed

Original poetry! Boom 💥

eslintrc.js

  ...
  extends: [
    'plugin:prettier/recommended',
  ],
  rules: {
    'prettier/prettier': 'error',
  }
}

See further discussion + screenshots in tailwindlabs/tailwindcss#3760

DoctorDerek avatar Jul 26 '21 22:07 DoctorDerek

Note: This includes this commit from #13 because I managed to commit twice.

At least it will make it easier to merge both PRs (if you agree & do so) consecutively without reversion.

DoctorDerek avatar Jul 26 '21 22:07 DoctorDerek