@@ -45,12 +45,12 @@ export const createRule = RuleCreator(urlCreator);
4545const detectCustomClassnames = (
4646 context : RuleContext ,
4747 settings : PluginSettings ,
48- literals : Array < AtomicNode >
48+ literals : Array < AtomicNode > ,
4949) => {
5050 for ( const node of literals ) {
5151 const { originalClassNamesValue } = dissectAtomicNode (
5252 node ,
53- context as unknown as GenericRuleContext
53+ context as unknown as GenericRuleContext ,
5454 ) ;
5555 // Process the extracted classnames and report
5656 const { classNames } = getClassnamesFromValue ( originalClassNamesValue ) ;
@@ -78,7 +78,7 @@ export const noCustomClassname = createRule<Options, MessageIds>({
7878 docs : {
7979 description : "Detects classnames which do not belong to Tailwind CSS." ,
8080 } ,
81- hasSuggestions : true ,
81+ hasSuggestions : false ,
8282 messages : {
8383 "issue:unknown-classname" : `Classname '{{classname}}' is not a Tailwind CSS class!` ,
8484 } ,
@@ -88,6 +88,8 @@ export const noCustomClassname = createRule<Options, MessageIds>({
8888 type : "object" ,
8989 properties : {
9090 whitelist : {
91+ description :
92+ "List of classnames to ignore (whitelist). Exact match or regular expression." ,
9193 type : "array" ,
9294 items : { type : "string" , minLength : 0 } ,
9395 uniqueItems : true ,
@@ -96,6 +98,7 @@ export const noCustomClassname = createRule<Options, MessageIds>({
9698 additionalProperties : false ,
9799 } ,
98100 ] ,
101+ defaultOptions : [ { } ] ,
99102 type : "suggestion" ,
100103 } ,
101104 /**
@@ -119,10 +122,10 @@ export const noCustomClassname = createRule<Options, MessageIds>({
119122 context ,
120123 settings ,
121124 options ,
122- detectCustomClassnames
125+ detectCustomClassnames ,
123126 ) ,
124127 // Script visitor is used within both JSX and Vue SFC files (inside <script> section).
125- createScriptVisitors ( context , settings , options , detectCustomClassnames )
128+ createScriptVisitors ( context , settings , options , detectCustomClassnames ) ,
126129 ) ;
127130 } ,
128131} ) ;
0 commit comments