import{RULE_NAME_ALL as e}from"./constants.mjs";import t from"./utils/optionsMatches.mjs";import s from"./utils/reportCommentProblem.mjs";import o from"./validateDisableSettings.mjs";function n(n){const[r,i]=o(n,"reportUnscopedDisables");if(!i)return;if(!r&&!i.except.length)return;const f=n.stylelint,c=f.disabledRanges[e];if(!c)return;const l=e=>{s({rule:"--report-unscoped-disables",message:"Configuration comment must be scoped",severity:i.severity,node:e,postcssResult:n})};if(i.except.length&&!r){const e=f.config?.rules;if(!e)return;const s=f.disabledWarnings;if(!s)return;const o=new Set;for(const{line:e,rule:n}of s){if(t(i,"except",n))for(const{start:t,end:s,node:n}of c)o.has(n)||t<=e&&(void 0===s||s>=e)&&(l(n),o.add(n))}}else if(r)for(const{node:e}of c)l(e)}export{n as default};