{"action":"created","issue":{"url":"https://api.github.com/repos/stylelint/stylelint/issues/3171","repository_url":"https://api.github.com/repos/stylelint/stylelint","labels_url":"https://api.github.com/repos/stylelint/stylelint/issues/3171/labels{/name}","comments_url":"https://api.github.com/repos/stylelint/stylelint/issues/3171/comments","events_url":"https://api.github.com/repos/stylelint/stylelint/issues/3171/events","html_url":"https://github.com/stylelint/stylelint/issues/3171","id":298039817,"number":3171,"title":"Change defaultSeverity to be relative only to the current file","user":{"login":"ryansully","id":51629,"avatar_url":"https://avatars3.githubusercontent.com/u/51629?v=4","gravatar_id":"","url":"https://api.github.com/users/ryansully","html_url":"https://github.com/ryansully","followers_url":"https://api.github.com/users/ryansully/followers","following_url":"https://api.github.com/users/ryansully/following{/other_user}","gists_url":"https://api.github.com/users/ryansully/gists{/gist_id}","starred_url":"https://api.github.com/users/ryansully/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ryansully/subscriptions","organizations_url":"https://api.github.com/users/ryansully/orgs","repos_url":"https://api.github.com/users/ryansully/repos","events_url":"https://api.github.com/users/ryansully/events{/privacy}","received_events_url":"https://api.github.com/users/ryansully/received_events","type":"User","site_admin":false},"labels":[{"id":210042527,"url":"https://api.github.com/repos/stylelint/stylelint/labels/status:%20discussion","name":"status: discussion","color":"0023ee","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2018-02-17T21:56:07Z","updated_at":"2018-02-27T07:35:41Z","closed_at":null,"author_association":"NONE","body":"To explain my situation, I'm creating a custom config package that will have a mixture of \"error\"-level and \"warning\"-level rules.\r\n\r\nTo facilitate better organization, I was planning on placing all the \"error\"-level rules in a base config (base.js) which extends stylelint-config-standard, and \"warning\"-level rules in a separate file (warning.js) which would have `defaultSeverity: 'warning'`. Then both of those files would be defined in the `extends` property in index.js like so:\r\n```json\r\n\"extends\": [\"./base\", \"./warning\"]\r\n```\r\nThat way the \"warning\"-level rules would override the ones in base/standard.\r\n\r\nHowever, when I run the linter, all of the rules defined in base.js that should have \"error\" severity have been changed to \"warning\" instead.\r\n\r\nCan I set `defaultSeverity` in a way that it only applies to rules in the file where it was defined? I want to preserve the \"error\"-level severity for my base rules, while avoiding having to set `\"severity\": \"warning\"` for every rule individually."},"comment":{"url":"https://api.github.com/repos/stylelint/stylelint/issues/comments/368773926","html_url":"https://github.com/stylelint/stylelint/issues/3171#issuecomment-368773926","issue_url":"https://api.github.com/repos/stylelint/stylelint/issues/3171","id":368773926,"user":{"login":"hudochenkov","id":654597,"avatar_url":"https://avatars2.githubusercontent.com/u/654597?v=4","gravatar_id":"","url":"https://api.github.com/users/hudochenkov","html_url":"https://github.com/hudochenkov","followers_url":"https://api.github.com/users/hudochenkov/followers","following_url":"https://api.github.com/users/hudochenkov/following{/other_user}","gists_url":"https://api.github.com/users/hudochenkov/gists{/gist_id}","starred_url":"https://api.github.com/users/hudochenkov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hudochenkov/subscriptions","organizations_url":"https://api.github.com/users/hudochenkov/orgs","repos_url":"https://api.github.com/users/hudochenkov/repos","events_url":"https://api.github.com/users/hudochenkov/events{/privacy}","received_events_url":"https://api.github.com/users/hudochenkov/received_events","type":"User","site_admin":false},"created_at":"2018-02-27T07:35:41Z","updated_at":"2018-02-27T07:35:41Z","author_association":"OWNER","body":"I do understand. Behavior you suggest will work for your case, but it will make impossible to change severity of base.js if there a need. Example:\r\n\r\nA team starts using stylelint and they extend some big third-party config which has `defaultSeverity` set to `error`. They have thousands of errors, but don't have time to fix them right now. So team decides to set severity to “warning” in their-config.js. But it doesn't work, because with new behavior it's impossible to override `defaultSeverity`.\r\n\r\nSecond situation, when base config doesn't have `defaultSeverity` specified. What it should be then? If second-config.js (which extends base config) we set `defaultSeverity`, but it doesn't affect severity in the base config, because new behavior has file scope."}}
{"actor":{"display_login":"hudochenkov"}}