From 1dba010ea93ec95a65a3bf8555043007a1ccee66 Mon Sep 17 00:00:00 2001 From: David Anson Date: Tue, 5 Jul 2022 14:33:31 -0700 Subject: [PATCH] Add "exports" to package.json, use it to limit what's exported, leave "main" for compatability. --- helpers/package.json | 3 ++- package.json | 8 ++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/helpers/package.json b/helpers/package.json index 9ca32ba96..24755b85f 100644 --- a/helpers/package.json +++ b/helpers/package.json @@ -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", diff --git a/package.json b/package.json index 6d1f9478c..c8a083499 100644 --- a/package.json +++ b/package.json @@ -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",