{"action":"created","issue":{"url":"https://api.github.com/repos/stylelint/stylelint/issues/77","labels_url":"https://api.github.com/repos/stylelint/stylelint/issues/77/labels{/name}","comments_url":"https://api.github.com/repos/stylelint/stylelint/issues/77/comments","events_url":"https://api.github.com/repos/stylelint/stylelint/issues/77/events","html_url":"https://github.com/stylelint/stylelint/issues/77","id":78351352,"number":77,"title":"New rule: indentation","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},"labels":[{"url":"https://api.github.com/repos/stylelint/stylelint/labels/status:%20discussion","name":"status: discussion","color":"0023ee"},{"url":"https://api.github.com/repos/stylelint/stylelint/labels/type:%20enhancement","name":"type: enhancement","color":"488CFF"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-05-20T03:26:28Z","updated_at":"2015-05-20T15:24:50Z","closed_at":null,"body":"@MoOx I think it would help clarify this rule if you could exemplify the complex options you proposed for this rule in #1. I have some guesses as to what is meant based on the discussion but it would be more straightforward with something like example pass/fail cases for each option. Does that make sense?"},"comment":{"url":"https://api.github.com/repos/stylelint/stylelint/issues/comments/103924979","html_url":"https://github.com/stylelint/stylelint/issues/77#issuecomment-103924979","issue_url":"https://api.github.com/repos/stylelint/stylelint/issues/77","id":103924979,"user":{"login":"jeddy3","id":808227,"avatar_url":"https://avatars.githubusercontent.com/u/808227?v=3","gravatar_id":"","url":"https://api.github.com/users/jeddy3","html_url":"https://github.com/jeddy3","followers_url":"https://api.github.com/users/jeddy3/followers","following_url":"https://api.github.com/users/jeddy3/following{/other_user}","gists_url":"https://api.github.com/users/jeddy3/gists{/gist_id}","starred_url":"https://api.github.com/users/jeddy3/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jeddy3/subscriptions","organizations_url":"https://api.github.com/users/jeddy3/orgs","repos_url":"https://api.github.com/users/jeddy3/repos","events_url":"https://api.github.com/users/jeddy3/events{/privacy}","received_events_url":"https://api.github.com/users/jeddy3/received_events","type":"User","site_admin":false},"created_at":"2015-05-20T15:24:50Z","updated_at":"2015-05-20T15:24:50Z","body":"There might be a bigger (and more contentious) question here about what should and shouldn't be in core. And if there is stuff outside of core, how do users plug that stuff in?\r\n\r\nThe indention options are complex because I think it is trying to support an indentation method where rule-sets are indented based on their selector. The example below includes the options for indenting rule-sets with a pseudo class by two tabs, bem elements by one and bem modifiers by none etc ...\r\n\r\n```js\r\n{\r\n  \"indentation\": {\r\n    \"default\": 1,  // e.g. \"1\" tab or \"2\" spaces\r\n    \"char\": \"\\t\", // probably better to have a keyword here e.g. \"tab\"|\"space\"\r\n\r\n    \"block\": true, // indent blocks by the default amount and char.\r\n    \"rule-set-by-selector-class-bem-element\": true, // same with bem elements\r\n    \"rule-set-by-selector-class-bem-modifier\": false, // not with bem modifers\r\n    \"rule-set-by-selector-pseudo-classes\": 2, // indent with 2 of the char e.g. tabs\r\n    \"rule-set-by-selector-pseudo-element\": true // default amount and char\r\n  }\r\n}\r\n```\r\n\r\nTo support a method like:\r\n\r\n```css\r\n.A { } \r\n  .A-element { } \r\n    .A-element:pseudo-class { }\r\n.A--modifier { }\r\n```\r\n\r\nI can see the advantages to such an approach, but should this be in core? Unlike everything else we've done so far it does not feel *timeless* i.e. if BEM is ever replaced by a different methodology this will become redundant. Whereas everything else has been about the CSS language itself, and not an architecture methodology. Does it feel like a good candidate for a plugin or something similar?\r\n\r\nIf the code in core didn't tackle the bem stuff then I think the options could become:\r\n\r\n```js\r\n{\r\n  \"indentation\": {\r\n    \"quantity\": 1,  // e.g. \"2\" tab or \"4\" spaces\r\n    \"char\": \"tab\"|\"space\"\r\n    \"block\": \"always\"|\"never\", // not sure if we need these\r\n    \"value\": \"always\"|\"never\" // too complicated?\r\n  }\r\n}\r\n```\r\n\r\nSo, given:\r\n\r\n```js\r\n{\r\n  \"indentation\": {\r\n    \"quantity\": 2,\r\n    \"char\": \"space\",\r\n    \"block\": \"always\",\r\n    \"value\": \"always\"\r\n  }\r\n}\r\n```\r\n\r\nThis is valid:\r\n\r\n```css\r\na {\r\n  color: pink;\r\n  background-image: url(x.jpg),\r\n    url(y.jpg),\r\n    url(z.jpg);\r\n  height: 0;\r\n```\r\n\r\nThe [scsslint implementation](https://github.com/brigade/scss-lint/blob/master/lib/scss_lint/linter/indentation.rb), [csscomb one](https://github.com/csscomb/csscomb.js/blob/master/lib/options/block-indent.js) and the [one in eslint](https://github.com/eslint/eslint/blob/master/lib/rules/indent.js) for supporting something simpler like this looks pretty complicated to begin with.\r\n\r\nWhat are you two's thoughts on getting something similar to work in core first before expanding out into, perhaps, plugins and the like? "}}