If (null) continues


#1

Hi All,
I have an issue with eslint so I’ve decided to debug it.
I’m not an expert with JS nor Atom so I debug with console.log()
Please review the picture I’ve uploaded. (code and console)
It seems to me the if statement continues with the null value, what am I missing?

Thanks


#2

I’m trying to search the ESLint documentation for ruleValidators.get() and not finding anything. Have you changed the name of that object?


#3

No, It is eslint package in node_modules (4.17.0)
Why do you need the documentation?
Do you have an idea about the if that return true although the validateRule is null?


#4

I don’t have any ideas, which is why I was looking at the documentation to see what ruleValidators.get() is supposed to respond with.


#5

#6

I think you didn’t understand me,
I have a problem with the eslint loading in Atom.
C:\Users\Jonathan\Desktop\proj\node_modules\eslint-config-rallycoding\rules\react-a11y.js: Configuration for rule “jsx-a11y/label-has-for” is invalid: Value [“label”] should be object.

Seems the issue from here


#7

This is something you haven’t mentioned before. Where do you see this message appear? A screenshot of it would be helpful.


#8

It relate to this issue that the sulotion is not working for me.


#9

You’re looking in the wrong file. config-validator.js is what’s throwing the error, and the text of the error tells you to look in rules\react-a11y.js for jsx-a11y/label-has-for. Which, in the copy of the package I just downloaded, is 'jsx-a11y/label-has-for': [2, ['label']]. According to the error message, that’s wrong, but I don’t know what it should be.

So the problem is not Atom or ESLint. The problem is specifically that one rule in eslint-config-rallycoding. That package hasn’t been updated in a year and doesn’t have a public repository, so I wouldn’t feel too confident about getting them to fix it. Best to uninstall that package and look for something else, unless you feel up to fixing and republishing it.


#10

Thanks, I’ll try to continue from here