Skip to content

Commit

Permalink
[Tests] extensions: add cases to verify @/configs/chart is treate…
Browse files Browse the repository at this point in the history
…d as a package

See #1851.
  • Loading branch information
wenfangdu authored and ljharb committed Oct 14, 2020
1 parent 4c92c47 commit 1031e1c
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions tests/src/rules/extensions.js
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,7 @@ ruleTester.run('extensions', rule, {
import Component from './Component'
import baz from 'foo/baz'
import baw from '@scoped/baw/import'
import chart from '@/configs/chart'
import express from 'express'
`,
options: [ 'always', { ignorePackages: true } ],
Expand All @@ -358,6 +359,7 @@ ruleTester.run('extensions', rule, {
import Component from './Component'
import baz from 'foo/baz'
import baw from '@scoped/baw/import'
import chart from '@/configs/chart'
import express from 'express'
`,
options: [ 'ignorePackages' ],
Expand Down Expand Up @@ -503,12 +505,19 @@ ruleTester.run('extensions', rule, {
],
}),
test({
code: 'import foo from "@/ImNotAScopedModule"',
code: `
import foo from "@/ImNotAScopedModule";
import chart from '@/configs/chart';
`,
options: ['always'],
errors: [
{
message: 'Missing file extension for "@/ImNotAScopedModule"',
line: 1,
line: 2,
},
{
message: 'Missing file extension for "@/configs/chart"',
line: 3,
},
],
}),
Expand Down

0 comments on commit 1031e1c

Please sign in to comment.