omgovich / colord

👑 A tiny yet powerful tool for high-performance color manipulations and conversions
https://colord.omgovich.ru
MIT License
1.7k stars 51 forks source link

extend gives error with Vite/Typescript/eslint #129

Open Dylan190774 opened 2 months ago

Dylan190774 commented 2 months ago

I'm using Vue3 with Vite and Typescript, and I'm trying to use a plugin, but the example code gives an error:

import { colord } from 'colord';
import a11yPlugin from 'colord/plugins/a11y';
extend([a11yPlugin]);

[vue-tsc] Cannot find name 'extend'.

I can't seem to find any information about the keyword 'extend' so I'm at a loss here. Maybe installing a plugin with something like colord.use(a11yPlugin) would be a nice solution?

Dylan190774 commented 2 months ago

I'm sorry, found the answer. Just needed to import extendas well :)

import { colord, extend } from 'colord';
import a11yPlugin from 'colord/plugins/a11y';
extend([a11yPlugin]);