@@ -8,22 +8,23 @@ import { fasl } from '@fortawesome/sharp-light-svg-icons';
88import { fasr } from '@fortawesome/sharp-regular-svg-icons' ;
99import { fass } from '@fortawesome/sharp-solid-svg-icons' ;
1010import { exec } from 'child_process' ;
11- import { ESLint } from 'eslint' ;
11+ import pkg from 'eslint/use-at-your-own-risk ' ;
1212import fg from 'fast-glob' ;
1313import { promises as fs , existsSync } from 'fs' ;
1414import { basename , join } from 'path' ;
1515import figmaIconPages from './figma-icon-pages.json' assert { type : 'json ' } ;
1616
1717library . add ( fas , far , fal , fat , fad , fass , fasr , fasl ) ;
1818
19+ const { FlatESLint } = pkg
20+
1921const cwd = new URL ( '.' , import . meta. url ) . pathname ,
20- eslint = new ESLint ( { fix : true } ) ;
22+ eslint = new FlatESLint ( { fix : true } ) ;
2123
2224const {
2325 default : { icon : coreIcons }
2426} = await import ( '../packages/tokens/src/core.json' , { assert : { type : 'json' } } ) ;
2527
26-
2728const getFormattedIcons = ( icons , collection ) => {
2829 return Object . entries ( icons ) . reduce ( ( acc , cur ) => {
2930 if ( cur [ 0 ] === collection ) {
@@ -138,8 +139,8 @@ const buildIcons = async theme => {
138139 sortedIcons = Object . fromEntries ( Object . entries ( { ...icons , ...coreCustomIcons , ...iconsCustom } ) . sort ( ) ) ,
139140 source = `export const icons = ${ JSON . stringify ( sortedIcons ) } ;` ,
140141 results = await eslint . lintText ( source , { filePath } ) ;
141-
142- await ESLint . outputFixes ( results ) ;
142+
143+ await FlatESLint . outputFixes ( results ) ;
143144
144145 await fs . writeFile ( filePath , results [ 0 ] . output ) ;
145146} ;
0 commit comments