diff --git a/src/@types/css-tree.d.ts b/src/@types/css-tree.d.ts new file mode 100644 index 0000000..c3a8bde --- /dev/null +++ b/src/@types/css-tree.d.ts @@ -0,0 +1,19 @@ +declare module 'css-tree/walker' { + import { walk } from 'css-tree'; + + export default walk; +} +declare module 'css-tree/utils' { + export { clone, List } from 'css-tree'; +} + +declare module 'css-tree/generator' { + import { generate } from 'css-tree'; + + export default generate; +} +declare module 'css-tree/parser' { + import { parse } from 'css-tree'; + + export default parse; +} diff --git a/src/cascade.ts b/src/cascade.ts index f58220f..9477c4d 100644 --- a/src/cascade.ts +++ b/src/cascade.ts @@ -1,4 +1,4 @@ -import { type Block, type CssNode, } from 'css-tree'; +import { type Block, type CssNode } from 'css-tree'; import walk from 'css-tree/walker'; import { diff --git a/src/fallback.ts b/src/fallback.ts index f2ebcbe..563645e 100644 --- a/src/fallback.ts +++ b/src/fallback.ts @@ -9,8 +9,8 @@ import { type SelectorList, type Value, } from 'css-tree'; +import { clone, List } from 'css-tree/utils'; import walk from 'css-tree/walker'; -import {clone, List} from 'css-tree/utils'; import { nanoid } from 'nanoid/non-secure'; import { getCSSPropertyValue } from './dom.js'; diff --git a/src/utils.ts b/src/utils.ts index fa3aad0..150ea9b 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -8,9 +8,9 @@ import { type SelectorList, type Value, } from 'css-tree'; -import {clone} from 'css-tree/utils'; -import parse from 'css-tree/parser'; import generate from 'css-tree/generator'; +import parse from 'css-tree/parser'; +import { clone } from 'css-tree/utils'; import { nanoid } from 'nanoid/non-secure'; import type { Selector } from './dom.js'; @@ -18,7 +18,7 @@ import type { Selector } from './dom.js'; export const INSTANCE_UUID = nanoid(); // https://github.com/import-js/eslint-plugin-import/issues/3019 - + export interface DeclarationWithValue extends Declaration { value: Value; }