UNPKG

postcss-d-ts

Version:

PostCSS plugin to generate `.d.ts` of all used CSS classes and ids in imported stylesheets

98 lines (97 loc) 3.28 kB
{ "$schema": "http://json-schema.org/draft-07/schema", "$id": "https://askirmas.github.io/postcss-d-ts/schema.json", "additionalProperties": false, "properties": { "$schema": { "default": "./node_modules/postcss-d-ts/dist/schema.json", "examples": [ "https://askirmas.github.io/postcss-d-ts/schema.json" ] }, "template": { "title": "Local path to a custom template for declarations generating", "$comment": "_css-template.d.ts", "type": "string", "format": "uri-reference", "default": false, "examples": [ "./_css-template.d.ts" ] }, "checkMode": { "title": "Throw an error instead of file rewrite. By default, this mode is on for `NODE_ENV === 'production'`", "type": ["boolean", "null"], "default": null, "examples": [ false ] }, "identifierKeyword": { "title": "The word in `d.ts` template to be replaced with CSS classes, ids, etc", "type": "string", "default": "__identifier__" }, "allowedAtRules": { "description": "https://developer.mozilla.org/en-US/docs/Web/CSS/At-rule", "type": "array", "uniqueItems": true, "items": { "type": "string" }, "default": [ "media", "supports" ] }, "identifierPattern": { "title": "Regex to take CSS identifiers", "description": "https://www.w3.org/TR/CSS21/syndata.html#value-def-identifier", "$comment": "//TODO consider postcss-selector-parser", "default": "[#\\.]((\\\\3\\d)?([\\w\\d-]+|(\\\\[.#:$@*\\/'\"(){}[\\]])+)+)", "type": "string", "format": "regex", "examples": [ "\\.([\\w\\d-]+)" ] }, "identifierMatchIndex": { "type": "integer", "default": 1 }, "identifierCleanupPattern": { "type": "string", "format": "regex", "default": "\\\\3?(.)" }, "identifierCleanupReplace": { "type": "string", "default": "$1" }, "eol": { "default": "\n", "type": "string" }, "destination": { "title": "Used for debugging", "$comment": "//TODO `string` means to collect all to that file, `FALSY` - nearby each file", "oneOf": [ { "description": "Declaration next to source file", "const": false }, { "description": "Write to this object rather than filesystem", "const": {} } ], "default": false, "examples": [ { "file/path": ["xxx"] } ] } }, "title": "postcss-d-ts", "signature": ["/** Generated by [postcss-d-ts](https://github.com/askirmas/postcss-d-ts) */"], "templateEol": "\n" }