zoukankan      html  css  js  c++  java
  • eslint初始化配置

    1、安装:npm install eslint --save-dev

    2、./node_modules/.bin/eslint --init命令初始化eslint;

    3、(1)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 // 检查语法错误,发现问题代码,校验代码风格

                  选第三个,检查语法错误,发现问题代码,校验代码风格

          (2)What type of modules dos your project use?

    JavaScript modules (import/export) // ESM:允许使用import/export
    CommonJS (require/exports) // CommonJS:允许使用require/exports
    > None of these // 没有用到任何模块化

    选第一个,import/export

          (3)Which framework does you project use?

                   React

                   Vue.js

                   > None of these

                   选vue

          (4)Does your project use TypeScript? No / Yes

                   输入yes

          (5)Where does you code run? // 多选

    (*) Browser // 浏览器环境

    (*) Node // node环境

    选浏览器

          (6)How would you like to define a style for your project?

    > Use a popular style guide // 使用一个市面上的主流风格
    Answer questions about your style // 通过回答问题,形成一个风格
    Inspect your JavaScript file(s) // 根据JS代码文件,推断代码风格

    选第一个,市面主流风格

          (7)Which style guide do you want to follow?

    Airbnb: https://github.com/airbnb/javascript
    > Standard: https://github.com/standard/standard
    Google: https://github.com/google/eslint-config-google

    选第二个,开源

  • 相关阅读:
    android.mk 文件中变量
    【转】An Intuitive Guide To Exponential Functions & e
    卷积相关
    opencv 调试时不显示图像
    Luhn 算法-- 信用卡号码的校验
    perl 脚本实现简单搜索修改文件并生成diff文件
    【转】gcc: multiple definition of [转]
    【转】undefined reference问题总结
    【转】pthread_cond_t怎么使用
    linux编程使用记录
  • 原文地址:https://www.cnblogs.com/luchangzhu/p/15232513.html
Copyright © 2011-2022 走看看