MCPcopy
hub / github.com/jestjs/jest / getPackages

Function getPackages

eslint.config.mjs:28–39  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

26import eslintPluginLocal from './.eslintplugin/index.mjs';
27
28function getPackages() {
29 const PACKAGES_DIR = path.resolve(import.meta.dirname, 'packages');
30 const packages = fs
31 .readdirSync(PACKAGES_DIR)
32 .map(file => path.resolve(PACKAGES_DIR, file))
33 .filter(f => fs.lstatSync(path.resolve(f)).isDirectory())
34 .filter(f => fs.existsSync(path.join(path.resolve(f), 'package.json')));
35 return packages.map(packageDir => {
36 const pkg = readPkg({cwd: packageDir});
37 return pkg.name;
38 });
39}
40
41const config = defineConfig(
42 eslintJs.configs.recommended,

Callers 1

eslint.config.mjsFile · 0.70

Calls 2

readPkgFunction · 0.85
resolveMethod · 0.45

Tested by

no test coverage detected