Skip to content

Commit d3aa478

Browse files
Chamionljharb
authored andcommitted
[Tests] no-unused-modules: document error reported on entire export statement
1 parent 3e1dd0b commit d3aa478

File tree

1 file changed

+30
-16
lines changed

1 file changed

+30
-16
lines changed

tests/src/rules/no-unused-modules.js

Lines changed: 30 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -164,24 +164,38 @@ ruleTester.run('no-unused-modules', rule, {
164164
invalid: [
165165
test({
166166
options: unusedExportsOptions,
167-
code: `import eslint from 'eslint'
168-
import fileA from './file-a'
169-
import { b } from './file-b'
170-
import { c1, c2 } from './file-c'
171-
import { d } from './file-d'
172-
import { e } from './file-e'
173-
import { e2 } from './file-e'
174-
import { h2 } from './file-h'
175-
import * as l from './file-l'
176-
export * from './file-n'
177-
export { default, o0, o3 } from './file-o'
178-
export { p } from './file-p'
179-
import s from './file-s'`,
167+
code: `
168+
import eslint from 'eslint'
169+
import fileA from './file-a'
170+
import { b } from './file-b'
171+
import { c1, c2 } from './file-c'
172+
import { d } from './file-d'
173+
import { e } from './file-e'
174+
import { e2 } from './file-e'
175+
import { h2 } from './file-h'
176+
import * as l from './file-l'
177+
export * from './file-n'
178+
export { default, o0, o3 } from './file-o'
179+
export { p } from './file-p'
180+
import s from './file-s'
181+
`,
180182
filename: testFilePath('./no-unused-modules/file-0.js'),
181183
errors: [
182-
error(`exported declaration 'default' not used within other modules`),
183-
error(`exported declaration 'o0' not used within other modules`),
184-
error(`exported declaration 'o3' not used within other modules`),
184+
{
185+
message: `exported declaration 'default' not used within other modules`,
186+
line: 12,
187+
column: 9,
188+
},
189+
{
190+
message: `exported declaration 'o0' not used within other modules`,
191+
line: 12,
192+
column: 9,
193+
},
194+
{
195+
message: `exported declaration 'o3' not used within other modules`,
196+
line: 12,
197+
column: 9,
198+
},
185199
error(`exported declaration 'p' not used within other modules`),
186200
],
187201
}),

0 commit comments

Comments
 (0)