{"action":"created","issue":{"url":"https://api.github.com/repos/stylelint/stylelint/issues/382","labels_url":"https://api.github.com/repos/stylelint/stylelint/issues/382/labels{/name}","comments_url":"https://api.github.com/repos/stylelint/stylelint/issues/382/comments","events_url":"https://api.github.com/repos/stylelint/stylelint/issues/382/events","html_url":"https://github.com/stylelint/stylelint/issues/382","id":106467458,"number":382,"title":"Consider alternative to 0-1-2 severities","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/status:%20help%20wanted","name":"status: help wanted","color":"fbca04"},{"url":"https://api.github.com/repos/stylelint/stylelint/labels/type:%20enhancement","name":"type: enhancement","color":"488CFF"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/stylelint/stylelint/milestones/9","html_url":"https://github.com/stylelint/stylelint/milestones/3.0.0","labels_url":"https://api.github.com/repos/stylelint/stylelint/milestones/9/labels","id":1362409,"number":9,"title":"3.0.0","description":null,"creator":{"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},"open_issues":1,"closed_issues":6,"state":"open","created_at":"2015-10-18T17:33:56Z","updated_at":"2015-11-17T17:48:17Z","due_on":null,"closed_at":null},"comments":14,"created_at":"2015-09-15T03:03:24Z","updated_at":"2015-11-18T01:02:20Z","closed_at":null,"body":"Somebody whose opinion I trust recently pointed out to me how unintuitive the ESLint 0-1-2 pattern is for specifying severity, and how that obscurity can annoy people who need to modify the codebase but are not super familiar with the linter. I've heard it before from others, too (e.g. https://twitter.com/Hagenburger/status/619128858177077249). \r\n\r\nI thought about it a little bit and I have an alternative that we could consider, better than just replacing 0-1-2 with keywords \"ignore\"-\"warn\"-\"error\". Consider:\r\n\r\n- Passing `false` would turn off the rule (same as `0` currently), e.g. `\"block-no-empty\": false`.\r\n- By default, rules would have an \"error\"-level severity. I think this is probably what the majority of users will use for the majority of rules. So just passing a setting means turning on the rule with \"error\"-level severity (and `true` for `-no-*` rules). E.g. `\"block-no-empty\": true, \"declaration-semicolon-space-before\": \"always\"`.\r\n- To downgrade the rule to \"warn\"-level severity, all rules could accept a new property in their secondary options object. Maybe `warnOnly`, or something like that. E.g. `\"block-no-empty\": [true, { warnOnly: true }], \"at-rule-empty-line-before\": [\"always-multi-line\", { ignore: [\"after-comment\"], warnOnly: true }]`.\r\n\r\nIt's not really a big deal, I think, because if the 0-1-2 convention is prominently documented people really have no reason to complain. But I thought I'd throw out this idea, in case anybody liked it."},"comment":{"url":"https://api.github.com/repos/stylelint/stylelint/issues/comments/157563346","html_url":"https://github.com/stylelint/stylelint/issues/382#issuecomment-157563346","issue_url":"https://api.github.com/repos/stylelint/stylelint/issues/382","id":157563346,"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":"2015-11-18T01:02:20Z","updated_at":"2015-11-18T01:02:20Z","body":"@ben-eb: \"Elegant, but confusing\" seems contrary to me :)\r\n\r\n@keithamus: We could handle both numbers and strings if we didn't change rule config format. But what I'm proposing is that we do away with that initial severity marker in favor defaulting to error. (If we *don't* switch formats and default to error, maybe we still should add those string aliases.)\r\n\r\nInstead of `color-hex-case: [2, \"upper\"]` we'd have `color-hex-case: \"upper\"`. And instead of `color-hex-case: [1, \"upper\"]` we'd have `color-hex-case: [\"upper\", { warn: true }]`.\r\n\r\nAs I see it, the advantages of changing are:\r\n- No ambiguous number system. This may be the biggest one. As @jeddy3 said: \"I can also imagine it being much clearer than the 0, 1, 2 approach if a user is unfamiliar with eslint.\" I started this thread because my brother first encountered ESLint and was really put off by the cryptic numbering thing, instead of having a self-explanatory config.\r\n- No need for including a whole lots of `2`s in your configuration.\r\n- Error by default.\r\n\r\nThe only disadvantages I can think of are:\r\n- Defaults to warning instead of forcing user to make a choice (though I'm not convinced by this one, since I'm not super interested in the warning severity).\r\n- ESLint is the big dog and they use numbers.\r\n\r\n "}}