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
This commit is contained in:
Dawid Małecki
2025-04-15 02:39:48 -07:00
committed by Facebook GitHub Bot
parent 55de31fe1b
commit eb67bec958
@@ -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);
}
});