File tree Expand file tree Collapse file tree 3 files changed +12
-5
lines changed Expand file tree Collapse file tree 3 files changed +12
-5
lines changed Original file line number Diff line number Diff line change
1
+ import process from 'node:process'
1
2
import { loadConfig } from '@unocss/config'
2
3
import type { UnoGenerator } from '@unocss/core'
3
4
import { createGenerator } from '@unocss/core'
@@ -6,6 +7,9 @@ import { sortRules } from '../../shared-integration/src/sort-rules'
6
7
7
8
let promise : Promise < UnoGenerator < any > > | undefined
8
9
10
+ // bypass icon rules in ESLint
11
+ process . env . ESLINT ||= 'true'
12
+
9
13
async function _getGenerator ( ) {
10
14
const { config, sources } = await loadConfig ( )
11
15
if ( ! sources . length )
Original file line number Diff line number Diff line change @@ -2,7 +2,6 @@ import type { UniversalIconLoader } from '@iconify/utils'
2
2
import { loadIcon } from '@iconify/utils'
3
3
import { createCDNLoader } from './cdn'
4
4
import { combineLoaders , createPresetIcons } from './core'
5
- import { isNode , isVSCode } from './utils'
6
5
7
6
export * from './core'
8
7
@@ -25,7 +24,14 @@ export const presetIcons = createPresetIcons(async (options) => {
25
24
26
25
const loaders : UniversalIconLoader [ ] = [ ]
27
26
28
- if ( isNode && ! isVSCode ) {
27
+ // eslint-disable-next-line node/prefer-global/process
28
+ const isNode = typeof process !== 'undefined' && process . stdout && ! process . versions . deno
29
+ // eslint-disable-next-line node/prefer-global/process
30
+ const isVSCode = isNode && ! ! process . env . VSCODE_CWD
31
+ // eslint-disable-next-line node/prefer-global/process
32
+ const isESLint = isNode && ! ! process . env . ESLINT
33
+
34
+ if ( isNode && ! isVSCode && ! isESLint ) {
29
35
const nodeLoader = await createNodeLoader ( )
30
36
if ( nodeLoader !== undefined )
31
37
loaders . push ( nodeLoader )
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments