{"action":"created","issue":{"url":"https://api.github.com/repos/brigade/scss-lint/issues/400","labels_url":"https://api.github.com/repos/brigade/scss-lint/issues/400/labels{/name}","comments_url":"https://api.github.com/repos/brigade/scss-lint/issues/400/comments","events_url":"https://api.github.com/repos/brigade/scss-lint/issues/400/events","html_url":"https://github.com/brigade/scss-lint/issues/400","id":63260733,"number":400,"title":"Proposed linter: space around operators","user":{"login":"lencioni","id":195534,"avatar_url":"https://avatars.githubusercontent.com/u/195534?v=3","gravatar_id":"","url":"https://api.github.com/users/lencioni","html_url":"https://github.com/lencioni","followers_url":"https://api.github.com/users/lencioni/followers","following_url":"https://api.github.com/users/lencioni/following{/other_user}","gists_url":"https://api.github.com/users/lencioni/gists{/gist_id}","starred_url":"https://api.github.com/users/lencioni/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lencioni/subscriptions","organizations_url":"https://api.github.com/users/lencioni/orgs","repos_url":"https://api.github.com/users/lencioni/repos","events_url":"https://api.github.com/users/lencioni/events{/privacy}","received_events_url":"https://api.github.com/users/lencioni/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/brigade/scss-lint/labels/enhancement","name":"enhancement","color":"bfe5bf"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-03-20T16:38:02Z","updated_at":"2015-06-29T17:24:56Z","closed_at":null,"body":"It would be nice to have a linter that ensures there are spaces around operators. This could work similarly to ESLint's space-infix-ops rule: http://eslint.org/docs/rules/space-infix-ops.html\r\n\r\nExample bad:\r\n\r\n```scss\r\npadding: $some-padding*2;\r\n```\r\n\r\nExample good:\r\n\r\n```scss\r\npadding: $some-padding * 2;\r\n```"},"comment":{"url":"https://api.github.com/repos/brigade/scss-lint/issues/comments/116768105","html_url":"https://github.com/brigade/scss-lint/issues/400#issuecomment-116768105","issue_url":"https://api.github.com/repos/brigade/scss-lint/issues/400","id":116768105,"user":{"login":"srawlins","id":103167,"avatar_url":"https://avatars.githubusercontent.com/u/103167?v=3","gravatar_id":"","url":"https://api.github.com/users/srawlins","html_url":"https://github.com/srawlins","followers_url":"https://api.github.com/users/srawlins/followers","following_url":"https://api.github.com/users/srawlins/following{/other_user}","gists_url":"https://api.github.com/users/srawlins/gists{/gist_id}","starred_url":"https://api.github.com/users/srawlins/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/srawlins/subscriptions","organizations_url":"https://api.github.com/users/srawlins/orgs","repos_url":"https://api.github.com/users/srawlins/repos","events_url":"https://api.github.com/users/srawlins/events{/privacy}","received_events_url":"https://api.github.com/users/srawlins/received_events","type":"User","site_admin":false},"created_at":"2015-06-29T17:24:56Z","updated_at":"2015-06-29T17:24:56Z","body":"I can take this one. There should be spaces around infix operators in:\r\n\r\n* properties (eg `margin: 1px + 1px`)\r\n* mixin inclusions (eg `@include my-mixin(1px + 1px)`)\r\n* variable declarations (eg `$x = 1px + 1px`)\r\n* control flow expressions (`@if`, `@for`, `@while`, `@each`) (eg `@if $x == 7`)\r\n\r\nThis linter should _not_ lint:\r\n\r\n* non-evaluated operations, like `:nth-child(3n+1)` (selectors like this are the only cases I can think of)\r\n* non-operations, like `font: 10px/8px` (see Sass's [Division and /](http://sass-lang.com/documentation/file.SASS_REFERENCE.html#division-and-slash) section)\r\n* stringed operators, like `font: '1+1'`\r\n\r\nThis linter should also lint interpolated expressions (eg `content: \"I ate #{5 + 10} pies!\"`), but this might be really hard to do. I'll try.\r\n\r\nI think there should be a configuration variable, `spaces`, which dictates the number of preferred spaces on each side of an operator, defaulting to 1. If this is overly complicated, it could instead accept `one_space` or `no_space`.\r\n\r\nDid I miss anything?"}}