fix: tsc errors and rest of the tests

Signed-off-by: Hellgren Heikki <heikki.hellgren@op.fi>
This commit is contained in:
Hellgren Heikki
2025-06-13 08:23:29 +03:00
parent 063b2d39ce
commit 2788a08dad
4 changed files with 77 additions and 67 deletions
@@ -24,6 +24,7 @@ jest.mock('child_process', () => ({
const RULE = 'no-undeclared-imports';
const FIXTURE = joinPath(__dirname, '__fixtures__/monorepo');
//
const ERR_UNDECLARED = (
name: string,
@@ -246,26 +247,14 @@ ruleTester.run(RULE, rule, {
},
{
code: `import 'react-dom'`,
output: `import 'directive:add-import:dependencies:react-dom'`,
output: `import 'directive:add-import:peerDependencies:react-dom'`,
filename: joinPath(FIXTURE, 'packages/foo/src/index.ts'),
errors: [
ERR_UNDECLARED(
'react-dom',
'dependencies',
'peerDependencies',
joinPath('packages', 'foo'),
),
],
},
{
code: `import 'react-dom'`,
output: `import 'directive:add-import:devDependencies:react-dom'`,
filename: joinPath(FIXTURE, 'packages/foo/src/index.test.ts'),
errors: [
ERR_UNDECLARED(
'react-dom',
'devDependencies',
joinPath('packages', 'foo'),
'--dev',
'--peer',
),
],
},