diff --git a/.changeset/tasty-stingrays-add.md b/.changeset/tasty-stingrays-add.md new file mode 100644 index 000000000..2f2c3da67 --- /dev/null +++ b/.changeset/tasty-stingrays-add.md @@ -0,0 +1,5 @@ +--- +"@rnx-kit/eslint-plugin": patch +--- + +Cache access to `NODE_ENV` diff --git a/packages/eslint-plugin/src/rules/no-export-all.js b/packages/eslint-plugin/src/rules/no-export-all.js index d1b7b16b7..147c826d8 100644 --- a/packages/eslint-plugin/src/rules/no-export-all.js +++ b/packages/eslint-plugin/src/rules/no-export-all.js @@ -41,6 +41,8 @@ const DEFAULT_CONFIG = { eslintScopeManager: true, }; +const NODE_ENV = process.env.NODE_ENV; + /** * Returns whether there are any named exports. * @param {NamedExports?} namedExports @@ -93,7 +95,7 @@ const resolveFrom = /** @type {() => (fromDir: string, moduleId: string) => string} */ ( () => { - if (process.env.NODE_ENV === "test") { + if (NODE_ENV === "test") { return (_, moduleId) => moduleId; }