eslint-plugin-import: TypeError: Cannot read property 'forEach' of null
Cannot read property 'forEach' of null
TypeError: Cannot read property 'forEach' of null
at dependencies.forEach.dep (/node_modules/eslint-plugin-import/lib/ExportMap.js:182:43)
at Map.forEach (native)
at ExportMap.forEach (/node_modules/eslint-plugin-import/lib/ExportMap.js:182:23)
at EventEmitter.ExportAllDeclaration (/node_modules/eslint-plugin-import/lib/rules/export.js:62:23)
at emitOne (events.js:101:20)
at EventEmitter.emit (events.js:188:7)
at NodeEventGenerator.enterNode (/node_modules/eslint/lib/util/node-event-generator.js:39:22)
at CodePathAnalyzer.enterNode (/node_modules/eslint/lib/code-path-analysis/code-path-analyzer.js:607:23)
at CommentEventGenerator.enterNode (/node_modules/eslint/lib/util/comment-event-generator.js:97:23)
at Controller.enter (/node_modules/eslint/lib/eslint.js:928:36)
I’m using airbnb
rules on WebStorm
editor.
My .eslintrc
is the following:
{
"parser": "babel-eslint",
"extends": "airbnb",
"env": {
"es6": true,
"jest": true
},
"plugins": [
"babel",
"flowtype",
"import",
"react",
"react-native"
],
"parserOptions": {
"ecmaFeatures": {
"jsx": true
},
"sourceType": "module"
},
"settings": {
"import/extensions": [".js", ".jsx", ".android.js", ".ios.js"]
},
"rules": {
"react/jsx-filename-extension": ["off"],
"react/prefer-stateless-function": ["error", {
"ignorePureComponents": true
}],
"no-case-declarations": ["off"],
"no-underscore-dangle": ["off"],
"no-nested-ternary": ["off"],
"arrow-parens": 0,
"babel/arrow-parens": 1,
"react-native/no-unused-styles": 2,
"react-native/split-platform-components": 2,
"react-native/no-inline-styles": 2,
"react-native/no-color-literals": 2
}
}
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 22 (9 by maintainers)
Commits related to this issue
- fix null pointer exception (#717) ignore deep CJS imports/exports — committed to import-js/eslint-plugin-import by benmosher 7 years ago
- fix null pointer exception (#717) (#797) ignore deep CJS imports/exports — committed to import-js/eslint-plugin-import by benmosher 7 years ago
- [fix] repeat fix from #797 for #717, in another place — committed to ljharb/eslint-plugin-import by ljharb 6 years ago
What is the workarround ?
@rjhilgefort i think your issue will be fixed in the next release.
Leaving this open so a test can be added.
I believe so. I just upgraded to
2.13.0
and I’m seeing the issue when I try to doexport * from 'Ramda'
. When I comment out that export, the eslint failure error is gone and I’m left with expected linter warns about theRamda
methods that aren’t being exported.Though,
Ramda
doesn’t have asize
method… so that’s a bit perplexing…reopening to remember to create test