codeclimate / codeclimate-eslint

Code Climate Engine for ESLint
MIT License
95 stars 93 forks source link

Unexpected syntax error #340

Closed abbyarmada closed 5 years ago

abbyarmada commented 6 years ago

User is experiencing this error with eslint after switching repo to new features.


throw e; 
^

SyntaxError: Cannot read config file: /code/package.json 
Error: Cannot read config file: /code/package.json 
Error: Unexpected string in JSON at position 243 
at Object.parse (native) 
at loadJSONConfigFile (/usr/local/node_modules/eslint/lib/config/config-file.js:120:21) 
at loadPackageJSONConfigFile (/usr/local/node_modules/eslint/lib/config/config-file.js:178:16) 
at loadConfigFile (/usr/local/node_modules/eslint/lib/config/config-file.js:226:26) 
at Object.load (/usr/local/node_modules/eslint/lib/config/config-file.js:535:18) 
at loadConfig (/usr/local/node_modules/eslint/lib/config.js:63:33) 
at getLocalConfig (/usr/local/node_modules/eslint/lib/config.js:130:29) 
at Config.getConfig (/usr/local/node_modules/eslint/lib/config.js:260:26) 
at Config.getConfig (/usr/src/app/lib/eslint-patch.js:45:46) 
at CLIEngine.getConfigForFile (/usr/local/node_modules/eslint/lib/cli-engine.js:776:29)```

They do not have their own eslint config. Ping me directly if you need more info (repo, etc) 
toddmazierski commented 6 years ago

Thanks for the report!

Although there might be a more graceful way of handling this in the future, please try these steps to get ESLint back up and running for this repository:

  1. Commit an ESLint configuration to the repository (please see here for Code Climate's default one)
  2. The stacktrace suggests that package.json in the repository is not valid JSON—please confirm and fix any issues discovered