Skip to content

Commit

Permalink
fix(lint): Readd npmScope to import paths
Browse files Browse the repository at this point in the history
  • Loading branch information
krzotki committed Nov 17, 2024
1 parent 5c24500 commit 5055aa8
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,15 @@ import {
import { Linter } from '@nx/linter';
import { libraryGenerator } from '@nx/react';
import { GeneLibraryGenerator } from './schema';
import { updateJestConfig } from '../utilities';
import { getNpmScope, updateJestConfig } from '../utilities';
import { relative } from 'path';

export default async function (tree: Tree, schema: GeneLibraryGenerator) {
const currentPackageJson = readJson(tree, 'package.json');
const npmScope = getNpmScope(tree);

const directory = schema.directory ? `${schema.directory}/` : '';

await libraryGenerator(tree, {
name: schema.name,
directory: schema.directory,
Expand All @@ -25,6 +29,7 @@ export default async function (tree: Tree, schema: GeneLibraryGenerator) {
style: 'scss',
compiler: 'babel',
unitTestRunner: 'jest',
importPath: `@${npmScope}/${directory}${schema.name}`,
});

const pathToProject = `libs/${schema.directory || ''}/${schema.name}`;
Expand Down

0 comments on commit 5055aa8

Please sign in to comment.