From eb67bec958f5319fa425b528fbda0e6e812773ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dawid=20Ma=C5=82ecki?= Date: Tue, 15 Apr 2025 02:39:48 -0700 Subject: [PATCH] Use sum of subpaths instead of path.join in `no-deep-imports` lint rule (#50718) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/50718 On Windows `path.join` returns path with separators unsupported by resolution mechanism. This change enforces the use of `/` separators in `no-deep-imports` rule tests. Changelog: [Internal] Reviewed By: robhogan Differential Revision: D73021185 fbshipit-source-id: d4799c01a5aef5b27fad961d774b58627115d213 --- .../__tests__/no-deep-imports-test.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/eslint-plugin-react-native/__tests__/no-deep-imports-test.js b/packages/eslint-plugin-react-native/__tests__/no-deep-imports-test.js index 6c473f8d746..02b45228723 100644 --- a/packages/eslint-plugin-react-native/__tests__/no-deep-imports-test.js +++ b/packages/eslint-plugin-react-native/__tests__/no-deep-imports-test.js @@ -13,13 +13,12 @@ const rule = require('../no-deep-imports.js'); const {publicAPIMapping} = require('../utils.js'); const ESLintTester = require('./eslint-tester.js'); -const path = require('path'); const eslintTester = new ESLintTester(); test('resolve all public API paths', () => { for (const subpath of Object.keys(publicAPIMapping)) { - require.resolve(path.join('react-native', subpath)); + require.resolve('react-native/' + subpath); } });