protofire/atom-solidity-linter

Better error report when .solhint.json contains an error

Closed this issue · 1 comments

I realized this is caused by an error (a comma before closing } ) from the .solhint.json file I'm editing. However it's best to catch the error and provide a more meaningful message to user.

[Enter steps to reproduce:]

  1. ...
  2. ...

Atom: 1.23.3 x64
Electron: 1.6.15
OS: Ubuntu 17.10
Thrown From: atom-solidity-linter package 0.0.9

Stack Trace

Uncaught SyntaxError: Unexpected token } in JSON at position 169

At file:///usr/share/atom/resources/app.asar/static/index.html:8

SyntaxError: Unexpected token } in JSON at position 169
    at JSON.parse (<anonymous>)
    at /packages/atom-solidity-linter/lib/helpers.js:28:71
    at tryToString (fs.js:426:3)
    at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:413:12)

Commands

     -1:05.4.0 core:move-left (input.hidden-input)
  5x -1:05.1.0 core:select-left (input.hidden-input)
     -1:01.6.0 core:move-down (input.hidden-input)
  2x -1:00.8.0 editor:move-to-first-character-of-line (input.hidden-input)
     -0:59.1.0 editor:move-to-end-of-screen-line (input.hidden-input)
     -0:58.5.0 core:move-up (input.hidden-input)
  6x -0:57.9.0 core:move-right (input.hidden-input)
     -0:53.9.0 core:move-down (input.hidden-input)
  2x -0:52.9.0 editor:move-to-first-character-of-line (input.hidden-input)
  2x -0:51.7.0 core:select-down (input.hidden-input)
     -0:45.9.0 core:delete (input.hidden-input)
  2x -0:43.5.0 core:move-down (input.hidden-input)
     -0:39.9.0 core:select-down (input.hidden-input)
     -0:37 core:delete (input.hidden-input)
     -0:35.9.0 intentions:highlight (input.hidden-input)
     -0:35.6.0 core:save (input.hidden-input)

Non-Core Packages

atom-solidity-linter 0.0.9 
autocomplete-solidity 0.3.4 
busy-signal 1.4.3 
etheratom 3.2.0 
intentions 1.1.5 
language-ethereum 0.3.9 
linter 2.0.0 
linter-solidity 0.5.0 
linter-ui-default 1.6.10 
open-terminal-here 2.3.1 

Hi @bingtimren ,

Thank you for the feedback!

The fix is released. You can update the package now.

Best Regards,
- Ilya