{"action":"created","issue":{"url":"https://api.github.com/repos/lesshint/lesshint/issues/138","repository_url":"https://api.github.com/repos/lesshint/lesshint","labels_url":"https://api.github.com/repos/lesshint/lesshint/issues/138/labels{/name}","comments_url":"https://api.github.com/repos/lesshint/lesshint/issues/138/comments","events_url":"https://api.github.com/repos/lesshint/lesshint/issues/138/events","html_url":"https://github.com/lesshint/lesshint/pull/138","id":135077129,"number":138,"title":"Add support for inline disabling/enabling of rules","user":{"login":"jwilsson","id":567607,"avatar_url":"https://avatars.githubusercontent.com/u/567607?v=3","gravatar_id":"","url":"https://api.github.com/users/jwilsson","html_url":"https://github.com/jwilsson","followers_url":"https://api.github.com/users/jwilsson/followers","following_url":"https://api.github.com/users/jwilsson/following{/other_user}","gists_url":"https://api.github.com/users/jwilsson/gists{/gist_id}","starred_url":"https://api.github.com/users/jwilsson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jwilsson/subscriptions","organizations_url":"https://api.github.com/users/jwilsson/orgs","repos_url":"https://api.github.com/users/jwilsson/repos","events_url":"https://api.github.com/users/jwilsson/events{/privacy}","received_events_url":"https://api.github.com/users/jwilsson/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2016-02-20T13:59:13Z","updated_at":"2016-02-23T02:03:10Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/lesshint/lesshint/pulls/138","html_url":"https://github.com/lesshint/lesshint/pull/138","diff_url":"https://github.com/lesshint/lesshint/pull/138.diff","patch_url":"https://github.com/lesshint/lesshint/pull/138.patch"},"body":"Here it is, the big one. The million dollar feature. Inline configuration!\r\n\r\nThis PR gives us the possibility to do these kind of things:\r\n```less\r\n// lesshint spaceBeforeBrace: false, emptyRule: false\r\n.foo{ // Won't be reported\r\n    color: red;\r\n}\r\n\r\n.bar {\r\n\r\n} // Won't report this empty rule\r\n\r\n// lesshint emptyRule: true\r\n.baz{\r\n\r\n} // But this will be reported, but the missing space before { won't\r\n\r\n.foobar { // The next line won't be reported\r\n    color:blue; // lesshint-line spaceAfterPropertyColon: false\r\n}\r\n```\r\n\r\nAs shown, all rules that aren't scoped to a single line are disabled until they're reenabled. At this time, rules that are disabled in `.lesshintrc` will stay disabled and I think that makes most sense.\r\n\r\nI tried to make it as liberal as possible with regards to spaces. The only space that's required is the one after `lesshint` and `lesshint-line` (to prevent collisions) but other than that you're free to put spaces (or not) wherever you want, before `lesshint`, before `:` and so on.\r\n\r\nI left the names open to give us the ability to add more configuration options to each rule in the future, for example changing `style` options inline (anything that's valid JSON is what I'm thinking really). This is the same way as ESLint does it.\r\n\r\nBut if anyone's got any better name suggestions, please share them!\r\n\r\nRef: #55"},"comment":{"url":"https://api.github.com/repos/lesshint/lesshint/issues/comments/187480091","html_url":"https://github.com/lesshint/lesshint/pull/138#issuecomment-187480091","issue_url":"https://api.github.com/repos/lesshint/lesshint/issues/138","id":187480091,"user":{"login":"shellscape","id":76371,"avatar_url":"https://avatars.githubusercontent.com/u/76371?v=3","gravatar_id":"","url":"https://api.github.com/users/shellscape","html_url":"https://github.com/shellscape","followers_url":"https://api.github.com/users/shellscape/followers","following_url":"https://api.github.com/users/shellscape/following{/other_user}","gists_url":"https://api.github.com/users/shellscape/gists{/gist_id}","starred_url":"https://api.github.com/users/shellscape/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shellscape/subscriptions","organizations_url":"https://api.github.com/users/shellscape/orgs","repos_url":"https://api.github.com/users/shellscape/repos","events_url":"https://api.github.com/users/shellscape/events{/privacy}","received_events_url":"https://api.github.com/users/shellscape/received_events","type":"User","site_admin":false},"created_at":"2016-02-23T02:03:10Z","updated_at":"2016-02-23T02:03:10Z","body":"the more I look at that setup, the more it rubs on me. I'm a big big fan of the way that jshint/eslint does it. the inline config should really only affect the line after it. jshint allows you to disable the linters altogether for a range, but I'm not a fan of turning off a rule for one line and having to turn it back on on the line after. that creates a lot of unneeded cruft for what I imagine will be sparing use. \r\n\r\nsorry, not trying to be difficult on this one, but definitely have preferences."}}