Skip to content

Commit 1031e1c

Browse files
wenfangduljharb
authored andcommitted
[Tests] extensions: add cases to verify @/configs/chart is treated as a package
See #1851.
1 parent 4c92c47 commit 1031e1c

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

tests/src/rules/extensions.js

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,7 @@ ruleTester.run('extensions', rule, {
339339
import Component from './Component'
340340
import baz from 'foo/baz'
341341
import baw from '@scoped/baw/import'
342+
import chart from '@/configs/chart'
342343
import express from 'express'
343344
`,
344345
options: [ 'always', { ignorePackages: true } ],
@@ -358,6 +359,7 @@ ruleTester.run('extensions', rule, {
358359
import Component from './Component'
359360
import baz from 'foo/baz'
360361
import baw from '@scoped/baw/import'
362+
import chart from '@/configs/chart'
361363
import express from 'express'
362364
`,
363365
options: [ 'ignorePackages' ],
@@ -503,12 +505,19 @@ ruleTester.run('extensions', rule, {
503505
],
504506
}),
505507
test({
506-
code: 'import foo from "@/ImNotAScopedModule"',
508+
code: `
509+
import foo from "@/ImNotAScopedModule";
510+
import chart from '@/configs/chart';
511+
`,
507512
options: ['always'],
508513
errors: [
509514
{
510515
message: 'Missing file extension for "@/ImNotAScopedModule"',
511-
line: 1,
516+
line: 2,
517+
},
518+
{
519+
message: 'Missing file extension for "@/configs/chart"',
520+
line: 3,
512521
},
513522
],
514523
}),

0 commit comments

Comments
 (0)