{"action":"created","issue":{"url":"https://api.github.com/repos/stylelint/stylelint/issues/1612","repository_url":"https://api.github.com/repos/stylelint/stylelint","labels_url":"https://api.github.com/repos/stylelint/stylelint/issues/1612/labels{/name}","comments_url":"https://api.github.com/repos/stylelint/stylelint/issues/1612/comments","events_url":"https://api.github.com/repos/stylelint/stylelint/issues/1612/events","html_url":"https://github.com/stylelint/stylelint/issues/1612","id":164532740,"number":1612,"title":"Prevent `at-rule-no-unknown` from warning against Sass directives","user":{"login":"VincentSmedinga","id":281751,"avatar_url":"https://avatars.githubusercontent.com/u/281751?v=3","gravatar_id":"","url":"https://api.github.com/users/VincentSmedinga","html_url":"https://github.com/VincentSmedinga","followers_url":"https://api.github.com/users/VincentSmedinga/followers","following_url":"https://api.github.com/users/VincentSmedinga/following{/other_user}","gists_url":"https://api.github.com/users/VincentSmedinga/gists{/gist_id}","starred_url":"https://api.github.com/users/VincentSmedinga/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/VincentSmedinga/subscriptions","organizations_url":"https://api.github.com/users/VincentSmedinga/orgs","repos_url":"https://api.github.com/users/VincentSmedinga/repos","events_url":"https://api.github.com/users/VincentSmedinga/events{/privacy}","received_events_url":"https://api.github.com/users/VincentSmedinga/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/stylelint/stylelint/labels/status:%20help%20wanted","name":"status: help wanted","color":"fbca04"},{"url":"https://api.github.com/repos/stylelint/stylelint/labels/type:%20documentation","name":"type: documentation","color":"c7def8"}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-07-08T13:37:36Z","updated_at":"2016-08-22T19:40:48Z","closed_at":"2016-07-08T14:50:34Z","body":"> Describe the issue. Is it a bug or a feature request (new rule, new option, etc.)?\r\n\r\nA feature request to not warn against Sass directives like `@import`, `@function`, and `@if` when using Sass or SCSS syntax.\r\n\r\n> Which rule, if any, is this issue related to?\r\n\r\n`at-rule-no-unknown`\r\n\r\n > What CSS is needed to reproduce this issue?\r\n\r\n e.g.\r\n\r\n```scss\r\n@function foo ($bar) {\r\n  @if ($bar == 'a') {\r\n    $baz: 'b';\r\n  }\r\n  @else if ($bar == 'b') {\r\n    $baz: 'a';\r\n  }\r\n  @return $baz;\r\n}\r\n```\r\n\r\n> What stylelint configuration is needed to reproduce this issue?\r\n\r\ne.g.\r\n\r\n```json\r\n{\r\n  \"rules\": {\r\n    \"at-rule-no-unknown\": true,\r\n  }\r\n}\r\n```\r\n\r\n> Which version of stylelint are you using?\r\n\r\n`6.9.0`.\r\n\r\n> How are you running stylelint: CLI, PostCSS plugin, Node API?\r\n\r\nCLI with `stylelint foo.scss --config .stylelintrc --syntax scss`.\r\n\r\n> Does your issue relate to non-standard syntax (e.g. SCSS, nesting, etc.)?\r\n\r\nYes, it’s related to SCSS directives.\r\n\r\n> What did you expect to happen?\r\n\r\nNo warnings to be flagged.\r\n\r\n> What actually happened (e.g. what warnings or errors you are getting)?\r\n\r\nThe following warnings were flagged:\r\n\r\n```shell\r\nfoo.scss\r\n1:1  ✖  Unexpected unknown at-rule \"@function\"   at-rule-no-unknown\r\n2:3  ✖  Unexpected unknown at-rule \"@if\"         at-rule-no-unknown\r\n5:3  ✖  Unexpected unknown at-rule \"@else\"       at-rule-no-unknown\r\n8:3  ✖  Unexpected unknown at-rule \"@return\"     at-rule-no-unknown\r\n```\r\n\r\nGoing over the [Sass documentation](http://sass-lang.com/documentation/file.SASS_REFERENCE.html#control_directives__expressions) results in the following list of keywords to additionally accept as known at-rules: `@each`, `@else`, `@extend`, `@for`, `@function`, `@if`, `@include`, `@mixin`, `@return`, `@while`.\r\n\r\nThe simplest solution would be to add these to the `atRules` set in `src/reference/keywordSets.js`, but that would incorrectly accept them in plain CSS. Creating a separate set for Sass directives will prevent that, but I can’t assess whether it’s easy to only consider that set in particular syntaxes.\r\n\r\nIt would be great if stylelint automatically applied this extra set when in Scss or Sass syntax."},"comment":{"url":"https://api.github.com/repos/stylelint/stylelint/issues/comments/241525990","html_url":"https://github.com/stylelint/stylelint/issues/1612#issuecomment-241525990","issue_url":"https://api.github.com/repos/stylelint/stylelint/issues/1612","id":241525990,"user":{"login":"VincentSmedinga","id":281751,"avatar_url":"https://avatars.githubusercontent.com/u/281751?v=3","gravatar_id":"","url":"https://api.github.com/users/VincentSmedinga","html_url":"https://github.com/VincentSmedinga","followers_url":"https://api.github.com/users/VincentSmedinga/followers","following_url":"https://api.github.com/users/VincentSmedinga/following{/other_user}","gists_url":"https://api.github.com/users/VincentSmedinga/gists{/gist_id}","starred_url":"https://api.github.com/users/VincentSmedinga/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/VincentSmedinga/subscriptions","organizations_url":"https://api.github.com/users/VincentSmedinga/orgs","repos_url":"https://api.github.com/users/VincentSmedinga/repos","events_url":"https://api.github.com/users/VincentSmedinga/events{/privacy}","received_events_url":"https://api.github.com/users/VincentSmedinga/received_events","type":"User","site_admin":false},"created_at":"2016-08-22T19:40:48Z","updated_at":"2016-08-22T19:40:48Z","body":"@jeddy3 I hadn’t noticed your further reply until now, thanks for clarifying."}}
{"actor":{"display_login":"VincentSmedinga"}}