{"record":{"id":"ce1eb19acef83f09","repo":"denoland/deno","slug":"multiple-selector-arguments-not-supported-here","errorCode":null,"errorMessage":"Multiple selector arguments not supported here","messagePattern":"Multiple selector arguments not supported here","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"cli/js/40_lint_selector.js","lineNumber":729,"sourceCode":"        case \"not\": {\n          lex.next();\n          lex.expect(Token.BraceOpen);\n          lex.next();\n\n          current.push({\n            type: PSEUDO_NOT,\n            selectors: [],\n          });\n          stack.push([]);\n\n          continue;\n        }\n        default:\n          throw new Error(`Unknown pseudo selector: '${lex.value}'`);\n      }\n    } else if (lex.token === Token.Comma) {\n      if (throwOnComma) {\n        throw new Error(`Multiple selector arguments not supported here`);\n      }\n\n      lex.next();\n      if (lex.token === Token.Space) {\n        lex.next();\n      }\n\n      popSelector(result, stack);\n      stack.push([]);\n      continue;\n    } else if (lex.token === Token.BraceClose) {\n      throwOnComma = false;\n      popSelector(result, stack);\n    } else if (lex.token === Token.Op) {\n      current.push({\n        type: RELATION_NODE,\n        op: getAttrOp(lex.value),\n      });","sourceCodeStart":711,"sourceCodeEnd":747,"githubUrl":"https://github.com/denoland/deno/blob/9ad36f7a2cce60488e6ec52283efb32efddaf93a/cli/js/40_lint_selector.js#L711-L747","documentation":"Inside the `of <selector>` clause of :nth-child(), the parser sets throwOnComma = true (cli/js/40_lint_selector.js). A comma encountered while that flag is set throws `Multiple selector arguments not supported here` — the An+B-of form accepts exactly one selector argument, unlike :is()/:has()/:not() which take selector lists. The flag stays set until the next closing parenthesis, so any comma between `of` and the ')' that closes the :nth-child throws.","triggerScenarios":"Visitor keys like \"Var:nth-child(1 of a, b)\" — a comma-separated selector list inside the of-clause. Note the workaround of nesting (:nth-child(1 of :is(a, b))) also throws for the same reason, because the comma arrives while throwOnComma is still true.","commonSituations":"Trying to count only among several sibling types at once, CSS-style; extending an existing of-clause with a second selector during iteration.","solutions":["Keep a single selector in the of-clause: \":nth-child(1 of a)\".","List multiple selector keys — top-level comma lists are allowed because visitor keys are split before parsing: \"Var:nth-child(1 of a), Var:nth-child(1 of b)\".","Alternatively, match the parent/child relationship in the key and verify the sibling index in JavaScript inside the visitor."],"exampleFix":"// before\n\"Var:nth-child(1 of A, B)\"(node) { /* ... */ },\n\n// after\n\"Var:nth-child(1 of A), Var:nth-child(1 of B)\"(node) { /* ... */ },","handlingStrategy":"validation","validationCode":"function checkOfClause(key) {\n  const m = key.match(/:nth-child\\([^)]*\\bof\\b[^)]*,/);\n  if (m) {\n    throw new Error(`Selector list inside 'of' not supported in \"${key}\"; split into multiple keys`);\n  }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep exactly one selector inside an of-clause.","Express alternatives as a top-level comma list in the visitor key — those are split before parsing and are safe.","Do not try to sneak a list in via :is() inside the of-clause; commas there hit the same guard."],"tags":["deno","deno-lint","lint-plugin","selector","nth-child","parse-error"],"backgroundTag":"invalid-selector-syntax","analyzedSha":"9ad36f7a2cce60488e6ec52283efb32efddaf93a","analyzedAt":"2026-08-20T13:07:44.778Z","contentChangedAt":"2026-08-20T13:07:44.778Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}