postcss-load-config icon indicating copy to clipboard operation
postcss-load-config copied to clipboard

Typescript definition for `Map` Property is Incorrect

Open jrwiegand opened this issue 1 year ago • 2 comments

Details

The Map option is defined in the README and the index.d.ts as only accepting string | false.

However, there is an option for an object as defined in the postcss.d.ts.

Can the postcss-load-config definition file be updated to reflect the definition from the postcss file?

Error (Logs|Stacks)

Linting errors from the editor (VSCode).

Type '{ inline: false; annotation: true; sourcesContent: true; }' is not assignable to type 'string | false | undefined'.

Reproduction (Code)

Create a postcss.config.ts file.

import { Config } from "postcss-load-config";

const config: Config = {
    map: {
        inline: false,
        annotation: true,
        sourcesContent: true,
    },
    plugins: [require("autoprefixer")],
};

export default config;
$ git clone https://github.com/<user>/<sample>

Environment

OS node npm/yarn package
macOS Sonoma 14.6.1 v20.18.1 npm 10.9.1 [email protected]

jrwiegand avatar Nov 27 '24 17:11 jrwiegand

Can you send PR?

ai avatar Nov 27 '24 17:11 ai

I can do that, yes. I will try to have something in by the beginning of next week.

jrwiegand avatar Nov 28 '24 17:11 jrwiegand