@pandacss/eslint-plugin 0.2.8 → 0.2.10
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.js +502 -330
- package/dist/index.mjs +524 -342
- package/dist/utils/worker.js +137 -4
- package/dist/utils/worker.mjs +141 -4
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -599,176 +599,176 @@ var require_ast_spec = __commonJS({
|
|
|
599
599
|
init_cjs_shims();
|
|
600
600
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
601
601
|
exports2.AST_TOKEN_TYPES = exports2.AST_NODE_TYPES = void 0;
|
|
602
|
-
var
|
|
603
|
-
(function(
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
})(
|
|
602
|
+
var AST_NODE_TYPES4;
|
|
603
|
+
(function(AST_NODE_TYPES5) {
|
|
604
|
+
AST_NODE_TYPES5["AccessorProperty"] = "AccessorProperty";
|
|
605
|
+
AST_NODE_TYPES5["ArrayExpression"] = "ArrayExpression";
|
|
606
|
+
AST_NODE_TYPES5["ArrayPattern"] = "ArrayPattern";
|
|
607
|
+
AST_NODE_TYPES5["ArrowFunctionExpression"] = "ArrowFunctionExpression";
|
|
608
|
+
AST_NODE_TYPES5["AssignmentExpression"] = "AssignmentExpression";
|
|
609
|
+
AST_NODE_TYPES5["AssignmentPattern"] = "AssignmentPattern";
|
|
610
|
+
AST_NODE_TYPES5["AwaitExpression"] = "AwaitExpression";
|
|
611
|
+
AST_NODE_TYPES5["BinaryExpression"] = "BinaryExpression";
|
|
612
|
+
AST_NODE_TYPES5["BlockStatement"] = "BlockStatement";
|
|
613
|
+
AST_NODE_TYPES5["BreakStatement"] = "BreakStatement";
|
|
614
|
+
AST_NODE_TYPES5["CallExpression"] = "CallExpression";
|
|
615
|
+
AST_NODE_TYPES5["CatchClause"] = "CatchClause";
|
|
616
|
+
AST_NODE_TYPES5["ChainExpression"] = "ChainExpression";
|
|
617
|
+
AST_NODE_TYPES5["ClassBody"] = "ClassBody";
|
|
618
|
+
AST_NODE_TYPES5["ClassDeclaration"] = "ClassDeclaration";
|
|
619
|
+
AST_NODE_TYPES5["ClassExpression"] = "ClassExpression";
|
|
620
|
+
AST_NODE_TYPES5["ConditionalExpression"] = "ConditionalExpression";
|
|
621
|
+
AST_NODE_TYPES5["ContinueStatement"] = "ContinueStatement";
|
|
622
|
+
AST_NODE_TYPES5["DebuggerStatement"] = "DebuggerStatement";
|
|
623
|
+
AST_NODE_TYPES5["Decorator"] = "Decorator";
|
|
624
|
+
AST_NODE_TYPES5["DoWhileStatement"] = "DoWhileStatement";
|
|
625
|
+
AST_NODE_TYPES5["EmptyStatement"] = "EmptyStatement";
|
|
626
|
+
AST_NODE_TYPES5["ExportAllDeclaration"] = "ExportAllDeclaration";
|
|
627
|
+
AST_NODE_TYPES5["ExportDefaultDeclaration"] = "ExportDefaultDeclaration";
|
|
628
|
+
AST_NODE_TYPES5["ExportNamedDeclaration"] = "ExportNamedDeclaration";
|
|
629
|
+
AST_NODE_TYPES5["ExportSpecifier"] = "ExportSpecifier";
|
|
630
|
+
AST_NODE_TYPES5["ExpressionStatement"] = "ExpressionStatement";
|
|
631
|
+
AST_NODE_TYPES5["ForInStatement"] = "ForInStatement";
|
|
632
|
+
AST_NODE_TYPES5["ForOfStatement"] = "ForOfStatement";
|
|
633
|
+
AST_NODE_TYPES5["ForStatement"] = "ForStatement";
|
|
634
|
+
AST_NODE_TYPES5["FunctionDeclaration"] = "FunctionDeclaration";
|
|
635
|
+
AST_NODE_TYPES5["FunctionExpression"] = "FunctionExpression";
|
|
636
|
+
AST_NODE_TYPES5["Identifier"] = "Identifier";
|
|
637
|
+
AST_NODE_TYPES5["IfStatement"] = "IfStatement";
|
|
638
|
+
AST_NODE_TYPES5["ImportAttribute"] = "ImportAttribute";
|
|
639
|
+
AST_NODE_TYPES5["ImportDeclaration"] = "ImportDeclaration";
|
|
640
|
+
AST_NODE_TYPES5["ImportDefaultSpecifier"] = "ImportDefaultSpecifier";
|
|
641
|
+
AST_NODE_TYPES5["ImportExpression"] = "ImportExpression";
|
|
642
|
+
AST_NODE_TYPES5["ImportNamespaceSpecifier"] = "ImportNamespaceSpecifier";
|
|
643
|
+
AST_NODE_TYPES5["ImportSpecifier"] = "ImportSpecifier";
|
|
644
|
+
AST_NODE_TYPES5["JSXAttribute"] = "JSXAttribute";
|
|
645
|
+
AST_NODE_TYPES5["JSXClosingElement"] = "JSXClosingElement";
|
|
646
|
+
AST_NODE_TYPES5["JSXClosingFragment"] = "JSXClosingFragment";
|
|
647
|
+
AST_NODE_TYPES5["JSXElement"] = "JSXElement";
|
|
648
|
+
AST_NODE_TYPES5["JSXEmptyExpression"] = "JSXEmptyExpression";
|
|
649
|
+
AST_NODE_TYPES5["JSXExpressionContainer"] = "JSXExpressionContainer";
|
|
650
|
+
AST_NODE_TYPES5["JSXFragment"] = "JSXFragment";
|
|
651
|
+
AST_NODE_TYPES5["JSXIdentifier"] = "JSXIdentifier";
|
|
652
|
+
AST_NODE_TYPES5["JSXMemberExpression"] = "JSXMemberExpression";
|
|
653
|
+
AST_NODE_TYPES5["JSXNamespacedName"] = "JSXNamespacedName";
|
|
654
|
+
AST_NODE_TYPES5["JSXOpeningElement"] = "JSXOpeningElement";
|
|
655
|
+
AST_NODE_TYPES5["JSXOpeningFragment"] = "JSXOpeningFragment";
|
|
656
|
+
AST_NODE_TYPES5["JSXSpreadAttribute"] = "JSXSpreadAttribute";
|
|
657
|
+
AST_NODE_TYPES5["JSXSpreadChild"] = "JSXSpreadChild";
|
|
658
|
+
AST_NODE_TYPES5["JSXText"] = "JSXText";
|
|
659
|
+
AST_NODE_TYPES5["LabeledStatement"] = "LabeledStatement";
|
|
660
|
+
AST_NODE_TYPES5["Literal"] = "Literal";
|
|
661
|
+
AST_NODE_TYPES5["LogicalExpression"] = "LogicalExpression";
|
|
662
|
+
AST_NODE_TYPES5["MemberExpression"] = "MemberExpression";
|
|
663
|
+
AST_NODE_TYPES5["MetaProperty"] = "MetaProperty";
|
|
664
|
+
AST_NODE_TYPES5["MethodDefinition"] = "MethodDefinition";
|
|
665
|
+
AST_NODE_TYPES5["NewExpression"] = "NewExpression";
|
|
666
|
+
AST_NODE_TYPES5["ObjectExpression"] = "ObjectExpression";
|
|
667
|
+
AST_NODE_TYPES5["ObjectPattern"] = "ObjectPattern";
|
|
668
|
+
AST_NODE_TYPES5["PrivateIdentifier"] = "PrivateIdentifier";
|
|
669
|
+
AST_NODE_TYPES5["Program"] = "Program";
|
|
670
|
+
AST_NODE_TYPES5["Property"] = "Property";
|
|
671
|
+
AST_NODE_TYPES5["PropertyDefinition"] = "PropertyDefinition";
|
|
672
|
+
AST_NODE_TYPES5["RestElement"] = "RestElement";
|
|
673
|
+
AST_NODE_TYPES5["ReturnStatement"] = "ReturnStatement";
|
|
674
|
+
AST_NODE_TYPES5["SequenceExpression"] = "SequenceExpression";
|
|
675
|
+
AST_NODE_TYPES5["SpreadElement"] = "SpreadElement";
|
|
676
|
+
AST_NODE_TYPES5["StaticBlock"] = "StaticBlock";
|
|
677
|
+
AST_NODE_TYPES5["Super"] = "Super";
|
|
678
|
+
AST_NODE_TYPES5["SwitchCase"] = "SwitchCase";
|
|
679
|
+
AST_NODE_TYPES5["SwitchStatement"] = "SwitchStatement";
|
|
680
|
+
AST_NODE_TYPES5["TaggedTemplateExpression"] = "TaggedTemplateExpression";
|
|
681
|
+
AST_NODE_TYPES5["TemplateElement"] = "TemplateElement";
|
|
682
|
+
AST_NODE_TYPES5["TemplateLiteral"] = "TemplateLiteral";
|
|
683
|
+
AST_NODE_TYPES5["ThisExpression"] = "ThisExpression";
|
|
684
|
+
AST_NODE_TYPES5["ThrowStatement"] = "ThrowStatement";
|
|
685
|
+
AST_NODE_TYPES5["TryStatement"] = "TryStatement";
|
|
686
|
+
AST_NODE_TYPES5["UnaryExpression"] = "UnaryExpression";
|
|
687
|
+
AST_NODE_TYPES5["UpdateExpression"] = "UpdateExpression";
|
|
688
|
+
AST_NODE_TYPES5["VariableDeclaration"] = "VariableDeclaration";
|
|
689
|
+
AST_NODE_TYPES5["VariableDeclarator"] = "VariableDeclarator";
|
|
690
|
+
AST_NODE_TYPES5["WhileStatement"] = "WhileStatement";
|
|
691
|
+
AST_NODE_TYPES5["WithStatement"] = "WithStatement";
|
|
692
|
+
AST_NODE_TYPES5["YieldExpression"] = "YieldExpression";
|
|
693
|
+
AST_NODE_TYPES5["TSAbstractAccessorProperty"] = "TSAbstractAccessorProperty";
|
|
694
|
+
AST_NODE_TYPES5["TSAbstractKeyword"] = "TSAbstractKeyword";
|
|
695
|
+
AST_NODE_TYPES5["TSAbstractMethodDefinition"] = "TSAbstractMethodDefinition";
|
|
696
|
+
AST_NODE_TYPES5["TSAbstractPropertyDefinition"] = "TSAbstractPropertyDefinition";
|
|
697
|
+
AST_NODE_TYPES5["TSAnyKeyword"] = "TSAnyKeyword";
|
|
698
|
+
AST_NODE_TYPES5["TSArrayType"] = "TSArrayType";
|
|
699
|
+
AST_NODE_TYPES5["TSAsExpression"] = "TSAsExpression";
|
|
700
|
+
AST_NODE_TYPES5["TSAsyncKeyword"] = "TSAsyncKeyword";
|
|
701
|
+
AST_NODE_TYPES5["TSBigIntKeyword"] = "TSBigIntKeyword";
|
|
702
|
+
AST_NODE_TYPES5["TSBooleanKeyword"] = "TSBooleanKeyword";
|
|
703
|
+
AST_NODE_TYPES5["TSCallSignatureDeclaration"] = "TSCallSignatureDeclaration";
|
|
704
|
+
AST_NODE_TYPES5["TSClassImplements"] = "TSClassImplements";
|
|
705
|
+
AST_NODE_TYPES5["TSConditionalType"] = "TSConditionalType";
|
|
706
|
+
AST_NODE_TYPES5["TSConstructorType"] = "TSConstructorType";
|
|
707
|
+
AST_NODE_TYPES5["TSConstructSignatureDeclaration"] = "TSConstructSignatureDeclaration";
|
|
708
|
+
AST_NODE_TYPES5["TSDeclareFunction"] = "TSDeclareFunction";
|
|
709
|
+
AST_NODE_TYPES5["TSDeclareKeyword"] = "TSDeclareKeyword";
|
|
710
|
+
AST_NODE_TYPES5["TSEmptyBodyFunctionExpression"] = "TSEmptyBodyFunctionExpression";
|
|
711
|
+
AST_NODE_TYPES5["TSEnumDeclaration"] = "TSEnumDeclaration";
|
|
712
|
+
AST_NODE_TYPES5["TSEnumMember"] = "TSEnumMember";
|
|
713
|
+
AST_NODE_TYPES5["TSExportAssignment"] = "TSExportAssignment";
|
|
714
|
+
AST_NODE_TYPES5["TSExportKeyword"] = "TSExportKeyword";
|
|
715
|
+
AST_NODE_TYPES5["TSExternalModuleReference"] = "TSExternalModuleReference";
|
|
716
|
+
AST_NODE_TYPES5["TSFunctionType"] = "TSFunctionType";
|
|
717
|
+
AST_NODE_TYPES5["TSInstantiationExpression"] = "TSInstantiationExpression";
|
|
718
|
+
AST_NODE_TYPES5["TSImportEqualsDeclaration"] = "TSImportEqualsDeclaration";
|
|
719
|
+
AST_NODE_TYPES5["TSImportType"] = "TSImportType";
|
|
720
|
+
AST_NODE_TYPES5["TSIndexedAccessType"] = "TSIndexedAccessType";
|
|
721
|
+
AST_NODE_TYPES5["TSIndexSignature"] = "TSIndexSignature";
|
|
722
|
+
AST_NODE_TYPES5["TSInferType"] = "TSInferType";
|
|
723
|
+
AST_NODE_TYPES5["TSInterfaceBody"] = "TSInterfaceBody";
|
|
724
|
+
AST_NODE_TYPES5["TSInterfaceDeclaration"] = "TSInterfaceDeclaration";
|
|
725
|
+
AST_NODE_TYPES5["TSInterfaceHeritage"] = "TSInterfaceHeritage";
|
|
726
|
+
AST_NODE_TYPES5["TSIntersectionType"] = "TSIntersectionType";
|
|
727
|
+
AST_NODE_TYPES5["TSIntrinsicKeyword"] = "TSIntrinsicKeyword";
|
|
728
|
+
AST_NODE_TYPES5["TSLiteralType"] = "TSLiteralType";
|
|
729
|
+
AST_NODE_TYPES5["TSMappedType"] = "TSMappedType";
|
|
730
|
+
AST_NODE_TYPES5["TSMethodSignature"] = "TSMethodSignature";
|
|
731
|
+
AST_NODE_TYPES5["TSModuleBlock"] = "TSModuleBlock";
|
|
732
|
+
AST_NODE_TYPES5["TSModuleDeclaration"] = "TSModuleDeclaration";
|
|
733
|
+
AST_NODE_TYPES5["TSNamedTupleMember"] = "TSNamedTupleMember";
|
|
734
|
+
AST_NODE_TYPES5["TSNamespaceExportDeclaration"] = "TSNamespaceExportDeclaration";
|
|
735
|
+
AST_NODE_TYPES5["TSNeverKeyword"] = "TSNeverKeyword";
|
|
736
|
+
AST_NODE_TYPES5["TSNonNullExpression"] = "TSNonNullExpression";
|
|
737
|
+
AST_NODE_TYPES5["TSNullKeyword"] = "TSNullKeyword";
|
|
738
|
+
AST_NODE_TYPES5["TSNumberKeyword"] = "TSNumberKeyword";
|
|
739
|
+
AST_NODE_TYPES5["TSObjectKeyword"] = "TSObjectKeyword";
|
|
740
|
+
AST_NODE_TYPES5["TSOptionalType"] = "TSOptionalType";
|
|
741
|
+
AST_NODE_TYPES5["TSParameterProperty"] = "TSParameterProperty";
|
|
742
|
+
AST_NODE_TYPES5["TSPrivateKeyword"] = "TSPrivateKeyword";
|
|
743
|
+
AST_NODE_TYPES5["TSPropertySignature"] = "TSPropertySignature";
|
|
744
|
+
AST_NODE_TYPES5["TSProtectedKeyword"] = "TSProtectedKeyword";
|
|
745
|
+
AST_NODE_TYPES5["TSPublicKeyword"] = "TSPublicKeyword";
|
|
746
|
+
AST_NODE_TYPES5["TSQualifiedName"] = "TSQualifiedName";
|
|
747
|
+
AST_NODE_TYPES5["TSReadonlyKeyword"] = "TSReadonlyKeyword";
|
|
748
|
+
AST_NODE_TYPES5["TSRestType"] = "TSRestType";
|
|
749
|
+
AST_NODE_TYPES5["TSSatisfiesExpression"] = "TSSatisfiesExpression";
|
|
750
|
+
AST_NODE_TYPES5["TSStaticKeyword"] = "TSStaticKeyword";
|
|
751
|
+
AST_NODE_TYPES5["TSStringKeyword"] = "TSStringKeyword";
|
|
752
|
+
AST_NODE_TYPES5["TSSymbolKeyword"] = "TSSymbolKeyword";
|
|
753
|
+
AST_NODE_TYPES5["TSTemplateLiteralType"] = "TSTemplateLiteralType";
|
|
754
|
+
AST_NODE_TYPES5["TSThisType"] = "TSThisType";
|
|
755
|
+
AST_NODE_TYPES5["TSTupleType"] = "TSTupleType";
|
|
756
|
+
AST_NODE_TYPES5["TSTypeAliasDeclaration"] = "TSTypeAliasDeclaration";
|
|
757
|
+
AST_NODE_TYPES5["TSTypeAnnotation"] = "TSTypeAnnotation";
|
|
758
|
+
AST_NODE_TYPES5["TSTypeAssertion"] = "TSTypeAssertion";
|
|
759
|
+
AST_NODE_TYPES5["TSTypeLiteral"] = "TSTypeLiteral";
|
|
760
|
+
AST_NODE_TYPES5["TSTypeOperator"] = "TSTypeOperator";
|
|
761
|
+
AST_NODE_TYPES5["TSTypeParameter"] = "TSTypeParameter";
|
|
762
|
+
AST_NODE_TYPES5["TSTypeParameterDeclaration"] = "TSTypeParameterDeclaration";
|
|
763
|
+
AST_NODE_TYPES5["TSTypeParameterInstantiation"] = "TSTypeParameterInstantiation";
|
|
764
|
+
AST_NODE_TYPES5["TSTypePredicate"] = "TSTypePredicate";
|
|
765
|
+
AST_NODE_TYPES5["TSTypeQuery"] = "TSTypeQuery";
|
|
766
|
+
AST_NODE_TYPES5["TSTypeReference"] = "TSTypeReference";
|
|
767
|
+
AST_NODE_TYPES5["TSUndefinedKeyword"] = "TSUndefinedKeyword";
|
|
768
|
+
AST_NODE_TYPES5["TSUnionType"] = "TSUnionType";
|
|
769
|
+
AST_NODE_TYPES5["TSUnknownKeyword"] = "TSUnknownKeyword";
|
|
770
|
+
AST_NODE_TYPES5["TSVoidKeyword"] = "TSVoidKeyword";
|
|
771
|
+
})(AST_NODE_TYPES4 || (exports2.AST_NODE_TYPES = AST_NODE_TYPES4 = {}));
|
|
772
772
|
var AST_TOKEN_TYPES;
|
|
773
773
|
(function(AST_TOKEN_TYPES2) {
|
|
774
774
|
AST_TOKEN_TYPES2["Boolean"] = "Boolean";
|
|
@@ -7884,7 +7884,7 @@ init_cjs_shims();
|
|
|
7884
7884
|
|
|
7885
7885
|
// package.json
|
|
7886
7886
|
var name = "@pandacss/eslint-plugin";
|
|
7887
|
-
var version = "0.2.
|
|
7887
|
+
var version = "0.2.10";
|
|
7888
7888
|
|
|
7889
7889
|
// src/configs/all.ts
|
|
7890
7890
|
init_cjs_shims();
|
|
@@ -8104,7 +8104,6 @@ var isColorToken = (value, context) => {
|
|
|
8104
8104
|
if (!value) return;
|
|
8105
8105
|
return syncAction("isColorToken", getSyncOpts(context), value);
|
|
8106
8106
|
};
|
|
8107
|
-
var invalidTokensCache = /* @__PURE__ */ new Map();
|
|
8108
8107
|
var extractTokens = (value) => {
|
|
8109
8108
|
const regex = /token\(([^"'(),]+)(?:,\s*([^"'(),]+))?\)|\{([^{\r\n}]+)\}/g;
|
|
8110
8109
|
const matches = [];
|
|
@@ -8121,6 +8120,7 @@ var extractTokens = (value) => {
|
|
|
8121
8120
|
}
|
|
8122
8121
|
return matches.filter(Boolean);
|
|
8123
8122
|
};
|
|
8123
|
+
var invalidTokensCache = /* @__PURE__ */ new Map();
|
|
8124
8124
|
var getInvalidTokens = (value, context) => {
|
|
8125
8125
|
if (invalidTokensCache.has(value)) {
|
|
8126
8126
|
return invalidTokensCache.get(value);
|
|
@@ -8131,6 +8131,19 @@ var getInvalidTokens = (value, context) => {
|
|
|
8131
8131
|
invalidTokensCache.set(value, invalidTokens);
|
|
8132
8132
|
return invalidTokens;
|
|
8133
8133
|
};
|
|
8134
|
+
var deprecatedTokensCache = /* @__PURE__ */ new Map();
|
|
8135
|
+
var getDeprecatedTokens = (prop, value, context) => {
|
|
8136
|
+
const propCategory = syncAction("getPropCategory", getSyncOpts(context), prop);
|
|
8137
|
+
const tokens = extractTokens(value);
|
|
8138
|
+
if (!propCategory && !tokens.length) return [];
|
|
8139
|
+
const values = tokens.length ? tokens : [{ category: propCategory, value: value.split("/")[0] }];
|
|
8140
|
+
if (deprecatedTokensCache.has(value)) {
|
|
8141
|
+
return deprecatedTokensCache.get(value);
|
|
8142
|
+
}
|
|
8143
|
+
const deprecatedTokens = syncAction("filterDeprecatedTokens", getSyncOpts(context), values);
|
|
8144
|
+
deprecatedTokensCache.set(value, deprecatedTokens);
|
|
8145
|
+
return deprecatedTokens;
|
|
8146
|
+
};
|
|
8134
8147
|
var getTokenImport = (context) => {
|
|
8135
8148
|
const imports = _getImports(context);
|
|
8136
8149
|
return imports.find((imp) => imp.name === "token");
|
|
@@ -8346,12 +8359,119 @@ var rule3 = createRule({
|
|
|
8346
8359
|
});
|
|
8347
8360
|
var no_debug_default = rule3;
|
|
8348
8361
|
|
|
8349
|
-
// src/rules/no-
|
|
8362
|
+
// src/rules/no-deprecated-tokens.ts
|
|
8350
8363
|
init_cjs_shims();
|
|
8351
|
-
var
|
|
8352
|
-
var
|
|
8364
|
+
var import_utils10 = require("@typescript-eslint/utils");
|
|
8365
|
+
var import_ast_utils2 = require("@typescript-eslint/utils/ast-utils");
|
|
8366
|
+
var RULE_NAME4 = "no-deprecated-tokens";
|
|
8353
8367
|
var rule4 = createRule({
|
|
8354
8368
|
name: RULE_NAME4,
|
|
8369
|
+
meta: {
|
|
8370
|
+
docs: {
|
|
8371
|
+
description: "Disallow the use of deprecated tokens within token function syntax."
|
|
8372
|
+
},
|
|
8373
|
+
messages: {
|
|
8374
|
+
noDeprecatedTokenPaths: "`{{token}}` is a deprecated token.",
|
|
8375
|
+
noDeprecatedTokens: "`{{token}}` is a deprecated {{category}} token."
|
|
8376
|
+
},
|
|
8377
|
+
type: "problem",
|
|
8378
|
+
schema: []
|
|
8379
|
+
},
|
|
8380
|
+
defaultOptions: [],
|
|
8381
|
+
create(context) {
|
|
8382
|
+
const deprecatedTokensCache2 = /* @__PURE__ */ new Map();
|
|
8383
|
+
const sendReport = (prop, node, value) => {
|
|
8384
|
+
if (!value) return;
|
|
8385
|
+
let tokens = deprecatedTokensCache2.get(value);
|
|
8386
|
+
if (!tokens) {
|
|
8387
|
+
tokens = getDeprecatedTokens(prop, value, context);
|
|
8388
|
+
deprecatedTokensCache2.set(value, tokens);
|
|
8389
|
+
}
|
|
8390
|
+
if (tokens.length === 0) return;
|
|
8391
|
+
tokens.forEach((token) => {
|
|
8392
|
+
context.report({
|
|
8393
|
+
node,
|
|
8394
|
+
messageId: typeof token === "string" ? "noDeprecatedTokenPaths" : "noDeprecatedTokens",
|
|
8395
|
+
data: {
|
|
8396
|
+
token: typeof token === "string" ? token : token.value,
|
|
8397
|
+
category: typeof token === "string" ? void 0 : token.category
|
|
8398
|
+
}
|
|
8399
|
+
});
|
|
8400
|
+
});
|
|
8401
|
+
};
|
|
8402
|
+
const handleLiteralOrTemplate = (prop, node) => {
|
|
8403
|
+
if (!node) return;
|
|
8404
|
+
if (isLiteral(node)) {
|
|
8405
|
+
const value = node.value?.toString();
|
|
8406
|
+
sendReport(prop, node, value);
|
|
8407
|
+
} else if (isTemplateLiteral(node) && node.expressions.length === 0) {
|
|
8408
|
+
const value = node.quasis[0].value.raw;
|
|
8409
|
+
sendReport(prop, node.quasis[0], value);
|
|
8410
|
+
}
|
|
8411
|
+
};
|
|
8412
|
+
return {
|
|
8413
|
+
JSXAttribute(node) {
|
|
8414
|
+
if (!node.value || !isPandaProp(node, context)) return;
|
|
8415
|
+
const prop = node.name.name;
|
|
8416
|
+
if (isLiteral(node.value)) {
|
|
8417
|
+
handleLiteralOrTemplate(prop, node.value);
|
|
8418
|
+
} else if (isJSXExpressionContainer(node.value)) {
|
|
8419
|
+
handleLiteralOrTemplate(prop, node.value.expression);
|
|
8420
|
+
}
|
|
8421
|
+
},
|
|
8422
|
+
Property(node) {
|
|
8423
|
+
if (!isIdentifier(node.key) || !(0, import_ast_utils2.isNodeOfTypes)([import_utils10.AST_NODE_TYPES.Literal, import_utils10.AST_NODE_TYPES.TemplateLiteral])(node.value) || !isPandaAttribute(node, context) || isRecipeVariant(node, context)) {
|
|
8424
|
+
return;
|
|
8425
|
+
}
|
|
8426
|
+
const prop = node.key.name;
|
|
8427
|
+
handleLiteralOrTemplate(prop, node.value);
|
|
8428
|
+
},
|
|
8429
|
+
TaggedTemplateExpression(node) {
|
|
8430
|
+
const caller = getTaggedTemplateCaller(node);
|
|
8431
|
+
if (!caller || !isPandaIsh(caller, context)) return;
|
|
8432
|
+
const quasis = node.quasi.quasis;
|
|
8433
|
+
quasis.forEach((quasi) => {
|
|
8434
|
+
const styles = quasi.value.raw;
|
|
8435
|
+
if (!styles) return;
|
|
8436
|
+
let tokens = deprecatedTokensCache2.get(styles);
|
|
8437
|
+
if (!tokens) {
|
|
8438
|
+
tokens = getDeprecatedTokens("", styles, context);
|
|
8439
|
+
deprecatedTokensCache2.set(styles, tokens);
|
|
8440
|
+
}
|
|
8441
|
+
if (tokens.length === 0) return;
|
|
8442
|
+
tokens.forEach((token) => {
|
|
8443
|
+
const tokenValue = typeof token === "string" ? token : token.value;
|
|
8444
|
+
let index = styles.indexOf(tokenValue);
|
|
8445
|
+
while (index !== -1) {
|
|
8446
|
+
const start = quasi.range[0] + index + 1;
|
|
8447
|
+
const end = start + tokenValue.length;
|
|
8448
|
+
context.report({
|
|
8449
|
+
loc: {
|
|
8450
|
+
start: context.sourceCode.getLocFromIndex(start),
|
|
8451
|
+
end: context.sourceCode.getLocFromIndex(end)
|
|
8452
|
+
},
|
|
8453
|
+
messageId: typeof token === "string" ? "noDeprecatedTokenPaths" : "noDeprecatedTokens",
|
|
8454
|
+
data: {
|
|
8455
|
+
token: tokenValue,
|
|
8456
|
+
category: typeof token === "string" ? void 0 : token.category
|
|
8457
|
+
}
|
|
8458
|
+
});
|
|
8459
|
+
index = styles.indexOf(tokenValue, index + tokenValue.length);
|
|
8460
|
+
}
|
|
8461
|
+
});
|
|
8462
|
+
});
|
|
8463
|
+
}
|
|
8464
|
+
};
|
|
8465
|
+
}
|
|
8466
|
+
});
|
|
8467
|
+
var no_deprecated_tokens_default = rule4;
|
|
8468
|
+
|
|
8469
|
+
// src/rules/no-dynamic-styling.ts
|
|
8470
|
+
init_cjs_shims();
|
|
8471
|
+
var import_utils11 = require("@typescript-eslint/utils");
|
|
8472
|
+
var RULE_NAME5 = "no-dynamic-styling";
|
|
8473
|
+
var rule5 = createRule({
|
|
8474
|
+
name: RULE_NAME5,
|
|
8355
8475
|
meta: {
|
|
8356
8476
|
docs: {
|
|
8357
8477
|
description: "Ensure users don't use dynamic styling. Prefer static styles, leverage CSS variables, or recipes for known dynamic styles."
|
|
@@ -8428,15 +8548,15 @@ var rule4 = createRule({
|
|
|
8428
8548
|
};
|
|
8429
8549
|
}
|
|
8430
8550
|
});
|
|
8431
|
-
var no_dynamic_styling_default =
|
|
8551
|
+
var no_dynamic_styling_default = rule5;
|
|
8432
8552
|
|
|
8433
8553
|
// src/rules/no-escape-hatch.ts
|
|
8434
8554
|
init_cjs_shims();
|
|
8435
8555
|
var import_shared = require("@pandacss/shared");
|
|
8436
|
-
var
|
|
8437
|
-
var
|
|
8438
|
-
var
|
|
8439
|
-
name:
|
|
8556
|
+
var import_utils14 = require("@typescript-eslint/utils");
|
|
8557
|
+
var RULE_NAME6 = "no-escape-hatch";
|
|
8558
|
+
var rule6 = createRule({
|
|
8559
|
+
name: RULE_NAME6,
|
|
8440
8560
|
meta: {
|
|
8441
8561
|
docs: {
|
|
8442
8562
|
description: "Prohibit the use of escape hatch syntax in the code."
|
|
@@ -8510,14 +8630,14 @@ var rule5 = createRule({
|
|
|
8510
8630
|
};
|
|
8511
8631
|
}
|
|
8512
8632
|
});
|
|
8513
|
-
var no_escape_hatch_default =
|
|
8633
|
+
var no_escape_hatch_default = rule6;
|
|
8514
8634
|
|
|
8515
8635
|
// src/rules/no-hardcoded-color.ts
|
|
8516
8636
|
init_cjs_shims();
|
|
8517
|
-
var
|
|
8518
|
-
var
|
|
8519
|
-
var
|
|
8520
|
-
name:
|
|
8637
|
+
var import_utils16 = require("@typescript-eslint/utils");
|
|
8638
|
+
var RULE_NAME7 = "no-hardcoded-color";
|
|
8639
|
+
var rule7 = createRule({
|
|
8640
|
+
name: RULE_NAME7,
|
|
8521
8641
|
meta: {
|
|
8522
8642
|
docs: {
|
|
8523
8643
|
description: "Enforce the exclusive use of design tokens as values for colors within the codebase."
|
|
@@ -8637,17 +8757,17 @@ var rule6 = createRule({
|
|
|
8637
8757
|
};
|
|
8638
8758
|
}
|
|
8639
8759
|
});
|
|
8640
|
-
var no_hardcoded_color_default =
|
|
8760
|
+
var no_hardcoded_color_default = rule7;
|
|
8641
8761
|
|
|
8642
8762
|
// src/rules/no-important.ts
|
|
8643
8763
|
init_cjs_shims();
|
|
8644
8764
|
var import_shared2 = require("@pandacss/shared");
|
|
8645
|
-
var
|
|
8765
|
+
var import_utils18 = require("@typescript-eslint/utils");
|
|
8646
8766
|
var exclamationRegex = /\s*!$/;
|
|
8647
8767
|
var importantRegex = /\s*!important\s*$/;
|
|
8648
|
-
var
|
|
8649
|
-
var
|
|
8650
|
-
name:
|
|
8768
|
+
var RULE_NAME8 = "no-important";
|
|
8769
|
+
var rule8 = createRule({
|
|
8770
|
+
name: RULE_NAME8,
|
|
8651
8771
|
meta: {
|
|
8652
8772
|
docs: {
|
|
8653
8773
|
description: "Disallow usage of !important keyword. Prioritize specificity for a maintainable and predictable styling structure."
|
|
@@ -8762,14 +8882,14 @@ var rule7 = createRule({
|
|
|
8762
8882
|
};
|
|
8763
8883
|
}
|
|
8764
8884
|
});
|
|
8765
|
-
var no_important_default =
|
|
8885
|
+
var no_important_default = rule8;
|
|
8766
8886
|
|
|
8767
8887
|
// src/rules/no-invalid-nesting.ts
|
|
8768
8888
|
init_cjs_shims();
|
|
8769
|
-
var
|
|
8770
|
-
var
|
|
8771
|
-
var
|
|
8772
|
-
name:
|
|
8889
|
+
var import_utils20 = require("@typescript-eslint/utils");
|
|
8890
|
+
var RULE_NAME9 = "no-invalid-nesting";
|
|
8891
|
+
var rule9 = createRule({
|
|
8892
|
+
name: RULE_NAME9,
|
|
8773
8893
|
meta: {
|
|
8774
8894
|
docs: {
|
|
8775
8895
|
description: "Warn against invalid nesting. Nested styles must contain the `&` character."
|
|
@@ -8845,15 +8965,15 @@ var rule8 = createRule({
|
|
|
8845
8965
|
};
|
|
8846
8966
|
}
|
|
8847
8967
|
});
|
|
8848
|
-
var no_invalid_nesting_default =
|
|
8968
|
+
var no_invalid_nesting_default = rule9;
|
|
8849
8969
|
|
|
8850
8970
|
// src/rules/no-invalid-token-paths.ts
|
|
8851
8971
|
init_cjs_shims();
|
|
8852
|
-
var
|
|
8853
|
-
var
|
|
8854
|
-
var
|
|
8855
|
-
var
|
|
8856
|
-
name:
|
|
8972
|
+
var import_utils22 = require("@typescript-eslint/utils");
|
|
8973
|
+
var import_ast_utils3 = require("@typescript-eslint/utils/ast-utils");
|
|
8974
|
+
var RULE_NAME10 = "no-invalid-token-paths";
|
|
8975
|
+
var rule10 = createRule({
|
|
8976
|
+
name: RULE_NAME10,
|
|
8857
8977
|
meta: {
|
|
8858
8978
|
docs: {
|
|
8859
8979
|
description: "Disallow the use of invalid token paths within token function syntax."
|
|
@@ -8903,7 +9023,7 @@ var rule9 = createRule({
|
|
|
8903
9023
|
}
|
|
8904
9024
|
},
|
|
8905
9025
|
Property(node) {
|
|
8906
|
-
if (!isIdentifier(node.key) || !(0,
|
|
9026
|
+
if (!isIdentifier(node.key) || !(0, import_ast_utils3.isNodeOfTypes)([import_utils22.AST_NODE_TYPES.Literal, import_utils22.AST_NODE_TYPES.TemplateLiteral])(node.value) || !isPandaAttribute(node, context) || isRecipeVariant(node, context)) {
|
|
8907
9027
|
return;
|
|
8908
9028
|
}
|
|
8909
9029
|
handleLiteralOrTemplate(node.value);
|
|
@@ -8942,13 +9062,13 @@ var rule9 = createRule({
|
|
|
8942
9062
|
};
|
|
8943
9063
|
}
|
|
8944
9064
|
});
|
|
8945
|
-
var no_invalid_token_paths_default =
|
|
9065
|
+
var no_invalid_token_paths_default = rule10;
|
|
8946
9066
|
|
|
8947
9067
|
// src/rules/no-margin-properties.ts
|
|
8948
9068
|
init_cjs_shims();
|
|
8949
|
-
var
|
|
8950
|
-
var
|
|
8951
|
-
name:
|
|
9069
|
+
var RULE_NAME11 = "no-margin-properties";
|
|
9070
|
+
var rule11 = createRule({
|
|
9071
|
+
name: RULE_NAME11,
|
|
8952
9072
|
meta: {
|
|
8953
9073
|
docs: {
|
|
8954
9074
|
description: "Discourage using margin properties for spacing; prefer defining spacing in parent elements with `flex` or `grid` using the `gap` property for a more resilient layout. Margins make components less reusable in other contexts."
|
|
@@ -9045,7 +9165,7 @@ var rule10 = createRule({
|
|
|
9045
9165
|
};
|
|
9046
9166
|
}
|
|
9047
9167
|
});
|
|
9048
|
-
var no_margin_properties_default =
|
|
9168
|
+
var no_margin_properties_default = rule11;
|
|
9049
9169
|
|
|
9050
9170
|
// src/rules/no-physical-properties.ts
|
|
9051
9171
|
init_cjs_shims();
|
|
@@ -9086,19 +9206,112 @@ var physicalProperties = {
|
|
|
9086
9206
|
top: "insetBlockStart",
|
|
9087
9207
|
bottom: "insetBlockEnd"
|
|
9088
9208
|
};
|
|
9209
|
+
var physicalPropertyValues = {
|
|
9210
|
+
// text-align physical values mapped to logical values
|
|
9211
|
+
textAlign: {
|
|
9212
|
+
left: "start",
|
|
9213
|
+
right: "end"
|
|
9214
|
+
}
|
|
9215
|
+
};
|
|
9089
9216
|
|
|
9090
9217
|
// src/rules/no-physical-properties.ts
|
|
9091
|
-
var
|
|
9092
|
-
var
|
|
9093
|
-
|
|
9218
|
+
var RULE_NAME12 = "no-physical-properties";
|
|
9219
|
+
var MESSAGES = {
|
|
9220
|
+
physical: "Use logical property instead of {{physical}}. Prefer `{{logical}}`.",
|
|
9221
|
+
physicalValue: "Use logical value instead of {{physical}}. Prefer `{{logical}}`.",
|
|
9222
|
+
replace: "Replace `{{physical}}` with `{{logical}}`."
|
|
9223
|
+
};
|
|
9224
|
+
var PropertyCache = class {
|
|
9225
|
+
longhandCache = /* @__PURE__ */ new Map();
|
|
9226
|
+
pandaPropCache = /* @__PURE__ */ new WeakMap();
|
|
9227
|
+
pandaAttributeCache = /* @__PURE__ */ new WeakMap();
|
|
9228
|
+
recipeVariantCache = /* @__PURE__ */ new WeakMap();
|
|
9229
|
+
getLonghand(name2, context) {
|
|
9230
|
+
if (this.longhandCache.has(name2)) {
|
|
9231
|
+
return this.longhandCache.get(name2);
|
|
9232
|
+
}
|
|
9233
|
+
const longhand = resolveLonghand(name2, context) ?? name2;
|
|
9234
|
+
this.longhandCache.set(name2, longhand);
|
|
9235
|
+
return longhand;
|
|
9236
|
+
}
|
|
9237
|
+
isPandaProp(node, context) {
|
|
9238
|
+
if (this.pandaPropCache.has(node)) {
|
|
9239
|
+
return this.pandaPropCache.get(node);
|
|
9240
|
+
}
|
|
9241
|
+
const result = isPandaProp(node, context);
|
|
9242
|
+
this.pandaPropCache.set(node, result);
|
|
9243
|
+
return !!result;
|
|
9244
|
+
}
|
|
9245
|
+
isPandaAttribute(node, context) {
|
|
9246
|
+
if (this.pandaAttributeCache.has(node)) {
|
|
9247
|
+
return this.pandaAttributeCache.get(node);
|
|
9248
|
+
}
|
|
9249
|
+
const result = isPandaAttribute(node, context);
|
|
9250
|
+
this.pandaAttributeCache.set(node, result);
|
|
9251
|
+
return !!result;
|
|
9252
|
+
}
|
|
9253
|
+
isRecipeVariant(node, context) {
|
|
9254
|
+
if (this.recipeVariantCache.has(node)) {
|
|
9255
|
+
return this.recipeVariantCache.get(node);
|
|
9256
|
+
}
|
|
9257
|
+
const result = isRecipeVariant(node, context);
|
|
9258
|
+
this.recipeVariantCache.set(node, result);
|
|
9259
|
+
return !!result;
|
|
9260
|
+
}
|
|
9261
|
+
};
|
|
9262
|
+
var extractStringLiteralValue = (valueNode) => {
|
|
9263
|
+
if (isLiteral(valueNode) && typeof valueNode.value === "string") {
|
|
9264
|
+
return valueNode.value;
|
|
9265
|
+
}
|
|
9266
|
+
if (isJSXExpressionContainer(valueNode) && isLiteral(valueNode.expression) && typeof valueNode.expression.value === "string") {
|
|
9267
|
+
return valueNode.expression.value;
|
|
9268
|
+
}
|
|
9269
|
+
return null;
|
|
9270
|
+
};
|
|
9271
|
+
var createPropertyReport = (node, longhandName, logical, context) => {
|
|
9272
|
+
const physicalName = `\`${node.name}\`${longhandName !== node.name ? ` (resolved to \`${longhandName}\`)` : ""}`;
|
|
9273
|
+
context.report({
|
|
9274
|
+
node,
|
|
9275
|
+
messageId: "physical",
|
|
9276
|
+
data: { physical: physicalName, logical },
|
|
9277
|
+
suggest: [
|
|
9278
|
+
{
|
|
9279
|
+
messageId: "replace",
|
|
9280
|
+
data: { physical: node.name, logical },
|
|
9281
|
+
fix: (fixer) => fixer.replaceText(node, logical)
|
|
9282
|
+
}
|
|
9283
|
+
]
|
|
9284
|
+
});
|
|
9285
|
+
};
|
|
9286
|
+
var createValueReport = (valueNode, valueText, logical, context) => {
|
|
9287
|
+
context.report({
|
|
9288
|
+
node: valueNode,
|
|
9289
|
+
messageId: "physicalValue",
|
|
9290
|
+
data: { physical: `"${valueText}"`, logical: `"${logical}"` },
|
|
9291
|
+
suggest: [
|
|
9292
|
+
{
|
|
9293
|
+
messageId: "replace",
|
|
9294
|
+
data: { physical: `"${valueText}"`, logical: `"${logical}"` },
|
|
9295
|
+
fix: (fixer) => {
|
|
9296
|
+
if (isLiteral(valueNode)) {
|
|
9297
|
+
return fixer.replaceText(valueNode, `"${logical}"`);
|
|
9298
|
+
}
|
|
9299
|
+
if (isJSXExpressionContainer(valueNode) && isLiteral(valueNode.expression)) {
|
|
9300
|
+
return fixer.replaceText(valueNode.expression, `"${logical}"`);
|
|
9301
|
+
}
|
|
9302
|
+
return null;
|
|
9303
|
+
}
|
|
9304
|
+
}
|
|
9305
|
+
]
|
|
9306
|
+
});
|
|
9307
|
+
};
|
|
9308
|
+
var rule12 = createRule({
|
|
9309
|
+
name: RULE_NAME12,
|
|
9094
9310
|
meta: {
|
|
9095
9311
|
docs: {
|
|
9096
9312
|
description: "Encourage the use of logical properties over physical properties to foster a responsive and adaptable user interface."
|
|
9097
9313
|
},
|
|
9098
|
-
messages:
|
|
9099
|
-
physical: "Use logical property instead of {{physical}}. Prefer `{{logical}}`.",
|
|
9100
|
-
replace: "Replace `{{physical}}` with `{{logical}}`."
|
|
9101
|
-
},
|
|
9314
|
+
messages: MESSAGES,
|
|
9102
9315
|
type: "suggestion",
|
|
9103
9316
|
hasSuggestions: true,
|
|
9104
9317
|
schema: [
|
|
@@ -9118,98 +9331,55 @@ var rule11 = createRule({
|
|
|
9118
9331
|
}
|
|
9119
9332
|
]
|
|
9120
9333
|
},
|
|
9121
|
-
defaultOptions: [
|
|
9122
|
-
{
|
|
9123
|
-
whitelist: []
|
|
9124
|
-
}
|
|
9125
|
-
],
|
|
9334
|
+
defaultOptions: [{ whitelist: [] }],
|
|
9126
9335
|
create(context) {
|
|
9127
9336
|
const whitelist = context.options[0]?.whitelist ?? [];
|
|
9128
|
-
const
|
|
9129
|
-
const
|
|
9130
|
-
const pandaAttributeCache = /* @__PURE__ */ new WeakMap();
|
|
9131
|
-
const recipeVariantCache = /* @__PURE__ */ new WeakMap();
|
|
9132
|
-
const getLonghand = (name2) => {
|
|
9133
|
-
if (longhandCache.has(name2)) {
|
|
9134
|
-
return longhandCache.get(name2);
|
|
9135
|
-
}
|
|
9136
|
-
const longhand = resolveLonghand(name2, context) ?? name2;
|
|
9137
|
-
longhandCache.set(name2, longhand);
|
|
9138
|
-
return longhand;
|
|
9139
|
-
};
|
|
9140
|
-
const isCachedPandaProp = (node) => {
|
|
9141
|
-
if (pandaPropCache.has(node)) {
|
|
9142
|
-
return pandaPropCache.get(node);
|
|
9143
|
-
}
|
|
9144
|
-
const result = isPandaProp(node, context);
|
|
9145
|
-
pandaPropCache.set(node, result);
|
|
9146
|
-
return !!result;
|
|
9147
|
-
};
|
|
9148
|
-
const isCachedPandaAttribute = (node) => {
|
|
9149
|
-
if (pandaAttributeCache.has(node)) {
|
|
9150
|
-
return pandaAttributeCache.get(node);
|
|
9151
|
-
}
|
|
9152
|
-
const result = isPandaAttribute(node, context);
|
|
9153
|
-
pandaAttributeCache.set(node, result);
|
|
9154
|
-
return !!result;
|
|
9155
|
-
};
|
|
9156
|
-
const isCachedRecipeVariant = (node) => {
|
|
9157
|
-
if (recipeVariantCache.has(node)) {
|
|
9158
|
-
return recipeVariantCache.get(node);
|
|
9159
|
-
}
|
|
9160
|
-
const result = isRecipeVariant(node, context);
|
|
9161
|
-
recipeVariantCache.set(node, result);
|
|
9162
|
-
return !!result;
|
|
9163
|
-
};
|
|
9164
|
-
const sendReport = (node) => {
|
|
9337
|
+
const cache = new PropertyCache();
|
|
9338
|
+
const checkPropertyName = (node) => {
|
|
9165
9339
|
if (whitelist.includes(node.name)) return;
|
|
9166
|
-
const longhandName = getLonghand(node.name);
|
|
9340
|
+
const longhandName = cache.getLonghand(node.name, context);
|
|
9167
9341
|
if (!(longhandName in physicalProperties)) return;
|
|
9168
9342
|
const logical = physicalProperties[longhandName];
|
|
9169
|
-
|
|
9170
|
-
|
|
9171
|
-
|
|
9172
|
-
|
|
9173
|
-
|
|
9174
|
-
|
|
9175
|
-
|
|
9176
|
-
|
|
9177
|
-
|
|
9178
|
-
|
|
9179
|
-
|
|
9180
|
-
data: {
|
|
9181
|
-
physical: node.name,
|
|
9182
|
-
logical
|
|
9183
|
-
},
|
|
9184
|
-
fix: (fixer) => {
|
|
9185
|
-
return fixer.replaceText(node, logical);
|
|
9186
|
-
}
|
|
9187
|
-
}
|
|
9188
|
-
]
|
|
9189
|
-
});
|
|
9343
|
+
createPropertyReport(node, longhandName, logical, context);
|
|
9344
|
+
};
|
|
9345
|
+
const checkPropertyValue = (keyNode, valueNode) => {
|
|
9346
|
+
const propName = keyNode.name;
|
|
9347
|
+
if (!(propName in physicalPropertyValues)) return false;
|
|
9348
|
+
const valueText = extractStringLiteralValue(valueNode);
|
|
9349
|
+
if (valueText === null) return false;
|
|
9350
|
+
const valueMap = physicalPropertyValues[propName];
|
|
9351
|
+
if (!valueMap[valueText]) return false;
|
|
9352
|
+
createValueReport(valueNode, valueText, valueMap[valueText], context);
|
|
9353
|
+
return true;
|
|
9190
9354
|
};
|
|
9191
9355
|
return {
|
|
9192
9356
|
JSXAttribute(node) {
|
|
9193
9357
|
if (!isJSXIdentifier(node.name)) return;
|
|
9194
|
-
if (!
|
|
9195
|
-
|
|
9358
|
+
if (!cache.isPandaProp(node, context)) return;
|
|
9359
|
+
checkPropertyName(node.name);
|
|
9360
|
+
if (node.value) {
|
|
9361
|
+
checkPropertyValue(node.name, node.value);
|
|
9362
|
+
}
|
|
9196
9363
|
},
|
|
9197
9364
|
Property(node) {
|
|
9198
9365
|
if (!isIdentifier(node.key)) return;
|
|
9199
|
-
if (!
|
|
9200
|
-
if (
|
|
9201
|
-
|
|
9366
|
+
if (!cache.isPandaAttribute(node, context)) return;
|
|
9367
|
+
if (cache.isRecipeVariant(node, context)) return;
|
|
9368
|
+
checkPropertyName(node.key);
|
|
9369
|
+
if (node.value) {
|
|
9370
|
+
checkPropertyValue(node.key, node.value);
|
|
9371
|
+
}
|
|
9202
9372
|
}
|
|
9203
9373
|
};
|
|
9204
9374
|
}
|
|
9205
9375
|
});
|
|
9206
|
-
var no_physical_properties_default =
|
|
9376
|
+
var no_physical_properties_default = rule12;
|
|
9207
9377
|
|
|
9208
9378
|
// src/rules/no-property-renaming.ts
|
|
9209
9379
|
init_cjs_shims();
|
|
9210
|
-
var
|
|
9211
|
-
var
|
|
9212
|
-
name:
|
|
9380
|
+
var RULE_NAME13 = "no-property-renaming";
|
|
9381
|
+
var rule13 = createRule({
|
|
9382
|
+
name: RULE_NAME13,
|
|
9213
9383
|
meta: {
|
|
9214
9384
|
docs: {
|
|
9215
9385
|
description: "Ensure that properties for patterns or style props are not renamed, as it prevents proper tracking."
|
|
@@ -9287,15 +9457,15 @@ var rule12 = createRule({
|
|
|
9287
9457
|
};
|
|
9288
9458
|
}
|
|
9289
9459
|
});
|
|
9290
|
-
var no_property_renaming_default =
|
|
9460
|
+
var no_property_renaming_default = rule13;
|
|
9291
9461
|
|
|
9292
9462
|
// src/rules/no-unsafe-token-fn-usage.ts
|
|
9293
9463
|
init_cjs_shims();
|
|
9294
|
-
var
|
|
9464
|
+
var import_utils27 = require("@typescript-eslint/utils");
|
|
9295
9465
|
var import_shared3 = require("@pandacss/shared");
|
|
9296
|
-
var
|
|
9297
|
-
var
|
|
9298
|
-
name:
|
|
9466
|
+
var RULE_NAME14 = "no-unsafe-token-fn-usage";
|
|
9467
|
+
var rule14 = createRule({
|
|
9468
|
+
name: RULE_NAME14,
|
|
9299
9469
|
meta: {
|
|
9300
9470
|
docs: {
|
|
9301
9471
|
description: "Prevent users from using the token function in situations where they could simply use the raw design token."
|
|
@@ -9420,13 +9590,13 @@ var rule13 = createRule({
|
|
|
9420
9590
|
};
|
|
9421
9591
|
}
|
|
9422
9592
|
});
|
|
9423
|
-
var no_unsafe_token_fn_usage_default =
|
|
9593
|
+
var no_unsafe_token_fn_usage_default = rule14;
|
|
9424
9594
|
|
|
9425
9595
|
// src/rules/prefer-longhand-properties.ts
|
|
9426
9596
|
init_cjs_shims();
|
|
9427
|
-
var
|
|
9428
|
-
var
|
|
9429
|
-
name:
|
|
9597
|
+
var RULE_NAME15 = "prefer-longhand-properties";
|
|
9598
|
+
var rule15 = createRule({
|
|
9599
|
+
name: RULE_NAME15,
|
|
9430
9600
|
meta: {
|
|
9431
9601
|
docs: {
|
|
9432
9602
|
description: "Discourage the use of shorthand properties and promote the preference for longhand properties in the codebase."
|
|
@@ -9533,13 +9703,13 @@ var rule14 = createRule({
|
|
|
9533
9703
|
};
|
|
9534
9704
|
}
|
|
9535
9705
|
});
|
|
9536
|
-
var prefer_longhand_properties_default =
|
|
9706
|
+
var prefer_longhand_properties_default = rule15;
|
|
9537
9707
|
|
|
9538
9708
|
// src/rules/prefer-shorthand-properties.ts
|
|
9539
9709
|
init_cjs_shims();
|
|
9540
|
-
var
|
|
9541
|
-
var
|
|
9542
|
-
name:
|
|
9710
|
+
var RULE_NAME16 = "prefer-shorthand-properties";
|
|
9711
|
+
var rule16 = createRule({
|
|
9712
|
+
name: RULE_NAME16,
|
|
9543
9713
|
meta: {
|
|
9544
9714
|
docs: {
|
|
9545
9715
|
description: "Discourage the use of longhand properties and promote the preference for shorthand properties in the codebase."
|
|
@@ -9658,7 +9828,7 @@ var rule15 = createRule({
|
|
|
9658
9828
|
};
|
|
9659
9829
|
}
|
|
9660
9830
|
});
|
|
9661
|
-
var prefer_shorthand_properties_default =
|
|
9831
|
+
var prefer_shorthand_properties_default = rule16;
|
|
9662
9832
|
|
|
9663
9833
|
// src/rules/prefer-atomic-properties.ts
|
|
9664
9834
|
init_cjs_shims();
|
|
@@ -9778,9 +9948,9 @@ var compositeProperties = {
|
|
|
9778
9948
|
};
|
|
9779
9949
|
|
|
9780
9950
|
// src/rules/prefer-atomic-properties.ts
|
|
9781
|
-
var
|
|
9782
|
-
var
|
|
9783
|
-
name:
|
|
9951
|
+
var RULE_NAME17 = "prefer-atomic-properties";
|
|
9952
|
+
var rule17 = createRule({
|
|
9953
|
+
name: RULE_NAME17,
|
|
9784
9954
|
meta: {
|
|
9785
9955
|
docs: {
|
|
9786
9956
|
description: "Encourage the use of atomic properties instead of composite properties in the codebase."
|
|
@@ -9897,13 +10067,13 @@ var rule16 = createRule({
|
|
|
9897
10067
|
};
|
|
9898
10068
|
}
|
|
9899
10069
|
});
|
|
9900
|
-
var prefer_atomic_properties_default =
|
|
10070
|
+
var prefer_atomic_properties_default = rule17;
|
|
9901
10071
|
|
|
9902
10072
|
// src/rules/prefer-composite-properties.ts
|
|
9903
10073
|
init_cjs_shims();
|
|
9904
|
-
var
|
|
9905
|
-
var
|
|
9906
|
-
name:
|
|
10074
|
+
var RULE_NAME18 = "prefer-composite-properties";
|
|
10075
|
+
var rule18 = createRule({
|
|
10076
|
+
name: RULE_NAME18,
|
|
9907
10077
|
meta: {
|
|
9908
10078
|
docs: {
|
|
9909
10079
|
description: "Encourage the use of composite properties instead of atomic properties in the codebase."
|
|
@@ -10016,13 +10186,13 @@ var rule17 = createRule({
|
|
|
10016
10186
|
};
|
|
10017
10187
|
}
|
|
10018
10188
|
});
|
|
10019
|
-
var prefer_composite_properties_default =
|
|
10189
|
+
var prefer_composite_properties_default = rule18;
|
|
10020
10190
|
|
|
10021
10191
|
// src/rules/prefer-unified-property-style.ts
|
|
10022
10192
|
init_cjs_shims();
|
|
10023
|
-
var
|
|
10024
|
-
var
|
|
10025
|
-
name:
|
|
10193
|
+
var RULE_NAME19 = "prefer-unified-property-style";
|
|
10194
|
+
var rule19 = createRule({
|
|
10195
|
+
name: RULE_NAME19,
|
|
10026
10196
|
meta: {
|
|
10027
10197
|
docs: {
|
|
10028
10198
|
description: "Discourage mixing atomic and composite forms of the same property in a style declaration. Atomic styles give more consistent results."
|
|
@@ -10128,32 +10298,33 @@ var rule18 = createRule({
|
|
|
10128
10298
|
};
|
|
10129
10299
|
}
|
|
10130
10300
|
});
|
|
10131
|
-
var prefer_unified_property_style_default =
|
|
10301
|
+
var prefer_unified_property_style_default = rule19;
|
|
10132
10302
|
|
|
10133
10303
|
// src/rules/index.ts
|
|
10134
10304
|
var rules = {
|
|
10135
10305
|
[RULE_NAME]: file_not_included_default,
|
|
10136
10306
|
[RULE_NAME2]: no_config_function_in_source_default,
|
|
10137
10307
|
[RULE_NAME3]: no_debug_default,
|
|
10138
|
-
[RULE_NAME4]:
|
|
10139
|
-
[RULE_NAME5]:
|
|
10140
|
-
[RULE_NAME6]:
|
|
10141
|
-
[RULE_NAME7]:
|
|
10142
|
-
[
|
|
10143
|
-
[
|
|
10144
|
-
[
|
|
10145
|
-
[RULE_NAME11]:
|
|
10146
|
-
[RULE_NAME12]:
|
|
10147
|
-
[RULE_NAME13]:
|
|
10148
|
-
[RULE_NAME14]:
|
|
10149
|
-
[RULE_NAME15]:
|
|
10150
|
-
[RULE_NAME16]:
|
|
10151
|
-
[RULE_NAME17]:
|
|
10152
|
-
[RULE_NAME18]:
|
|
10308
|
+
[RULE_NAME4]: no_deprecated_tokens_default,
|
|
10309
|
+
[RULE_NAME5]: no_dynamic_styling_default,
|
|
10310
|
+
[RULE_NAME6]: no_escape_hatch_default,
|
|
10311
|
+
[RULE_NAME7]: no_hardcoded_color_default,
|
|
10312
|
+
[RULE_NAME8]: no_important_default,
|
|
10313
|
+
[RULE_NAME10]: no_invalid_token_paths_default,
|
|
10314
|
+
[RULE_NAME9]: no_invalid_nesting_default,
|
|
10315
|
+
[RULE_NAME11]: no_margin_properties_default,
|
|
10316
|
+
[RULE_NAME12]: no_physical_properties_default,
|
|
10317
|
+
[RULE_NAME13]: no_property_renaming_default,
|
|
10318
|
+
[RULE_NAME14]: no_unsafe_token_fn_usage_default,
|
|
10319
|
+
[RULE_NAME15]: prefer_longhand_properties_default,
|
|
10320
|
+
[RULE_NAME16]: prefer_shorthand_properties_default,
|
|
10321
|
+
[RULE_NAME17]: prefer_atomic_properties_default,
|
|
10322
|
+
[RULE_NAME18]: prefer_composite_properties_default,
|
|
10323
|
+
[RULE_NAME19]: prefer_unified_property_style_default
|
|
10153
10324
|
};
|
|
10154
10325
|
|
|
10155
10326
|
// src/configs/all.ts
|
|
10156
|
-
var errorRules = [RULE_NAME, RULE_NAME2,
|
|
10327
|
+
var errorRules = [RULE_NAME, RULE_NAME2, RULE_NAME10];
|
|
10157
10328
|
var allRules = Object.fromEntries(
|
|
10158
10329
|
Object.entries(rules).map(([name2]) => {
|
|
10159
10330
|
return [`@pandacss/${name2}`, errorRules.includes(name2) ? "error" : "warn"];
|
|
@@ -10181,7 +10352,8 @@ var recommended_default = {
|
|
|
10181
10352
|
"@pandacss/no-invalid-nesting": "error",
|
|
10182
10353
|
"@pandacss/no-invalid-token-paths": "error",
|
|
10183
10354
|
"@pandacss/no-property-renaming": "warn",
|
|
10184
|
-
"@pandacss/no-unsafe-token-fn-usage": "warn"
|
|
10355
|
+
"@pandacss/no-unsafe-token-fn-usage": "warn",
|
|
10356
|
+
"@pandacss/no-deprecated-tokens": "warn"
|
|
10185
10357
|
}
|
|
10186
10358
|
};
|
|
10187
10359
|
|