簡體   English   中英

ESLINT:解析錯誤:package.json中的意外標記

[英]ESLINT: Parsing error: Unexpected token in package.json

{
  "name": "react-redux-starter-kit",
  "version": "1.0.0",
  "description": "This would be the starter kit for react projects.",
  "main": "index.html",
  "scripts": {
    "start": "rm -rf build/ && rm -rf dist/ && webpack && webpack-dev-server --progress --colors",
    "build": "rm -rf build/ && rm -rf dist/ && NODE_ENV=production webpack --config ./webpack.production.config.babel.js --progress"
  },
  "repository": {
    "type": "git",
    "url": "git+https://rahulshettyprdxn@bitbucket.org/rahulshettyprdxn/react-devops.git"
  },
  "keywords": [
    "react",
    "webpack",
    "react-native"
  ],
  "author": "Rahul Shetty",
  "license": "MIT",
  "homepage": "https://bitbucket.org/rahulshettyprdxn/react-devops#readme",
  "devDependencies": {
    "babel-core": "^6.5.2",
    "babel-eslint": "^5.0.0",
    "babel-loader": "^6.2.3",
    "babel-plugin-react-transform": "^2.0.0",
    "babel-preset-es2015-without-strict": "0.0.2",
    "babel-preset-react": "^6.5.0",
    "css-loader": "^0.23.1",
    "eslint": "^2.2.0",
    "eslint-plugin-react": "^4.1.0",
    "extract-text-webpack-plugin": "^1.0.1",
    "file-loader": "^0.8.5",
    "html-webpack-plugin": "^2.9.0",
    "image-webpack-loader": "^1.6.3",
    "node-sass": "^3.4.2",
    "react-css-modules": "^3.7.5",
    "react-transform-hmr": "^1.0.2",
    "sass-loader": "^3.1.2",
    "style-loader": "^0.13.0",
    "webpack": "^1.12.14",
    "webpack-dev-server": "^1.14.1"
  },
  "dependencies": {
    "bootstrap": "^3.3.6",
    "react": "^0.14.7",
    "react-bootstrap": "^0.28.3",
    "react-dom": "^0.14.7"
  }
}

以下是我收到的錯誤:
解析錯誤: Atom編輯器中第2行第8行的意外令牌

請注意,我目前在Windows 10上收到此錯誤。

ESLint版本:
“eslint”:“^ 2.2.0”,
“eslint-plugin-react”:“^ 4.1.0”

我在我的Atom編輯器中安裝了linter-eslint ,並且關閉了Global npm ESLint設置

我很困惑,因為錯誤消息不具有描述性。 這絕不會妨礙我的項目,但我很好奇為什么我在編輯器中收到此錯誤。

ESLint用於驗證JavaScript,而不是JSON。

來自網站

ESLint

適用於JavaScriptJSX的可插入linting實用程序

[強調我的]

(你可以在這里試試你的在線演示代碼,你會得到同樣的錯誤)

如果要在JSON文件上使用ESLint,可以使用eslint-plugin-json之類的包。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM