Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ESLint Error: Cannot read property 'kind' of null #841

Closed
kevanstannard opened this issue May 22, 2017 · 3 comments
Closed

ESLint Error: Cannot read property 'kind' of null #841

kevanstannard opened this issue May 22, 2017 · 3 comments

Comments

@kevanstannard
Copy link

kevanstannard commented May 22, 2017

I'm currently using airbnb lint rules plus flow typing with the following configuration:

package.json

"babel-eslint": "^7.2.3",
"eslint": "^3.19.0",
"eslint-config-airbnb": "^15.0.1",
"eslint-plugin-flowtype": "^2.33.0",
"eslint-plugin-import": "^2.2.0",
"eslint-plugin-jsx-a11y": "^5.0.3",
"eslint-plugin-react": "^7.0.1"

.eslintrc

---
  extends:
    - airbnb
    - plugin:flowtype/recommended
  plugins:
    - flowtype
  parser: babel-eslint

And just one file in the project:

types.js

type Person = {
  name: string
}

export type {
  Person
};

When running eslint on this file it generates the following error:

Cannot read property 'kind' of null
TypeError: Cannot read property 'kind' of null
    at checkDeclaration (/Users/Kevan/dev/lint-bug/node_modules/eslint-plugin-import/lib/rules/no-mutable-exports.js:10:24)

If I change the types.js file as follows, then the error goes away:

export type Person = {
  name: string
}

I'm not sure if this is best solved within this project or within airbnb but just raising it here first as the error is occurring within the import plugin code.

Thanks

@jseminck
Copy link

jseminck commented May 24, 2017

Hi. It looks like this issue is already resolved in the master branch, but not yet released.

I am not really involved in the project a lot, but from some investigation: here is the commit that fixed the issue: bfdc2bb#diff-661a67441954052a3bb363a7c1398797R18

Other related issues: #660 + #758

According to this comment, a release should be coming soon: #758 (comment)

@benmosher
Copy link
Member

ah yeah, I believe I just published the fix for this as v2.3.0

@kevanstannard
Copy link
Author

Many thanks @benmosher

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants