javascript icon indicating copy to clipboard operation
javascript copied to clipboard

jsx-a11y breaks linter

Open johntran opened this issue 10 years ago • 6 comments

Hi there!

I got the following errors for the following rules:

  • jsx-a11y/anchor-has-content
  • jsx-a11y/href-no-hash
  • jsx-a11y/label-has-for
  • jsx-a11y/heading-has-content

They are all type errors. I've removed the rules, and my linter started working again.

For those who want to fix their linter, see below. I wasn't sure what the expected behavior was for those rules, so I didn't attempt to fix the rules. I opted to remove them instead. https://gist.github.com/johntran/26eb28be5ed30edde5f706525245324c

Setup: OS: Mac OS X 10.11.6 Atom: 1.12.5 Node: 7.1.0

Atom Packages: linter-eslint: 8.0.0 Nuclide: 0.183.0

npm packages: babel-eslint: 7.1.1 eslint-plugin-jsx-a11y: 3.0.1 eslint-config-airbnb: 13.0.0 eslint: 3.10.2

See screenshots. I enabled "linter" atom package to get these screenshots. I disabled "linter" afterwards and Nuclide Diagnostics started picking up eslint errors again.

screenshot 2016-11-21 05 16 00 screenshot 2016-11-21 05 17 14 screenshot 2016-11-21 05 18 45 screenshot 2016-11-21 05 26 44

johntran avatar Nov 21 '16 13:11 johntran

Ah... duplicate of: https://github.com/airbnb/javascript/issues/1163

Closing.

johntran avatar Nov 21 '16 14:11 johntran

Reopening:

https://github.com/airbnb/javascript/commit/72eb3e443e49da634a83b56660fbe56698775cbb

Wasn't this commit supposed to fix it?

johntran avatar Nov 21 '16 14:11 johntran

@johntran you are referring to a commit that is beyond eslint-config-airbnb: 13.0.0 version that it looks like you are using.

Please refer to 13.0.0 tag commit.

Current version 13.0.0 supports "eslint-plugin-jsx-a11y": "^2.2.3".

So downgrade your version of eslint-plugin-jsx-a11y to 2.2.3 for now and wait for the next release of eslint-config-airbnb

andykenward avatar Nov 21 '16 14:11 andykenward

Got it :) Closing.

johntran avatar Nov 21 '16 14:11 johntran

@johntran please use the install command in the readme of eslint-config-airbnb, and your peer dep versions will always be correct.

ljharb avatar Nov 21 '16 16:11 ljharb

Just published v14.0.0 of the main config, and v11.0.1 of the base config.

(#1162, #1166, #1182, #1186, #1207, #1212, #1222)

ljharb avatar Jan 08 '17 23:01 ljharb