{"action":"created","issue":{"url":"https://api.github.com/repos/stylelint/stylelint/issues/1352","repository_url":"https://api.github.com/repos/stylelint/stylelint","labels_url":"https://api.github.com/repos/stylelint/stylelint/issues/1352/labels{/name}","comments_url":"https://api.github.com/repos/stylelint/stylelint/issues/1352/comments","events_url":"https://api.github.com/repos/stylelint/stylelint/issues/1352/events","html_url":"https://github.com/stylelint/stylelint/issues/1352","id":156091576,"number":1352,"title":"Bug: Various valid selector types incorrectly reporting as unknown type selectors","user":{"login":"ntwb","id":1016458,"avatar_url":"https://avatars.githubusercontent.com/u/1016458?v=3","gravatar_id":"","url":"https://api.github.com/users/ntwb","html_url":"https://github.com/ntwb","followers_url":"https://api.github.com/users/ntwb/followers","following_url":"https://api.github.com/users/ntwb/following{/other_user}","gists_url":"https://api.github.com/users/ntwb/gists{/gist_id}","starred_url":"https://api.github.com/users/ntwb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ntwb/subscriptions","organizations_url":"https://api.github.com/users/ntwb/orgs","repos_url":"https://api.github.com/users/ntwb/repos","events_url":"https://api.github.com/users/ntwb/events{/privacy}","received_events_url":"https://api.github.com/users/ntwb/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/stylelint/stylelint/labels/status:%20discussion","name":"status: discussion","color":"0023ee"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-05-21T08:47:08Z","updated_at":"2016-05-21T15:03:13Z","closed_at":null,"body":"> Describe the issue. Is it a bug or a feature request (new rule, new option, etc.)?\r\n\r\nBug: Various valid selector types incorrectly reporting as unknown type selectors:\r\n\r\n• `:lang(x)`\r\n• `:nth-child(x)`, `:nth-last-child(x)`, `:nth-last-of-type(x)`, `:nth-of-type(x)` parenthesis values\r\n• `acronym`, `applet`, `big`, `hgroup`, `strike`, `submit`, `tt`\r\n\r\n> Which rule, if any, is this issue related to?\r\n\r\n `selector-type-no-unknown`\r\n\r\n> What CSS is needed to reproduce this issue?\r\n\r\n#### `:lang`:\r\n```css\r\n:lang(X),\r\n:lang(he-il) { \r\n  color: pink;\r\n}\r\n```\r\n\r\n> Via https://css-tricks.com/almanac/selectors/l/lang/\r\n> > _\"The matching of X against the element's language value is performed case-insensitively for characters within the ASCII range. The identifier X does not have to be a valid language name.\"_\r\n\r\n\r\n#### `nth-*`:\r\n```css\r\n.one li:nth-child(1)\r\n.two :nth-last-child(-n+2) :nth-last-child(1),\r\n.three :nth-of-type(3n+1),\r\n.four:nth-of-type(even) {\r\n  color: pink;\r\n}\r\n```\r\n\r\n#### General: `acronym`, `applet`, `big`, `hgroup`, `strike`, `submit`, `tt`\r\n```css\r\n\r\napplet,\r\nacronym,\r\nbig,\r\nhgroup,\r\nstrike,\r\nsubmit,\r\ntt{\r\n  color: pink;\r\n}\r\n```\r\n> What stylelint configuration is needed to reproduce this issue?\r\n\r\n```json\r\n{\r\n  \"rules\": {\r\n    \"selector-type-no-unknown\": true\r\n  }\r\n}\r\n```\r\n\r\n> Which version of stylelint are you using?\r\n\r\n `6.5.0`\r\n\r\n> How are you running stylelint: CLI, PostCSS plugin, Node API?\r\n\r\nCLI with `stylelint --config .stylelintrc test.css`\r\n\r\n> Does your issue relate to non-standard syntax (e.g. SCSS, nesting, etc.)?\r\n\r\nNo\r\n\r\n> What did you expect to happen?\r\n\r\nNo warnings to be flagged.\r\n\r\n> What actually happened (e.g. what warnings or errors you are getting)?\r\n\r\nUsing the following consolidated CSS:\r\n```css\r\n:lang(x),\r\n:lang(he-il),\r\n.one li:nth-child(1)\r\n.two :nth-last-child(-n+2) :nth-last-child(1),\r\n.three :nth-of-type(3n+1),\r\n.four:nth-of-type(even),\r\napplet,\r\nacronym,\r\nbig,\r\nhgroup,\r\nstrike,\r\nsubmit,\r\ntt{\r\n  color: pink;\r\n}\r\n```\r\n\r\nThe following warnings were flagged:\r\n```shell\r\n11:7 Unexpected unknown type selector \"x\" (selector-type-no-unknown) [stylelint]\r\n12:7 Unexpected unknown type selector \"he-il\" (selector-type-no-unknown) [stylelint]\r\n14:22 Unexpected unknown type selector \"-n\" (selector-type-no-unknown) [stylelint]\r\n14:25 Unexpected unknown type selector \"2\" (selector-type-no-unknown) [stylelint]\r\n14:44 Unexpected unknown type selector \"1\" (selector-type-no-unknown) [stylelint]\r\n15:21 Unexpected unknown type selector \"3n\" (selector-type-no-unknown) [stylelint]\r\n15:24 Unexpected unknown type selector \"1\" (selector-type-no-unknown) [stylelint]\r\n16:19 Unexpected unknown type selector \"even\" (selector-type-no-unknown) [stylelint]\r\n17:1 Unexpected unknown type selector \"applet\" (selector-type-no-unknown) [stylelint]\r\n18:1 Unexpected unknown type selector \"acronym\" (selector-type-no-unknown) [stylelint]\r\n19:1 Unexpected unknown type selector \"big\" (selector-type-no-unknown) [stylelint]\r\n20:1 Unexpected unknown type selector \"hgroup\" (selector-type-no-unknown) [stylelint]\r\n21:1 Unexpected unknown type selector \"strike\" (selector-type-no-unknown) [stylelint]\r\n22:1 Unexpected unknown type selector \"submit\" (selector-type-no-unknown) [stylelint]\r\n23:1 Unexpected unknown type selector \"tt\" (selector-type-no-unknown) [stylelint]\r\n```"},"comment":{"url":"https://api.github.com/repos/stylelint/stylelint/issues/comments/220782490","html_url":"https://github.com/stylelint/stylelint/issues/1352#issuecomment-220782490","issue_url":"https://api.github.com/repos/stylelint/stylelint/issues/1352","id":220782490,"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":"2016-05-21T15:03:12Z","updated_at":"2016-05-21T15:03:12Z","body":"I'd bet this is a straightforward fix. Here are my guesses:\r\n\r\n - With `:lang()` and `:nth-child()` it's probably because postcss-selector-parser treats the inside of the `:nth-child` function as a selector. So we need to always ignore selectors whose parent is `nth-child`.\r\n- With the other keywords they probably just need to be added to a list. @ntwb are those all *obsolete* tags? If so, I wonder if we actually *do* want to warn about them, since they should be removed."}}
{"actor":{"display_login":"davidtheclark"}}