Skip to content

Commit

Permalink
[Tests] no-unused-modules: document error reported on entire `expor…
Browse files Browse the repository at this point in the history
…t` statement
  • Loading branch information
Chamion authored and ljharb committed Jul 26, 2023
1 parent 3e1dd0b commit d3aa478
Showing 1 changed file with 30 additions and 16 deletions.
46 changes: 30 additions & 16 deletions tests/src/rules/no-unused-modules.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,24 +164,38 @@ ruleTester.run('no-unused-modules', rule, {
invalid: [
test({
options: unusedExportsOptions,
code: `import eslint from 'eslint'
import fileA from './file-a'
import { b } from './file-b'
import { c1, c2 } from './file-c'
import { d } from './file-d'
import { e } from './file-e'
import { e2 } from './file-e'
import { h2 } from './file-h'
import * as l from './file-l'
export * from './file-n'
export { default, o0, o3 } from './file-o'
export { p } from './file-p'
import s from './file-s'`,
code: `
import eslint from 'eslint'
import fileA from './file-a'
import { b } from './file-b'
import { c1, c2 } from './file-c'
import { d } from './file-d'
import { e } from './file-e'
import { e2 } from './file-e'
import { h2 } from './file-h'
import * as l from './file-l'
export * from './file-n'
export { default, o0, o3 } from './file-o'
export { p } from './file-p'
import s from './file-s'
`,
filename: testFilePath('./no-unused-modules/file-0.js'),
errors: [
error(`exported declaration 'default' not used within other modules`),
error(`exported declaration 'o0' not used within other modules`),
error(`exported declaration 'o3' not used within other modules`),
{
message: `exported declaration 'default' not used within other modules`,
line: 12,
column: 9,
},
{
message: `exported declaration 'o0' not used within other modules`,
line: 12,
column: 9,
},
{
message: `exported declaration 'o3' not used within other modules`,
line: 12,
column: 9,
},
error(`exported declaration 'p' not used within other modules`),
],
}),
Expand Down

0 comments on commit d3aa478

Please sign in to comment.