{"action":"closed","issue":{"url":"https://api.github.com/repos/davidtheclark/stylelint-statement-max-nesting-depth/issues/4","labels_url":"https://api.github.com/repos/davidtheclark/stylelint-statement-max-nesting-depth/issues/4/labels{/name}","comments_url":"https://api.github.com/repos/davidtheclark/stylelint-statement-max-nesting-depth/issues/4/comments","events_url":"https://api.github.com/repos/davidtheclark/stylelint-statement-max-nesting-depth/issues/4/events","html_url":"https://github.com/davidtheclark/stylelint-statement-max-nesting-depth/issues/4","id":120490522,"number":4,"title":"At-rules within a nested block","user":{"login":"aaronbushnell","id":315202,"avatar_url":"https://avatars.githubusercontent.com/u/315202?v=3","gravatar_id":"","url":"https://api.github.com/users/aaronbushnell","html_url":"https://github.com/aaronbushnell","followers_url":"https://api.github.com/users/aaronbushnell/followers","following_url":"https://api.github.com/users/aaronbushnell/following{/other_user}","gists_url":"https://api.github.com/users/aaronbushnell/gists{/gist_id}","starred_url":"https://api.github.com/users/aaronbushnell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aaronbushnell/subscriptions","organizations_url":"https://api.github.com/users/aaronbushnell/orgs","repos_url":"https://api.github.com/users/aaronbushnell/repos","events_url":"https://api.github.com/users/aaronbushnell/events{/privacy}","received_events_url":"https://api.github.com/users/aaronbushnell/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-12-04T21:33:56Z","updated_at":"2015-12-11T14:59:43Z","closed_at":"2015-12-11T14:59:43Z","body":"We use the BEM naming scheme when creating modules so it's pretty common to see something like this\r\n\r\n```scss\r\n.module {\r\n    padding: 1rem;\r\n\r\n    @media (min-width: 50em) {\r\n        padding: 2rem;\r\n    }\r\n\r\n    &__element {\r\n        font-size: 1.25rem;\r\n\r\n        @media (min-width: 50em) {\r\n            font-size: 2rem;\r\n        }\r\n    }\r\n}\r\n```\r\n\r\nIs there a way to allow at-rules within a nested block, but not _another_ element?\r\n\r\n```scss\r\n.module {\r\n    &__element {\r\n        font-size: 1.25rem;\r\n\r\n        // Allow this\r\n        @media (min-width: 50em) {\r\n            font-size: 2rem;\r\n        }\r\n\r\n        // Disallow this\r\n        &__another-element {\r\n            color: green;\r\n        }\r\n    }\r\n}\r\n```\r\n\r\n**Update**: Here's my current .stylelintrc (adjusted for only the relevant rule)\r\n```json\r\n{\r\n  \"plugins\": {\r\n    \"statement-max-nesting-depth\": \"stylelint-statement-max-nesting-depth\"\r\n  },\r\n  \"rules\": {\r\n    \"statement-max-nesting-depth\": [2, 1, { \"atRulesDontCount\": true }]\r\n  }\r\n}\r\n```"}}