PageSourceSearch

https://stylelint.io/assets/js/494c7979.a1e73d05.js

js stylelint.io collected 2026-10-02 02:27:22 UTC 4,334 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkstylelint_io=self.webpackChunkstylelint_io||[]).push([["9798"],{2315:function(e,s,n){n.r(s),n.d(s,{metadata:function(){return r},default:function(){return u},frontMatter:function(){return o},contentTitle:function(){return i},toc:function(){return a},assets:function(){return c}});var r=JSON.parse('{"id":"user-guide/rules/selector-combinator-allowed-list","title":"selector-combinator-allowed-list","description":"Specify a list of allowed combinators.","source":"@site/docs/user-guide/rules/selector-combinator-allowed-list.md","sourceDirName":"user-guide/rules","slug":"/user-guide/rules/selector-combinator-allowed-list","permalink":"/user-guide/rules/selector-combinator-allowed-list","draft":false,"unlisted":false,"editUrl":"https://github.com/stylelint/stylelint/edit/main/lib/rules/selector-combinator-allowed-list/README.md","tags":[],"version":"current","frontMatter":{"title":"selector-combinator-allowed-list","sidebar_label":"selector-combinator-allowed-list"},"sidebar":"docs","previous":{"title":"selector-class-pattern","permalink":"/user-guide/rules/selector-class-pattern"},"next":{"title":"selector-combinator-disallowed-list","permalink":"/user-guide/rules/selector-combinator-disallowed-list"}}'),l=n(4848),t=n(8453);let o={title:"selector-combinator-allowed-list",sidebar_label:"selector-combinator-allowed-list"},i="selector-combinator-allowed-list",c={},a=[{value:"Options",id:"options",level:2},{value:"<code>Array&lt;string&gt;</code>",id:"arraystring",level:3}];function d(e){let s={a:"a",code:"code",em:"em",h1:"h1",h2:"h2",h3:"h3",header:"header",p:"p",pre:"pre",...(0,t.R)(),...e.components};return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(s.header,{children:(0,l.jsx)(s.h1,{id:"selector-combinator-allowed-list",children:"selector-combinator-allowed-list"})}),"\n",(0,l.jsx)(s.p,{children:"Specify a list of allowed combinators."}),"\n",(0,l.jsx)(s.pre,{children:(0,l.jsx)(s.code,{className:"language-css",children:"  a + b {}\n/** \u2191\n * This combinator */\n"})}),"\n",(0,l.jsx)(s.p,{children:"This rule normalizes the whitespace descendant combinator to be a single space."}),"\n",(0,l.jsxs)(s.p,{children:["This rule ignores ",(0,l.jsx)(s.a,{href:"https://www.w3.org/TR/selectors4/#idref-combinators",children:"reference combinators"})," e.g. ",(0,l.jsx)(s.code,{children:"/for/"}),"."]}),"\n",(0,l.jsxs)(s.p,{children:["This rule supports 1 ",(0,l.jsx)(s.a,{href:"/user-guide/configure#message",children:"message argument"}),": the disallowed combinator."]}),"\n",(0,l.jsx)(s.h2,{id:"options",children:"Options"}),"\n",(0,l.jsx)(s.h3,{id:"arraystring",children:(0,l.jsx)(s.code,{children:"Array<string>"})}),"\n",(0,l.jsx)(s.pre,{children:(0,l.jsx)(s.code,{className:"language-json",children:'["array", "of", "combinators"]\n'})}),"\n",(0,l.jsx)(s.p,{children:"Given:"}),"\n",(0,l.jsx)(s.pre,{children:(0,l.jsx)(s.code,{className:"language-json",children:'{\n  "selector-combinator-allowed-list": [">", " "]\n}\n'})}),"\n",(0,l.jsx)(s.p,{children:"The following patterns are considered problems:"}),"\n",(0,l.jsxs)("div",{class:"invalid-pattern",children:[(0,l.jsx)(s.pre,{children:(0,l.jsx)(s.code,{className:"language-css",children:"a + b {}\n"})}),(0,l.jsx)(s.pre,{children:(0,l.jsx)(s.code,{className:"language-css",children:"a ~ b {}\n"})})]}),"\n",(0,l.jsxs)(s.p,{children:["The following patterns are ",(0,l.jsx)(s.em,{children:"not"})," considered problems:"]}),"\n",(0,l.jsxs)("div",{class:"valid-pattern",children:[(0,l.jsx)(s.pre,{children:(0,l.jsx)(s.code,{className:"language-css",children:"a > b {}\n"})}),(0,l.jsx)(s.pre,{children:(0,l.jsx)(s.code,{className:"language-css",children:"a b {}\n"})}),(0,l.jsx)(s.pre,{children:(0,l.jsx)(s.code,{className:"language-css",children:"a\nb {}\n"})})]})]})}function u(e={}){let{wrapper:s}={...(0,t.R)(),...e.components};return s?(0,l.jsx)(s,{...e,children:(0,l.jsx)(d,{...e})}):d(e)}},8453:function(e,s,n){n.d(s,{R:function(){return o},x:function(){return i}});var r=n(6540);let l={},t=r.createContext(l);function o(e){let s=r.useContext(t);return r.useMemo(function(){return"function"==typeof e?e(s):{...s,...e}},[s,e])}function i(e){let s;return s=e.disableParentContext?"function"==typeof e.components?e.components(l):e.components||l:o(e.components),r.createElement(t.Provider,{value:s},e.children)}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.