Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

visual studio code install eslint error for LF or CRLF

cation:I test js-stack-from-scratch,my OS is windows.When I yarn start,it dead! enter image description here

enter image description here

enter image description here

I know that the line-break-style of OS 'unix' or 'windows' is different, that make the error. but how to deal it? My IDE is VSC. pageage 'gulp-eslint' is yarn add.

like image 670
Tommy Avatar asked Dec 20 '16 09:12

Tommy


1 Answers

There are two ways you can achieve this. In both ways the objective is to change the linebreak style rule for eslint.

  1. Add /*eslint linebreak-style: ["error", "windows"]*/ to the top of your file. This will only remove the error from the specific file you add this code to.

  2. The more long term solution is the modify the code in the eslint.json file of your project. In general from the root of your project, you should find it in the root directory of your project named .eslint.json. Add the following code:

, "rules": { "linebreak-style": 0 }

The comma is for the line above it after the closing bracket of whatever other parameter is in the file.

like image 69
Rohit Saxena Avatar answered Oct 30 '22 05:10

Rohit Saxena