eslint-config-wordpress icon indicating copy to clipboard operation
eslint-config-wordpress copied to clipboard

Add support for Windows Line Endings by removing the `linebreak-style` rule

Open ntwb opened this issue 7 years ago • 2 comments

Via https://github.com/WordPress/gutenberg/issues/7611#issuecomment-401087223

Remove linebreak-style rule: https://github.com/WordPress-Coding-Standards/eslint-config-wordpress/blob/0660e2966824f2615dc0c6c4111363a5bae5cf58/index.js#L66-L67

..............................................
 312:2    error  Expected linebreaks to be 'LF' but found 'CRLF'  linebreak-style
 313:1    error  Expected linebreaks to be 'LF' but found 'CRLF'  linebreak-style
 314:25   error  Expected linebreaks to be 'LF' but found 'CRLF'  linebreak-style

✖ 75569 problems (75569 errors, 0 warnings)

ntwb avatar Jun 29 '18 03:06 ntwb

Open package.json, added following rules under rules line:

"rules": {
  "linebreak-style": 0,
  "global-require": 0,
  ...

for VScode users: click the option at the bottom-right of the window and set it to LF from CRLF errors will fixed for me

gmkhussain avatar Sep 11 '18 14:09 gmkhussain

Against it, if you are using Windows line breaks just change your editor to use LF instead. 99% of the WP ecosystem is geared towards Linux and by allowing Windows line breaks it will just lead to issues for 98% of other developers.

kkmuffme avatar Dec 16 '18 09:12 kkmuffme