Eslint-plugin-import: false positive with no-unused-module and export syntax

Created on 20 Nov 2019  路  1Comment  路  Source: benmosher/eslint-plugin-import

It seems that the rule no-unused-module is returning false positive result with export { default } from '...' syntax (which is a valid syntax given MDN documentation).

Example:
Given I have 3 files:

_./myModule1/data.js_

const getData = () => {
  // awesome things
}

export default getData;

_./myModule1/index.js_

export { default } from './data';

_./myModule2.js_

import getData from './myModule1';

Then I get this error:

/home/myName/myAwesomeProject/myModule1/index.js
  1:1  error  exported declaration 'default' not used within other modules  import/no-unused-modules

Expect behaviour is there should be no error.

bug help wanted

Most helpful comment

This seems to have been fixed by @richardxia in #1640 which was released in v2.20.2.

Hopefully that helps and this issue can be closed! 馃槃

>All comments

This seems to have been fixed by @richardxia in #1640 which was released in v2.20.2.

Hopefully that helps and this issue can be closed! 馃槃

Was this page helpful?
0 / 5 - 0 ratings