【问题标题】:How making work eslint-plugin-react-native with Atom?如何使用 Atom 制作 eslint-plugin-react-native?
【发布时间】:2017-01-11 09:18:03
【问题描述】:

我尝试让 linter 在 Atom 上工作,但没有任何反应:/ (我习惯于在 Atom 上使用 eslint,但对于一个新的 React Native 项目,我完全陷入困境......)我为 Atom 使用 linter 和 linter-eslint 包。

感谢您的帮助:)

这是我的 package.json,配置如下: https://github.com/intellicode/eslint-plugin-react-native

{
  "name": "RNApp",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "start": "node node_modules/react-native/local-cli/cli.js start"
  },
  "dependencies": {
    "eslint": "^3.4.0",
    "eslint-plugin-react": "^6.2.0",
    "eslint-plugin-react-native": "^2.0.0",
    "react": "15.3.1",
    "react-native": "0.32.0"
  },
  "plugins": [
    "react",
    "react-native"
  ],
  "ecmaFeatures": {
    "jsx": true
  },
  "rules": {
    "react-native/no-unused-styles": 2,
    "react-native/split-platform-components": 2,
    "react-native/no-inline-styles": 2,
    "react-native/no-color-literals": 2
  }
}

【问题讨论】:

    标签: react-native atom-editor eslint


    【解决方案1】:

    我不得不替换这个:

    "ecmaFeatures": {
      "jsx": true
    },
    

    通过这个:

    "eslintConfig": {
      "parserOptions": {
        "ecmaFeatures": {
          "jsx": true
        }
      }
    },
    

    【讨论】:

      猜你喜欢
      • 2019-12-25
      • 2018-11-27
      • 2016-05-27
      • 1970-01-01
      • 2018-04-21
      • 2017-09-13
      • 2018-12-23
      • 1970-01-01
      • 2020-02-28
      相关资源
      最近更新 更多