question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

eslint-plugin-import error

See original GitHub issue

Summary

Version react-native-device-info@0.21.5
Affected OS NA
OS Version NA

Current behavior

eslint-plugin-import@2.11.0 detects an error when importing the module import DeviceInfo from 'react-native-device-info';

Expected behavior

No error

Why

I think that eslint-plugin-import finds an import statement in deviceinfo.js so it expects that the module uses export statements. deviceinfo.js should use only import and export or only require(...) and module.exports.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:15 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
eshikeryacommented, Aug 12, 2018

@schumannd nope. starting from 0.22.3 it is broken. any type of import give an error

UPDATE:

import DeviceInfo from 'react-native-device-info';

fixes the issue

1reaction
jer-sencommented, May 22, 2018

@peacechen you have to use export default {, it solves eslint issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

eslint-plugin-import - npm
This plugin intends to support linting of ES2015+ (ES6+) import/export syntax, and prevent issues with misspelling of file paths and import ...
Read more >
node.js - Failed to load plugin import: 'eslint-plugin-import'
I'm new to react. I'm following the tutorial steps installing node. However, when I run npm start , errors keep show up. Failed...
Read more >
Issues · import-js/eslint-plugin-import - GitHub
ESLint plugin with rules that help validate proper imports. ... error 'react' should be listed in the project's dependencies.
Read more >
node_modules/eslint-plugin-import · master - PLMlab
This plugin intends to support linting of ES2015+ (ES6+) import/export syntax, and prevent issues with misspelling of file paths and import names. All...
Read more >
eslint-plugin-import | Yarn - Package Manager
This plugin intends to support linting of ES2015+ (ES6+) import/export syntax, and prevent issues with misspelling of file paths and import names. All...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found