@bluecateng/stylelint-plugin 5.0.0 → 5.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.mjs +1 -1
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{readFileSync as h}from"node:fs";import{createRequire as w}from"node:module";import{parse as
|
|
1
|
+
import{readFileSync as h}from"node:fs";import{createRequire as w}from"node:module";import{parse as $}from"yaml";import O from"stylelint";var{createPlugin:V,utils:{ruleMessages:E,validateOptions:N,report:_}}=O,x=w(import.meta.url),d="@bluecateng/property-strict-value",v=E(d,{expected:e=>`Value for property "${e}" is not valid`}),k=/color|background|border|outline|margin|padding|font|text-transform|grid(-(row|column))?-gap/,S=()=>Object.entries($(h(x.resolve("@bluecateng/pelagos/defs/colors.yaml"),"utf8"))).flatMap(([e,{value:r,palette:o,normal:n,hover:i,css:t}])=>{let s=[];if(r&&s.push(`@${e}`),Array.isArray(o)){let c=o.length;for(let l=0;l<c;++l)s.push(`@${e}${10+l*10}`)}if(n){let c=t||e,l=n.length;for(let a=0;a<l;++a)s.push(`@${c}-${10+a*10}`)}if(i){let c=t||e,l=i.length;for(let a=0;a<l;++a)s.push(`@${c}-${10+a*10}-hover`)}return s}),q=e=>{if(/^var\(/.test(e))return!0;let r=/^fade\(([^,]+), \d+%\)$/.exec(e);return r&&u(r[1])},y=(e,r)=>o=>e.includes(o)||r&&r(o),u=y(S().concat("transparent","currentcolor","currentColor","inherit"),q),f=y(Object.keys($(h(x.resolve("@bluecateng/pelagos/defs/spacing.yaml"),"utf8"))).map(e=>`@${e}`).concat("auto","0"),e=>/^(-(\d+(px|em|vw|vh|%)|@.+)|\d+(vw|vh))$/.test(e)),B=e=>/^0|(\d+(px|em))|none|hidden|dotted|dashed|solid|double$/.test(e)||u(e),b=(e,r)=>{let o=e.length,n=0;for(let i=0;i<o;++i)e[i]===r&&++n;return n},C=e=>{let r,o=/[^\s,]+/g;for(;(r=o.exec(e))!==null;){let n=r[0];for(;b(n,"(")!==b(n,")")&&(r=o.exec(e))!==null;)n+=" "+r[0];if(!/^(\/|none|left|center|right|top|bottom|auto|cover|contain|repeat-x|repeat-y|repeat|space|round|no-repeat|scroll|fixed|local|border-box|padding-box|content-box|url\(.*|image\(.*|image-set\(.*|element\(.*|cross-fade\(.*|(\d+(px|em|%)))$/.test(n)&&!u(n))return!1}return!0},m=e=>(r,o)=>{!N(o,d,{actual:e})||!e||r.walkDecls(k,i=>{let{prop:t,value:s}=i;/^--/.test(t)||/^(background-|(border-(left|right|top|bottom)-)|outline-|scrollbar-[a-z]+-)?color$/.test(t)&&u(s)||/(border|scrollbar)-color/.test(t)&&s.split(" ").every(u)||/^(border(-left|-right|-top|-bottom)?)|outline$/.test(t)&&s.split(" ").every(B)||/^border(-left|-right|-top|-bottom)?-(image|style|width|radius|collapse)|outline-(offset|style|width)|background-(attachment|clip|image|origin|position|repeat|size)/.test(t)||t==="background"&&C(s)||/^(margin|padding)-(left|right|top|bottom)$/.test(t)&&f(s)||/^grid-(row|column)-gap$/.test(t)&&f(s)||/^(margin|padding|grid-gap)$/.test(t)&&s.split(" ").every(f)||s==="inherit"||t==="font-size"||_({message:v.expected(t),node:i,ruleName:d,result:o})})};m.ruleName=d;m.messages=v;var z=V(d,m);import M from"stylelint";import D from"stylelint/lib/utils/isStandardSyntaxRule.mjs";var{createPlugin:F,utils:{ruleMessages:R,validateOptions:j,report:P}}=M,p="@bluecateng/selector-bem",A=R(p,{expected:e=>`Expected selector "${e}" to follow BEM notation`}),g=e=>(r,o)=>{!j(o,p,{actual:e})||!e||r.walkRules(i=>{D(i)&&i.selector.split(/[ ,>]/).forEach(t=>{t&&t.charAt(0)==="."&&!/^.[A-Z][A-Za-z\d]+(:|\[|$)/.test(t)&&!/^.[A-Z][A-Za-z\d]+__[a-z][A-Za-z\d]+(:|\[|$)/.test(t)&&!/^.[A-Z][A-Za-z\d]+--[a-z][A-Za-z\d]+(:|\[|$)/.test(t)&&!/^.[A-Z][A-Za-z\d]+__[a-z][A-Za-z\d]+--[a-z][A-Za-z\d]+(:|\[|$)/.test(t)&&P({message:A.expected(t),node:i,ruleName:p,result:o})})})};g.ruleName=p;g.messages=A;var Z=F(p,g);var X=[z,Z];export{X as default};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bluecateng/stylelint-plugin",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.2",
|
|
4
4
|
"description": "Custom Stylelint rule definitions for BlueCat Engineering",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"type": "module",
|
|
@@ -28,5 +28,5 @@
|
|
|
28
28
|
"strict": "off"
|
|
29
29
|
}
|
|
30
30
|
},
|
|
31
|
-
"gitHead": "
|
|
31
|
+
"gitHead": "b1d75236cfebf072218af7dad8b0cd99f13e3682"
|
|
32
32
|
}
|