eslint

(★ 27,468)

JavaScript 코드의 문제를 찾아 수정하세요.

파일 탐색기

  • .c8rc
  • .codeclimate.yml
  • .editorconfig
  • .git-blame-ignore-revs
  • .gitattributes
  • .gitignore
  • .markdownlint.yml
  • .npmrc
  • .pre-commit-hooks.yaml
  • .prettierignore
  • .prettierrc.json
  • CHANGELOG.md
  • CONTRIBUTING.md
  • cypress.config.js
  • eslint.config.js
  • knip.jsonc
  • LICENSE
  • Makefile.js
  • package.json
  • README.md
  • SUPPORT.md
  • tsconfig.base.json
  • tsconfig.types-legacy.json
  • tsconfig.types.json
  • webpack.config.js

# 설치 가이드

node
사전 준비물

설치 및 실행 절차

npm init @eslint/config@latest

ESLint를 초기화하고 설정 파일을 생성합니다.

npx eslint yourfile.js

대상 파일에 대해 ESLint를 실행하여 코드 품질을 검사합니다.

핵심 명령어

npm init @eslint/config@latest

프로젝트에 ESLint를 대화형으로 설정하고 필요한 패키지를 설치합니다.

npx eslint src/**/*.js

특정 파일이나 디렉토리에 대해 ESLint 검사를 수행합니다.

pnpm을 사용하는 경우 루트 디렉토리에 auto-install-peers=true와 node-linker=hoisted 설정이 포함된 .npmrc 파일을 생성하는 것이 권장됩니다.

# CDN으로 사용하기

jsDelivr

jsDelivr는 공개 GitHub 리포지토리를 별도 설정 없이 CDN으로 즉시 서빙합니다. 버전과 파일을 고르면 웹페이지에 바로 붙일 수 있는 링크와 예시 코드가 만들어집니다.

명령어 용어집

이 문서에서 사용된 명령어를 모아봤습니다. 낯선 명령어가 있다면 펼쳐서 확인해보세요.

🔍

eslint

설명 보기 ▼

JavaScript 및 JSX용 플러그형 린팅 유틸리티.
더 많은 정보: <https://eslint.org/docs/latest/use/command-line-interface>.

eslint --init

ESLint 구성파일 생성:

eslint {{path/to/file1.js path/to/file2.js ...}}

하나 이상의 파일 린팅:

eslint --fix

린트 문제 수정:

🔍

npm init

설명 보기 ▼

Create a `package.json` file.

npm init

Initialize a new package with prompts:

npm init {{[-y|--yes]}}

Initialize a new package with default values:

npm init {{create-react-app}} {{my-app}}

Initialize a new package using a specific initializer:

🔍

npm install

설명 보기 ▼

Install Node packages.

npm {{[i|install]}}

Install dependencies listed in `package.json`:

npm {{[i|install]}} {{package_name}}@{{version}}

Download a specific version of a package and add it to the list of dependencies in `package.json`:

npm {{[i|install]}} {{package_name}} {{[-D|--save-dev]}}

Download the latest version of a package and add it to the list of dev dependencies in `package.json`:

🔍

npx

설명 보기 ▼

이 명령은 `npm exec`의 별칭입니다.

tldr npm exec

자세한 내용은 원본 명령을 참고하세요:

// repository documentation