From 939547366558d76e68ef305e26e7ff4fea704ba6 Mon Sep 17 00:00:00 2001 From: fisker Date: Wed, 1 Mar 2023 13:26:49 +0800 Subject: [PATCH 1/2] Allow import module (Fix `exports` field) --- packages/eslint-plugin-tslint/package.json | 4 ++-- packages/eslint-plugin/package.json | 6 +++--- packages/parser/package.json | 4 ++-- packages/scope-manager/package.json | 6 +++--- packages/type-utils/package.json | 4 ++-- packages/types/package.json | 4 ++-- packages/typescript-estree/package.json | 10 +++++----- packages/utils/package.json | 14 +++++++------- packages/visitor-keys/package.json | 6 +++--- packages/website-eslint/package.json | 2 +- 10 files changed, 30 insertions(+), 30 deletions(-) diff --git a/packages/eslint-plugin-tslint/package.json b/packages/eslint-plugin-tslint/package.json index ce8dba41af6..f72fdeffd34 100644 --- a/packages/eslint-plugin-tslint/package.json +++ b/packages/eslint-plugin-tslint/package.json @@ -12,10 +12,10 @@ "exports": { ".": { "types": "./dist/index.d.ts", - "require": "./dist/index.js" + "default": "./dist/index.js" }, "./package.json": { - "require": "./package.json" + "default": "./package.json" } }, "engines": { diff --git a/packages/eslint-plugin/package.json b/packages/eslint-plugin/package.json index e1a43fee587..c25eea8ec74 100644 --- a/packages/eslint-plugin/package.json +++ b/packages/eslint-plugin/package.json @@ -14,14 +14,14 @@ "exports": { ".": { "types": "./index.d.ts", - "require": "./dist/index.js" + "default": "./dist/index.js" }, "./package.json": { - "require": "./package.json" + "default": "./package.json" }, "./use-at-your-own-risk/rules": { "types": "./rules.d.ts", - "require": "./dist/rules/index.js" + "default": "./dist/rules/index.js" } }, "engines": { diff --git a/packages/parser/package.json b/packages/parser/package.json index 2b12f18893a..754b008fc4d 100644 --- a/packages/parser/package.json +++ b/packages/parser/package.json @@ -12,10 +12,10 @@ "exports": { ".": { "types": "./dist/index.d.ts", - "require": "./dist/index.js" + "default": "./dist/index.js" }, "./package.json": { - "require": "./package.json" + "default": "./package.json" } }, "engines": { diff --git a/packages/scope-manager/package.json b/packages/scope-manager/package.json index 98efa0e55ab..7da959c7f12 100644 --- a/packages/scope-manager/package.json +++ b/packages/scope-manager/package.json @@ -12,14 +12,14 @@ "exports": { ".": { "types": "./dist/index.d.ts", - "require": "./dist/index.js" + "default": "./dist/index.js" }, "./package.json": { - "require": "./package.json" + "default": "./package.json" }, "./use-at-your-own-risk/analyze": { "types": "./dist/analyze.d.ts", - "require": "./dist/analyze.js" + "default": "./dist/analyze.js" } }, "engines": { diff --git a/packages/type-utils/package.json b/packages/type-utils/package.json index f93aa96e8e6..db45e6229b9 100644 --- a/packages/type-utils/package.json +++ b/packages/type-utils/package.json @@ -13,10 +13,10 @@ "exports": { ".": { "types": "./dist/index.d.ts", - "require": "./dist/index.js" + "default": "./dist/index.js" }, "./package.json": { - "require": "./package.json" + "default": "./package.json" } }, "engines": { diff --git a/packages/types/package.json b/packages/types/package.json index a2d8c2c7d5a..d7c6f92e863 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -13,10 +13,10 @@ "exports": { ".": { "types": "./dist/index.d.ts", - "require": "./dist/index.js" + "default": "./dist/index.js" }, "./package.json": { - "require": "./package.json" + "default": "./package.json" } }, "engines": { diff --git a/packages/typescript-estree/package.json b/packages/typescript-estree/package.json index b5d956398af..955168d61eb 100644 --- a/packages/typescript-estree/package.json +++ b/packages/typescript-estree/package.json @@ -12,22 +12,22 @@ "exports": { ".": { "types": "./dist/index.d.ts", - "require": "./dist/index.js" + "default": "./dist/index.js" }, "./package.json": { - "require": "./package.json" + "default": "./package.json" }, "./use-at-your-own-risk/ast-converter": { "types": "./dist/ast-converter.d.ts", - "require": "./dist/ast-converter.js" + "default": "./dist/ast-converter.js" }, "./use-at-your-own-risk/parseSettings": { "types": "./dist/parseSettings/index.d.ts", - "require": "./dist/parseSettings/index.js" + "default": "./dist/parseSettings/index.js" }, "./use-at-your-own-risk/getScriptKind": { "types": "./dist/create-program/getScriptKind.d.ts", - "require": "./dist/create-program/getScriptKind.js" + "default": "./dist/create-program/getScriptKind.js" } }, "engines": { diff --git a/packages/utils/package.json b/packages/utils/package.json index 26d17d42629..779eeb06b79 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -13,30 +13,30 @@ "exports": { ".": { "types": "./dist/index.d.ts", - "require": "./dist/index.js" + "default": "./dist/index.js" }, "./ast-utils": { "types": "./dist/ast-utils/index.d.ts", - "require": "./dist/ast-utils/index.js" + "default": "./dist/ast-utils/index.js" }, "./eslint-utils": { "types": "./dist/eslint-utils/index.d.ts", - "require": "./dist/eslint-utils/index.js" + "default": "./dist/eslint-utils/index.js" }, "./eslint-utils/rule-tester": { "types": "./dist/eslint-utils/rule-tester/RuleTester.d.ts", - "require": "./dist/eslint-utils/rule-tester/RuleTester.js" + "default": "./dist/eslint-utils/rule-tester/RuleTester.js" }, "./json-schema": { "types": "./dist/json-schema.d.ts", - "require": "./dist/json-schema.js" + "default": "./dist/json-schema.js" }, "./ts-eslint": { "types": "./dist/ts-eslint/index.d.ts", - "require": "./dist/ts-eslint/index.js" + "default": "./dist/ts-eslint/index.js" }, "./package.json": { - "require": "./package.json" + "default": "./package.json" } }, "engines": { diff --git a/packages/visitor-keys/package.json b/packages/visitor-keys/package.json index d41b1a0fd46..5b3cc6c9b53 100644 --- a/packages/visitor-keys/package.json +++ b/packages/visitor-keys/package.json @@ -13,14 +13,14 @@ "exports": { ".": { "types": "./dist/index.d.ts", - "require": "./dist/index.js" + "default": "./dist/index.js" }, "./package.json": { - "require": "./package.json" + "default": "./package.json" }, "./use-at-your-own-risk/visitor-keys": { "types": "./dist/visitor-keys.d.ts", - "require": "./dist/visitor-keys.js" + "default": "./dist/visitor-keys.js" } }, "engines": { diff --git a/packages/website-eslint/package.json b/packages/website-eslint/package.json index 9678f8bf706..91ed920b1b9 100644 --- a/packages/website-eslint/package.json +++ b/packages/website-eslint/package.json @@ -10,7 +10,7 @@ "exports": { ".": { "types": "./dist/index.d.ts", - "require": "./dist/index.js" + "default": "./dist/index.js" } }, "engines": { From 675f07c1b05264c7403ac011e348eb107a7af8e7 Mon Sep 17 00:00:00 2001 From: fisker Date: Wed, 1 Mar 2023 13:29:27 +0800 Subject: [PATCH 2/2] Use string instead of object for `package.json` entry --- packages/eslint-plugin-tslint/package.json | 4 +--- packages/eslint-plugin/package.json | 4 +--- packages/parser/package.json | 4 +--- packages/scope-manager/package.json | 4 +--- packages/type-utils/package.json | 4 +--- packages/types/package.json | 4 +--- packages/typescript-estree/package.json | 4 +--- packages/utils/package.json | 4 +--- packages/visitor-keys/package.json | 4 +--- 9 files changed, 9 insertions(+), 27 deletions(-) diff --git a/packages/eslint-plugin-tslint/package.json b/packages/eslint-plugin-tslint/package.json index f72fdeffd34..841b4029433 100644 --- a/packages/eslint-plugin-tslint/package.json +++ b/packages/eslint-plugin-tslint/package.json @@ -14,9 +14,7 @@ "types": "./dist/index.d.ts", "default": "./dist/index.js" }, - "./package.json": { - "default": "./package.json" - } + "./package.json": "./package.json" }, "engines": { "node": "^14.18.0 || ^16.0.0 || >=18.0.0" diff --git a/packages/eslint-plugin/package.json b/packages/eslint-plugin/package.json index c25eea8ec74..b68d8f9788d 100644 --- a/packages/eslint-plugin/package.json +++ b/packages/eslint-plugin/package.json @@ -16,9 +16,7 @@ "types": "./index.d.ts", "default": "./dist/index.js" }, - "./package.json": { - "default": "./package.json" - }, + "./package.json": "./package.json", "./use-at-your-own-risk/rules": { "types": "./rules.d.ts", "default": "./dist/rules/index.js" diff --git a/packages/parser/package.json b/packages/parser/package.json index 754b008fc4d..91defeddfd0 100644 --- a/packages/parser/package.json +++ b/packages/parser/package.json @@ -14,9 +14,7 @@ "types": "./dist/index.d.ts", "default": "./dist/index.js" }, - "./package.json": { - "default": "./package.json" - } + "./package.json": "./package.json" }, "engines": { "node": "^14.18.0 || ^16.0.0 || >=18.0.0" diff --git a/packages/scope-manager/package.json b/packages/scope-manager/package.json index 7da959c7f12..cedd32dfcb4 100644 --- a/packages/scope-manager/package.json +++ b/packages/scope-manager/package.json @@ -14,9 +14,7 @@ "types": "./dist/index.d.ts", "default": "./dist/index.js" }, - "./package.json": { - "default": "./package.json" - }, + "./package.json": "./package.json", "./use-at-your-own-risk/analyze": { "types": "./dist/analyze.d.ts", "default": "./dist/analyze.js" diff --git a/packages/type-utils/package.json b/packages/type-utils/package.json index db45e6229b9..b30c1f59aff 100644 --- a/packages/type-utils/package.json +++ b/packages/type-utils/package.json @@ -15,9 +15,7 @@ "types": "./dist/index.d.ts", "default": "./dist/index.js" }, - "./package.json": { - "default": "./package.json" - } + "./package.json": "./package.json" }, "engines": { "node": "^14.18.0 || ^16.0.0 || >=18.0.0" diff --git a/packages/types/package.json b/packages/types/package.json index d7c6f92e863..15280db6f08 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -15,9 +15,7 @@ "types": "./dist/index.d.ts", "default": "./dist/index.js" }, - "./package.json": { - "default": "./package.json" - } + "./package.json": "./package.json" }, "engines": { "node": "^14.18.0 || ^16.0.0 || >=18.0.0" diff --git a/packages/typescript-estree/package.json b/packages/typescript-estree/package.json index 955168d61eb..116f4531e18 100644 --- a/packages/typescript-estree/package.json +++ b/packages/typescript-estree/package.json @@ -14,9 +14,7 @@ "types": "./dist/index.d.ts", "default": "./dist/index.js" }, - "./package.json": { - "default": "./package.json" - }, + "./package.json": "./package.json", "./use-at-your-own-risk/ast-converter": { "types": "./dist/ast-converter.d.ts", "default": "./dist/ast-converter.js" diff --git a/packages/utils/package.json b/packages/utils/package.json index 779eeb06b79..94a077bd9be 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -35,9 +35,7 @@ "types": "./dist/ts-eslint/index.d.ts", "default": "./dist/ts-eslint/index.js" }, - "./package.json": { - "default": "./package.json" - } + "./package.json": "./package.json" }, "engines": { "node": "^14.18.0 || ^16.0.0 || >=18.0.0" diff --git a/packages/visitor-keys/package.json b/packages/visitor-keys/package.json index 5b3cc6c9b53..c31388b73f8 100644 --- a/packages/visitor-keys/package.json +++ b/packages/visitor-keys/package.json @@ -15,9 +15,7 @@ "types": "./dist/index.d.ts", "default": "./dist/index.js" }, - "./package.json": { - "default": "./package.json" - }, + "./package.json": "./package.json", "./use-at-your-own-risk/visitor-keys": { "types": "./dist/visitor-keys.d.ts", "default": "./dist/visitor-keys.js"