{"action":"created","issue":{"url":"https://api.github.com/repos/stylelint/stylelint/issues/1023","repository_url":"https://api.github.com/repos/stylelint/stylelint","labels_url":"https://api.github.com/repos/stylelint/stylelint/issues/1023/labels{/name}","comments_url":"https://api.github.com/repos/stylelint/stylelint/issues/1023/comments","events_url":"https://api.github.com/repos/stylelint/stylelint/issues/1023/events","html_url":"https://github.com/stylelint/stylelint/pull/1023","id":146321358,"number":1023,"title":"Report CssSyntaxError alongside stylelint warnings","user":{"login":"PhilippBaschke","id":10756783,"avatar_url":"https://avatars.githubusercontent.com/u/10756783?v=3","gravatar_id":"","url":"https://api.github.com/users/PhilippBaschke","html_url":"https://github.com/PhilippBaschke","followers_url":"https://api.github.com/users/PhilippBaschke/followers","following_url":"https://api.github.com/users/PhilippBaschke/following{/other_user}","gists_url":"https://api.github.com/users/PhilippBaschke/gists{/gist_id}","starred_url":"https://api.github.com/users/PhilippBaschke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PhilippBaschke/subscriptions","organizations_url":"https://api.github.com/users/PhilippBaschke/orgs","repos_url":"https://api.github.com/users/PhilippBaschke/repos","events_url":"https://api.github.com/users/PhilippBaschke/events{/privacy}","received_events_url":"https://api.github.com/users/PhilippBaschke/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/stylelint/stylelint/labels/PR:%20review%20accepted","name":"PR: review accepted","color":"47B230"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":17,"created_at":"2016-04-06T13:55:16Z","updated_at":"2016-04-14T02:05:56Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/stylelint/stylelint/pulls/1023","html_url":"https://github.com/stylelint/stylelint/pull/1023","diff_url":"https://github.com/stylelint/stylelint/pull/1023.diff","patch_url":"https://github.com/stylelint/stylelint/pull/1023.patch"},"body":"stylelint would throw the postcss `CssSyntaxError` whenever a given code\r\n(file) contained a syntax error. Since it rather is a problem in the\r\nusers CSS it makes sense to display this error alongside stylelint\r\nwarnings (with line and column information). This should also improve\r\nthird party IDE integrations where code is usually checked while typing,\r\nwhich makes syntax errors more likely.\r\n\r\nThis code just catches a `CssSyntaxError` and translates it into a stylelint warning.\r\nA typical `CssSyntaxError` object would look like this:\r\n\r\n``` JavaScript\r\nCssSyntaxError \r\n{\r\n  name: 'CssSyntaxError',\r\n  reason: 'Reason',\r\n  file: '/path/syntax-error.css', // only defined when called with a file\r\n  source: 'a { color: \\'red; }',\r\n  line: 2,\r\n  column: 12,\r\n  message: '/path/syntax-error.css:2:12: Reason',\r\n  input: { \r\n    line: 2,\r\n    column: 12,\r\n    source: 'a { color: \\'red; }',\r\n    file: '/path/syntax-error.css'\r\n  }\r\n}\r\n```\r\n\r\nLet me know if you have any questions. Should I document this anywhere? If yes, where? :blush: \r\n\r\nFixes #883 "},"comment":{"url":"https://api.github.com/repos/stylelint/stylelint/issues/comments/209722004","html_url":"https://github.com/stylelint/stylelint/pull/1023#issuecomment-209722004","issue_url":"https://api.github.com/repos/stylelint/stylelint/issues/1023","id":209722004,"user":{"login":"davidtheclark","id":628431,"avatar_url":"https://avatars.githubusercontent.com/u/628431?v=3","gravatar_id":"","url":"https://api.github.com/users/davidtheclark","html_url":"https://github.com/davidtheclark","followers_url":"https://api.github.com/users/davidtheclark/followers","following_url":"https://api.github.com/users/davidtheclark/following{/other_user}","gists_url":"https://api.github.com/users/davidtheclark/gists{/gist_id}","starred_url":"https://api.github.com/users/davidtheclark/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidtheclark/subscriptions","organizations_url":"https://api.github.com/users/davidtheclark/orgs","repos_url":"https://api.github.com/users/davidtheclark/repos","events_url":"https://api.github.com/users/davidtheclark/events{/privacy}","received_events_url":"https://api.github.com/users/davidtheclark/received_events","type":"User","site_admin":false},"created_at":"2016-04-14T02:05:56Z","updated_at":"2016-04-14T02:05:56Z","body":"Seems to work great."}}