亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

create-react-app創建的項目的eslint配置問題

create-react-app創建的項目的eslint配置問題

HUX布斯 2019-02-12 13:12:06
創建項目后,執行了npm run eject顯示隱藏文件,安裝了eslint-config-airbnb-base,然后創建了三個文件.editorconfig、.eslintignore、.eslintrc.js,結果atom報錯,開啟開發工具看,報錯是D:\UPUPW\htdocs\LotteryAPP_MS\01Code\partner_react\node_modules\eslint-config-airbnb-base\rules\style.js:    Configuration for rule "indent" is invalid:    Value "[object Object]" should NOT have additional properties.幾個文件內容如下.editorconfigroot = true[*]charset = utf-8indent_style = spaceindent_size = 2end_of_line = lfinsert_final_newline = truetrim_trailing_whitespace = true.eslintignorepublic/*.jsconfig/*.jsscripts/*.js.eslintrc.js
查看完整描述

1 回答

?
料青山看我應如是

TA貢獻1772條經驗 獲得超8個贊

似乎是eslint版本問題,我重新create-react-app,創建的項目eslint及其相關包的版本都是不同的,此時再用eslint-config-airbnb-base就正常了

之前的eslint相關包的版本


    "eslint": "4.4.1",

    "eslint-config-airbnb-base": "^12.1.0",

    "eslint-config-react-app": "^2.0.1",

    "eslint-loader": "1.9.0",

    "eslint-plugin-flowtype": "2.35.0",

    "eslint-plugin-import": "2.7.0",

    "eslint-plugin-jsx-a11y": "5.1.1",

    "eslint-plugin-react": "7.1.0",

重新生成的項目中eslint相關包的版本


    "eslint": "4.10.0",

    "eslint-config-airbnb-base": "^12.1.0",

    "eslint-config-react-app": "^2.0.1",

    "eslint-loader": "1.9.0",

    "eslint-plugin-flowtype": "2.39.1",

    "eslint-plugin-import": "2.8.0",

    "eslint-plugin-jsx-a11y": "5.1.1",

    "eslint-plugin-react": "7.4.0",


查看完整回答
反對 回復 2019-02-19
  • 1 回答
  • 0 關注
  • 2969 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號