Convert dlv require statements to imports (#521)
It was already imported in one place, that appears to work fine. Using `require` results in invalid ESM output, because `require` is not defined in ES modules.master
parent
7dd5646e6f
commit
bc2e5edd45
|
@ -7,7 +7,7 @@ import { getClassNameMeta } from '../util/getClassNameMeta'
|
|||
import { getClassNameParts } from '../util/getClassNameAtPosition'
|
||||
import { validateApply } from '../util/validateApply'
|
||||
import { isWithinRange } from '../util/isWithinRange'
|
||||
const dlv = require('dlv')
|
||||
import dlv from 'dlv'
|
||||
import type { Root, Source } from 'postcss'
|
||||
import { absoluteRange } from '../util/absoluteRange'
|
||||
import { removeRangesFromString } from '../util/removeRangesFromString'
|
||||
|
|
|
@ -9,7 +9,7 @@ import type {
|
|||
Position,
|
||||
CompletionContext,
|
||||
} from 'vscode-languageserver'
|
||||
const dlv = require('dlv')
|
||||
import dlv from 'dlv'
|
||||
import removeMeta from './util/removeMeta'
|
||||
import { getColor, getColorFromValue } from './util/color'
|
||||
import { isHtmlContext } from './util/html'
|
||||
|
|
|
@ -9,7 +9,7 @@ import isObject from '../util/isObject'
|
|||
import { closest } from '../util/closest'
|
||||
import { absoluteRange } from '../util/absoluteRange'
|
||||
import { combinations } from '../util/combinations'
|
||||
const dlv = require('dlv')
|
||||
import dlv from 'dlv'
|
||||
|
||||
function pathToString(path: string | string[]): string {
|
||||
if (typeof path === 'string') return path
|
||||
|
|
|
@ -6,7 +6,7 @@ import { getLanguageBoundaries } from '../util/getLanguageBoundaries'
|
|||
import { findAll, indexToPosition } from '../util/find'
|
||||
import { closest } from '../util/closest'
|
||||
import { absoluteRange } from '../util/absoluteRange'
|
||||
const dlv = require('dlv')
|
||||
import dlv from 'dlv'
|
||||
|
||||
export function getInvalidScreenDiagnostics(
|
||||
state: State,
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { State } from './util/state'
|
||||
import type { Hover, TextDocument, Position } from 'vscode-languageserver'
|
||||
import { stringifyCss, stringifyConfigValue } from './util/stringify'
|
||||
const dlv = require('dlv')
|
||||
import dlv from 'dlv'
|
||||
import { isCssContext } from './util/css'
|
||||
import { findClassNameAtPosition } from './util/find'
|
||||
import { validateApply } from './util/validateApply'
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
const dlv = require('dlv')
|
||||
import dlv from 'dlv'
|
||||
import { State } from './state'
|
||||
import removeMeta from './removeMeta'
|
||||
import { ensureArray, dedupe, flatten } from './array'
|
||||
|
|
|
@ -9,7 +9,7 @@ import { flatten } from './array'
|
|||
import { getClassAttributeLexer, getComputedClassAttributeLexer } from './lexers'
|
||||
import { getLanguageBoundaries } from './getLanguageBoundaries'
|
||||
import { resolveRange } from './resolveRange'
|
||||
const dlv = require('dlv')
|
||||
import dlv from 'dlv'
|
||||
import { createMultiRegexp } from './createMultiRegexp'
|
||||
|
||||
export function findAll(re: RegExp, str: string): RegExpMatchArray[] {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { State } from './state'
|
||||
const dlv = require('dlv')
|
||||
import dlv from 'dlv'
|
||||
|
||||
export function flagEnabled(state: State, flag: string) {
|
||||
if (state.featureFlags.future.includes(flag)) {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { State } from './state'
|
||||
import { combinations } from './combinations'
|
||||
const dlv = require('dlv')
|
||||
import dlv from 'dlv'
|
||||
|
||||
export function getClassNameParts(state: State, className: string): string[] {
|
||||
let separator = state.separator
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { State } from './state'
|
||||
import { getClassNameParts } from './getClassNameAtPosition'
|
||||
import removeMeta from './removeMeta'
|
||||
const dlv = require('dlv')
|
||||
import dlv from 'dlv'
|
||||
|
||||
export function getClassNameDecls(
|
||||
state: State,
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { State, ClassNameMeta } from './state'
|
||||
import { getClassNameParts } from './getClassNameAtPosition'
|
||||
const dlv = require('dlv')
|
||||
import dlv from 'dlv'
|
||||
|
||||
export function getClassNameMeta(
|
||||
state: State,
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import removeMeta from './removeMeta'
|
||||
const dlv = require('dlv')
|
||||
import dlv from 'dlv'
|
||||
import escapeClassName from 'css.escape'
|
||||
import { ensureArray } from './array'
|
||||
import { remToPx } from './remToPx'
|
||||
|
|
Loading…
Reference in New Issue