# 选项一 - 如何使用 ESLint ? How would you like to use ESLint? … To check syntax only ▸ To check syntax and find problems To check syntax, find problems, and enforce code style # 注:如果选择了第 3 项,后续选项会不一样
# 选项二 - 模块引入方式 ? What type of modules does your project use? … ▸ JavaScript modules (import/export) CommonJS (require/exports) None of these
# 选项三 - 项目使用的框架 ? Which framework does your project use? … React ▸ Vue.js None of these
# 选项四 - 是否使用 TypeScript ? Does your project use TypeScript? ‣ No / Yes
# 选项五 - 项目使用的环境,可以都选或都不选 ? Where does your code run? … (Press <space> to select, <a> to toggle all, <i> to invert selection) ✔ Browser ✔ Node
# 选项六 - ESLint Config 文件保存为何种格式,建议 JS,JSON 不支持注释 ? What format do you want your config file to be in? … ▸ JavaScript YAML JSON
# 选项七 - 根据选择可能需要安装额外的项目,比如 vue 的插件 The config that you ve selected requires the following dependencies:
eslint-plugin-vue@latest
# 选项七 - 是否直接安装上边列出的项目 ? Would you like to install them now? ‣ No / Yes
# 选项八 - 如果上一步选择了安装,会询问使用的包管理器 ? Which package manager do you want to use? … npm yarn ▸ pnpm
# ------------
# 如果上边「选项一」选择了「To check syntax, find problems, and enforce code style」,会多出以下选项 ? How would you like to define a style for your project? … Use a popular style guide ▸ Answer questions about your style
# 分支二 - 询问具体的代码风格,包括缩进、引号、分号等 ✔ How would you like to define a style for your project? · prompt ✔ What style of indentation do you use? · 4 ✔ What quotes do you use for strings? · double ✔ What line endings do you use? · unix ✔ Do you require semicolons? · No / Yes
# 分支一 - 选择 google 等厂商的代码风格 ✔ How would you like to define a style for your project? · guide ✔ Which style guide do you want to follow? · google