From c2b8e32d8cc443c87847d564676757b285246d8f Mon Sep 17 00:00:00 2001 From: Simen Bekkhus Date: Tue, 12 Oct 2021 00:35:12 +0200 Subject: [PATCH 1/7] fix: add `universal` export to root --- universal.js | 1 + 1 file changed, 1 insertion(+) create mode 100644 universal.js diff --git a/universal.js b/universal.js new file mode 100644 index 00000000..11812cf3 --- /dev/null +++ b/universal.js @@ -0,0 +1 @@ +module.exports = require("./dist/eslintrc-universal.cjs"); From 2caa874215cf41a93acb69138122dfc6bb3ee3ba Mon Sep 17 00:00:00 2001 From: Simen Bekkhus Date: Tue, 12 Oct 2021 00:36:01 +0200 Subject: [PATCH 2/7] Update package.json --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index 593e8aeb..a60d7a29 100644 --- a/package.json +++ b/package.json @@ -20,6 +20,7 @@ "conf", "LICENSE", "dist" + "universal.js" ], "publishConfig": { "access": "public" From 705c1273f256ce1a61bd592ca3bd445449597677 Mon Sep 17 00:00:00 2001 From: Simen Bekkhus Date: Tue, 12 Oct 2021 07:39:22 +0200 Subject: [PATCH 3/7] Update package.json --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index a60d7a29..4fe29061 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,7 @@ "lib", "conf", "LICENSE", - "dist" + "dist", "universal.js" ], "publishConfig": { From 50327585c0048c50999de4dc2f5a2c23dc06e0fd Mon Sep 17 00:00:00 2001 From: Simen Bekkhus Date: Tue, 12 Oct 2021 07:53:15 +0200 Subject: [PATCH 4/7] Update universal.js --- universal.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/universal.js b/universal.js index 11812cf3..c26ad3f7 100644 --- a/universal.js +++ b/universal.js @@ -1 +1,8 @@ +// Jest (and probably other some other runtimes with custom implementations of +// `require`) doesn't support `exports` in package.json, so this file lets is +// here to help them load this module. Note that it is also `.js` and not `.cjs` +// for the same reason - Jest does not resolve `.cjs` files by default (if +// `require`d without an extension) and doesn't respect `module` outside of +// ESM mode. + module.exports = require("./dist/eslintrc-universal.cjs"); From 85c0f32333e9ea709e6221e5fc8dbe70098de2e9 Mon Sep 17 00:00:00 2001 From: Simen Bekkhus Date: Tue, 12 Oct 2021 08:01:22 +0200 Subject: [PATCH 5/7] Update universal.js --- universal.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/universal.js b/universal.js index c26ad3f7..2cf41772 100644 --- a/universal.js +++ b/universal.js @@ -1,8 +1,8 @@ // Jest (and probably other some other runtimes with custom implementations of // `require`) doesn't support `exports` in package.json, so this file lets is // here to help them load this module. Note that it is also `.js` and not `.cjs` -// for the same reason - Jest does not resolve `.cjs` files by default (if -// `require`d without an extension) and doesn't respect `module` outside of -// ESM mode. +// for the same reason - `cjs` files requires to loaded with an extension, but +// since and doesn't respect `module` outside of ESM mode it still works in +// this case (and the `require` in _this_ file does specify the extension). module.exports = require("./dist/eslintrc-universal.cjs"); From ca3d57f78372b5d99c0ca5c6ae9982b1f28c8dfb Mon Sep 17 00:00:00 2001 From: Simen Bekkhus Date: Tue, 12 Oct 2021 09:29:32 +0200 Subject: [PATCH 6/7] Update universal.js MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: 唯然 --- universal.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/universal.js b/universal.js index 2cf41772..a8fb423a 100644 --- a/universal.js +++ b/universal.js @@ -4,5 +4,5 @@ // for the same reason - `cjs` files requires to loaded with an extension, but // since and doesn't respect `module` outside of ESM mode it still works in // this case (and the `require` in _this_ file does specify the extension). - +// eslint-disable-next-line no-undef module.exports = require("./dist/eslintrc-universal.cjs"); From d61efb6405ad3a613ed6afbe0912ca9e3153b0ce Mon Sep 17 00:00:00 2001 From: Simen Bekkhus Date: Tue, 12 Oct 2021 09:35:45 +0200 Subject: [PATCH 7/7] typos --- universal.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/universal.js b/universal.js index a8fb423a..4e1846ee 100644 --- a/universal.js +++ b/universal.js @@ -1,8 +1,9 @@ -// Jest (and probably other some other runtimes with custom implementations of -// `require`) doesn't support `exports` in package.json, so this file lets is -// here to help them load this module. Note that it is also `.js` and not `.cjs` -// for the same reason - `cjs` files requires to loaded with an extension, but -// since and doesn't respect `module` outside of ESM mode it still works in +// Jest (and probably some other runtimes with custom implementations of +// `require`) doesn't support `exports` in `package.json`, so this file is here +// to help them load this module. Note that it is also `.js` and not `.cjs` for +// the same reason - `cjs` files requires to be loaded with an extension, but +// since Jest doesn't respect `module` outside of ESM mode it still works in // this case (and the `require` in _this_ file does specify the extension). + // eslint-disable-next-line no-undef module.exports = require("./dist/eslintrc-universal.cjs");