Add "exports" to package.json, use it to limit what's exported, leave "main" for compatability.

This commit is contained in:
David Anson 2022-07-05 14:33:31 -07:00
parent 51cec76c2b
commit 1dba010ea9
2 changed files with 8 additions and 3 deletions

View file

@ -2,7 +2,8 @@
"name": "markdownlint-rule-helpers",
"version": "0.17.0",
"description": "A collection of markdownlint helper functions for custom rules",
"main": "helpers.js",
"main": "./helpers.js",
"exports": "./helpers.js",
"author": "David Anson (https://dlaa.me/)",
"license": "MIT",
"homepage": "https://github.com/DavidAnson/markdownlint",

View file

@ -3,8 +3,12 @@
"version": "0.26.0",
"description": "A Node.js style checker and lint tool for Markdown/CommonMark files.",
"type": "commonjs",
"main": "lib/markdownlint.js",
"types": "lib/markdownlint.d.ts",
"main": "./lib/markdownlint.js",
"exports": {
".": "./lib/markdownlint.js",
"./helpers": "./helpers/helpers.js"
},
"types": "./lib/markdownlint.d.ts",
"author": "David Anson (https://dlaa.me/)",
"license": "MIT",
"homepage": "https://github.com/DavidAnson/markdownlint",