dprint-plugin-typescript icon indicating copy to clipboard operation
dprint-plugin-typescript copied to clipboard

Include schema.json with npm package

Open jgeurts opened this issue 3 years ago • 2 comments

Hi, I am working on an eslint plugin for dprint. Right now, I copy the schema manually to my package, but it would be great if it could come bundled with the @dprint/typescript npm package.

jgeurts avatar Jan 20 '22 14:01 jgeurts

@jgeurts what are you using the schema for? Also, what would a dprint eslint plugin do?

For some tools you can just provide the schema url, which is in the format:

https://plugins.dprint.dev/dprint/dprint-plugin-typescript/0.62.0/schema.json

You can get the version from the formatter by doing formatter.getPluginInfo().version, but actually I think you can just do formatter.getPluginInfo().configSchemaUrl to get the url.

dsherret avatar Jan 23 '22 20:01 dsherret

Hi @dsherret, I'm using the schema is used to describe options for the eslint rule. The goal with the eslint rule is to allow dprint to run as part of the eslint process. It would be a similar thing as the prettier eslint plugin.

Thanks for the heads up on the schema url! I'll give that a shot!

jgeurts avatar Jan 24 '22 15:01 jgeurts