eslint install (linter to js)

3030 단어 ESLint

Installation and Usage



Prerequisites: Node.js (^8.10.0, ^10.13.0, or >=11.10.1) built with SSL support. (If you are using an official Node.js distribution, SSL is always built in.)
전제 조건 : Node.js () SSL이 지원하는 것으로 빌드되고있는 것 (보통 공식 사이트에서 배포되고있는 Node.js를 사용하면 그 안에 SSL이 들어있을 것)

You can install ESLint using npm:
npm을 사용하여 ESLint를 설정합시다.
$ npm install eslint --save-devYou should then set up a configuration file:

$ ./node_modules/.bin/eslint --initAfter that, you can run ESLint on any file or directory like this:

뭔가 선택할 수 있어요~~
$ ./node_modules/.bin/eslint yourfile.js

확장(Extensions) 설정



eslint-plugin-prettier
htps : // 기주 b. 코 m / p 레치 r / 에 s ぃ

In addition to the above installation instructions, install eslint-config-prettier:
npm install --save-dev eslint-config-prettierThen you need to add plugin:prettier/recommended as the last extension in your .eslintrc.json:
{
  "extends": ["plugin:prettier/recommended"]
}

This does three things:

Enables eslint-plugin-prettier.
Sets the prettier/prettier rule to "error".
Extends the eslint-config-prettier configuration.
You can then set Prettier's own options inside a .prettierrc file.

In order to support special ESLint plugins (e.g. eslint-plugin-react), add extra exclusions for the plugins you use like so:
{
  "extends": [
    "plugin:prettier/recommended",
    "prettier/flowtype",
    "prettier/react",
    "prettier/standard"
  ]
}

For the list of every available exclusion rule set, please see the readme of eslint-config-prettier.

좋은 웹페이지 즐겨찾기