From d3aa4780e349a8af6466f13524c258544dac3d36 Mon Sep 17 00:00:00 2001 From: Jemi Salo Date: Wed, 26 Jul 2023 16:37:16 +0300 Subject: [PATCH] [Tests] `no-unused-modules`: document error reported on entire `export` statement --- tests/src/rules/no-unused-modules.js | 46 ++++++++++++++++++---------- 1 file changed, 30 insertions(+), 16 deletions(-) diff --git a/tests/src/rules/no-unused-modules.js b/tests/src/rules/no-unused-modules.js index 219d996b3..80f0fee73 100644 --- a/tests/src/rules/no-unused-modules.js +++ b/tests/src/rules/no-unused-modules.js @@ -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`), ], }),