适合微信小程序使用的 ESLint 配置文件

普鲁文,开发

自己用的最基本的小程序 ESLint 配置文件。
基于 Airbnb 风格,仅增加小程序的特殊设置,减少不必要的报错。编辑 .eslintrc.js 文件,替换为以下代码即可。

module.exports = {
  "extends": "airbnb-base", // Airbnb 风格
  rules: {
    'no-console': 'off', // 允许在代码中保留 console 命令
  },
  globals: {
    wx: null,
    App: null,
    Page: null,
    getApp: null,
    Component: null,
  },
};

Twitter · GitHub · Instagram · pluwen#gmail.com © 普鲁文。RSS