Skip to content

Commit 6be49b3

Browse files
committed
fix: update no-dom-import rule to report the right module name
1 parent f634bfd commit 6be49b3

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

lib/rules/no-dom-import.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,10 @@ export default createTestingLibraryRule<Options, MessageIds>({
4747
moduleName: string
4848
) {
4949
if (framework) {
50-
const correctModuleName = moduleName.replace('dom', framework);
50+
const correctModuleName =
51+
framework === 'marko'
52+
? '@marko/testing-library'
53+
: moduleName.replace('dom', framework);
5154
context.report({
5255
node,
5356
messageId: 'noDomImportFramework',

tests/lib/rules/no-dom-import.test.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -74,11 +74,11 @@ ruleTester.run(RULE_NAME, rule, {
7474
{
7575
messageId: 'noDomImportFramework',
7676
data: {
77-
module: 'marko-testing-library',
77+
module: '@marko/testing-library',
7878
},
7979
},
8080
],
81-
output: `import { fireEvent } from "marko-testing-library"`,
81+
output: `import { fireEvent } from "@marko/testing-library"`,
8282
},
8383
// Single quote or double quotes should not be replaced
8484
{

0 commit comments

Comments
 (0)