{"action":"created","issue":{"url":"https://api.github.com/repos/roadhump/SublimeLinter-eslint/issues/81","labels_url":"https://api.github.com/repos/roadhump/SublimeLinter-eslint/issues/81/labels{/name}","comments_url":"https://api.github.com/repos/roadhump/SublimeLinter-eslint/issues/81/comments","events_url":"https://api.github.com/repos/roadhump/SublimeLinter-eslint/issues/81/events","html_url":"https://github.com/roadhump/SublimeLinter-eslint/issues/81","id":103401683,"number":81,"title":"eslint blocks legitimate errors in HTML context","user":{"login":"0sinner","id":4854844,"avatar_url":"https://avatars.githubusercontent.com/u/4854844?v=3","gravatar_id":"","url":"https://api.github.com/users/0sinner","html_url":"https://github.com/0sinner","followers_url":"https://api.github.com/users/0sinner/followers","following_url":"https://api.github.com/users/0sinner/following{/other_user}","gists_url":"https://api.github.com/users/0sinner/gists{/gist_id}","starred_url":"https://api.github.com/users/0sinner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/0sinner/subscriptions","organizations_url":"https://api.github.com/users/0sinner/orgs","repos_url":"https://api.github.com/users/0sinner/repos","events_url":"https://api.github.com/users/0sinner/events{/privacy}","received_events_url":"https://api.github.com/users/0sinner/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-08-27T01:28:52Z","updated_at":"2015-08-27T08:51:20Z","closed_at":null,"body":"I have an .php file that is mostly HTML at this point. Inside I have tried `<script></script>` and `<script src=\"...\"></script>`.\r\n\r\nThis resulted in an error along the lines of `Unexpected token '<'` from eslint (verified using sublimelinter debug mode).\r\n\r\nSo then I went into my project's root folder and tried to do `eslint --init`, answered all the questions and ended up with the following as my .eslintrc file.\r\n\r\n```YAML\r\nrules:\r\n  indent:\r\n    - 2\r\n    - tab\r\n  quotes:\r\n    - 2\r\n    - single\r\n  linebreak-style:\r\n    - 2\r\n    - unix\r\n  semi:\r\n    - 2\r\n    - always\r\nenv:\r\n  browser: true\r\nextends: 'eslint:recommended'\r\necmaFeatures:\r\n  jsx: true\r\n  experimentalObjectRestSpread: true\r\nplugins:\r\n  - react\r\n```\r\n\r\nOpening the file again, eslint now gives me: `Error - missing semicolon. (semi)`\r\n\r\nThese errors are false positives, and block me being able to see errors from other linters. I don't plan to have much (if any) inline js code in my html/php files, so a good workaround for me would be to disable eslint in html contexts if that's possible. Of course I'd like it best if the solution made it work for all applicable contexts.\r\n\r\nTo me the error seems to be the selectors (html selector being the only one) set in `linter.py`. The selector (at least as far as I can tell) doesn't strip the `<script></script>` tags and eslint isn't expecting to start in an HTML context.\r\n\r\nPlease let me know if I can be of further assistance in troubleshooting/fixing this. Also it's entirely possible I'm just dumb and am missing some configuration flag.\r\n\r\nEDIT: minor formatting edit and english, and clarity"},"comment":{"url":"https://api.github.com/repos/roadhump/SublimeLinter-eslint/issues/comments/135344171","html_url":"https://github.com/roadhump/SublimeLinter-eslint/issues/81#issuecomment-135344171","issue_url":"https://api.github.com/repos/roadhump/SublimeLinter-eslint/issues/81","id":135344171,"user":{"login":"0sinner","id":4854844,"avatar_url":"https://avatars.githubusercontent.com/u/4854844?v=3","gravatar_id":"","url":"https://api.github.com/users/0sinner","html_url":"https://github.com/0sinner","followers_url":"https://api.github.com/users/0sinner/followers","following_url":"https://api.github.com/users/0sinner/following{/other_user}","gists_url":"https://api.github.com/users/0sinner/gists{/gist_id}","starred_url":"https://api.github.com/users/0sinner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/0sinner/subscriptions","organizations_url":"https://api.github.com/users/0sinner/orgs","repos_url":"https://api.github.com/users/0sinner/repos","events_url":"https://api.github.com/users/0sinner/events{/privacy}","received_events_url":"https://api.github.com/users/0sinner/received_events","type":"User","site_admin":false},"created_at":"2015-08-27T08:51:20Z","updated_at":"2015-08-27T08:51:20Z","body":"Oh wait. Maybe I need to make whatever fix was done to the HTML and HTML (Rails) languages to the PHP language definition?"}}