11import { RuleCreator } from "@typescript-eslint/utils/eslint-utils" ;
2- import { createSyncFn } from "synckit" ;
32
43import { PluginSharedSettings } from "../types" ;
54import urlCreator from "../url-creator" ;
5+ import { loadThemeWorker } from "../util/tailwindcss-api" ;
66
77export { ESLintUtils } from "@typescript-eslint/utils" ;
88
@@ -17,8 +17,6 @@ type Options = [
1717 }
1818] ;
1919
20- const syncFunction = createSyncFn ( require . resolve ( "../worker.mjs" ) ) ;
21-
2220// The Rule creator returns a function that is used to create a well-typed ESLint rule
2321// The parameter passed into RuleCreator is a URL generator function.
2422export const createRule = RuleCreator ( urlCreator ) ;
@@ -69,18 +67,21 @@ export const myRule = createRule<Options, MessageIds>({
6967 VariableDeclaration : ( node ) => {
7068 if ( node . kind === "var" ) {
7169 console . log ( "!!VAR!!!" ) ;
72- console . log ( "!!VAR!!!" ) ;
73- const asyncResult = syncFunction ( ) ;
74- console . log ( asyncResult ) ;
70+ const result = loadThemeWorker (
71+ require . resolve ( "../../tests/stubs/css/tiny.css" )
72+ ) ;
73+ console . log ( "Tailwind config result:" ) ;
74+ console . log ( "=======================" ) ;
75+ console . log ( result ) ;
7576 // Reading inline configuration
76- console . log ( options [ 0 ] ) ;
77+ console . log ( "\n" , "Options:" , "\n" , options [ 0 ] ) ;
7778
7879 // Shared settings
7980 const sharedSettings = ( context . settings ?. tailwindcss || {
8081 stylesheet : "" ,
8182 functions : [ ] ,
8283 } ) as PluginSharedSettings ;
83- console . log ( sharedSettings ) ;
84+ console . log ( "\n" , "sharedSettings:" , "\n" , sharedSettings ) ;
8485
8586 const rangeStart = node . range [ 0 ] ;
8687 const range : readonly [ number , number ] = [
0 commit comments