{"action":"created","issue":{"url":"https://api.github.com/repos/stylelint/stylelint/issues/442","labels_url":"https://api.github.com/repos/stylelint/stylelint/issues/442/labels{/name}","comments_url":"https://api.github.com/repos/stylelint/stylelint/issues/442/comments","events_url":"https://api.github.com/repos/stylelint/stylelint/issues/442/events","html_url":"https://github.com/stylelint/stylelint/issues/442","id":112474637,"number":442,"title":"Support loading config from package.json","user":{"login":"keithamus","id":118266,"avatar_url":"https://avatars.githubusercontent.com/u/118266?v=3","gravatar_id":"","url":"https://api.github.com/users/keithamus","html_url":"https://github.com/keithamus","followers_url":"https://api.github.com/users/keithamus/followers","following_url":"https://api.github.com/users/keithamus/following{/other_user}","gists_url":"https://api.github.com/users/keithamus/gists{/gist_id}","starred_url":"https://api.github.com/users/keithamus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/keithamus/subscriptions","organizations_url":"https://api.github.com/users/keithamus/orgs","repos_url":"https://api.github.com/users/keithamus/repos","events_url":"https://api.github.com/users/keithamus/events{/privacy}","received_events_url":"https://api.github.com/users/keithamus/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":17,"created_at":"2015-10-20T22:38:53Z","updated_at":"2015-11-06T13:20:19Z","closed_at":null,"body":"Just like eslint does, stylelint should support loading its config from the package.json.\r\n\r\nEslint reads an `eslint` field in the package.json, for example:\r\n\r\n```json\r\n{\r\n  \"name\": \"my-super-awesome-project\",\r\n  \"eslint\": {\r\n    \"extends\": [\"...\"],\r\n    \"rules\": {\r\n      \"...\": \"...\"\r\n    }\r\n  },\r\n  \"dependencies\": {\r\n    \"eslint\": \"^1.7.2\",\r\n  }\r\n}\r\n```\r\n\r\nIt'd be great if I could do exactly the same with stylelint:\r\n\r\n```json\r\n{\r\n  \"name\": \"my-super-awesome-project\",\r\n  \"stylelint\": {\r\n    \"extends\": [\"...\"],\r\n    \"rules\": {\r\n      \"...\": \"...\"\r\n    }\r\n  },\r\n  \"dependencies\": {\r\n    \"stylelint\": \"^2.1.0\",\r\n  }\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/stylelint/stylelint/issues/comments/154407216","html_url":"https://github.com/stylelint/stylelint/issues/442#issuecomment-154407216","issue_url":"https://api.github.com/repos/stylelint/stylelint/issues/442","id":154407216,"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-06T13:20:19Z","updated_at":"2015-11-06T13:20:19Z","body":"@stylelint/owners : Is anybody opposed to writing our own config loader and dropping rc? Here's what I think the requirements would be (integrating with @MoOx said above):\r\n\r\n- Look for `.stylelintrc`, `stylelint.config.js`, and `stylelint` properties in `package.json` files.\r\n- Starting from `process.cwd()`, look for these files in `./ ../ ../../ ../../../` etc., all the way to `~` (user home directory), checking first for `stylelint` in `package.json`, second for `.stylelintrc`, third for `stylelint.config.js`.\r\n- *Stop looking at the first one that is found*, and use that one as the config.\r\n- Build in YAML support for `.stylelintrc`.\r\n\r\nDoes that sound good to everyone? \r\n\r\nAlso @MoOx, if we made that do you think it would suit the other projects you had in mind?"}}