Comments (16)
Just published v1.0.2 let me know if you face any other issues. I'm going to work on better error handling right now for every rule.
from eslint-plugin-jsx-a11y.
sure, perhaps with the filename and line number
from eslint-plugin-jsx-a11y.
thanks @ivarni will get you a fix for that right now and work on error handling today.
from eslint-plugin-jsx-a11y.
Fixed ConditionalExpression
handler in v1.0.4
from eslint-plugin-jsx-a11y.
Yeah, it should be more fault tolerant than that 😦
Mind sharing the JSX that was used so I can add a handler for a ThisExpression
from eslint-plugin-jsx-a11y.
I have no idea - I ran it on our huge codebase and it doesn't tell me which file it's looking at :-/
from eslint-plugin-jsx-a11y.
Ah, that's okay, I've created a function to handle ThisExpression
. I'm actually not sure if the code should be more defensive because it could return false positives. In your experience would it be better for the code to fail so user can report a bug or fail gracefully even if it incorrectly warns?
from eslint-plugin-jsx-a11y.
I'd say it'd be better for it to fail with a meaningful error message.
from eslint-plugin-jsx-a11y.
as in an actual throw new Error(``Encountered an unknown type '${type}' while trying to get the prop ${prop}'s value. Please file an issue on Github to get this resolved immediately.``)
??
from eslint-plugin-jsx-a11y.
@evcohen not to put too much pressure on you, but this is blocking release of v8 of eslint-config-airbnb ;-) is it something you hope to get out soon?
from eslint-plugin-jsx-a11y.
ah working on it now, sorry about that. will let you know when im about to publish.
from eslint-plugin-jsx-a11y.
actually, let me just get a fix out for ThisExpression
and then add error handling for next release. might take some time to figure out how to get propagate certain values to that function to give a meaningful error message.
from eslint-plugin-jsx-a11y.
Thanks!
from eslint-plugin-jsx-a11y.
@evcohen I just got this error with version 1.0.3 for the rule "jsx-a11y/aria-proptypes"
In our code base I found this:
<input
aria-invalid={error ? 'true' : 'false'}
>
Removing the aria-invalid
property made the error go away, so if you want to work on error-handling that will at least give you something that throws.
from eslint-plugin-jsx-a11y.
I'm still seeing this error with v1.0.4, the line of source that's triggering it is:
<div className="download__logo float-left"><img src={'/api/plugins/' + plugin.slug + '/logos/small'} alt={plugin.name + ' Logo'} /></div>
expression
is:
Node {
type: 'BinaryExpression',
start: 1047,
end: 1068,
loc:
SourceLocation {
start: Position { line: 25, column: 116 },
end: Position { line: 25, column: 137 } },
left:
Node {
type: 'MemberExpression',
start: 1047,
end: 1058,
loc: SourceLocation { start: [Object], end: [Object] },
object:
Node {
type: 'Identifier',
start: 1047,
end: 1053,
loc: [Object],
name: 'plugin',
range: [Object],
_babelType: 'Identifier' },
property:
Node {
type: 'Identifier',
start: 1054,
end: 1058,
loc: [Object],
name: 'name',
range: [Object],
_babelType: 'Identifier' },
computed: false,
range: [ 1047, 1058 ],
_babelType: 'MemberExpression' },
operator: '+',
right:
Node {
type: 'Literal',
start: 1061,
end: 1068,
loc: SourceLocation { start: [Object], end: [Object] },
extra: { rawValue: ' Logo', raw: '\' Logo\'' },
value: ' Logo',
range: [ 1061, 1068 ],
_babelType: 'StringLiteral',
raw: '\' Logo\'' },
range: [ 1047, 1068 ],
_babelType: 'BinaryExpression' }
And sure enough, BinaryExpression
isn't a key in TYPES
.
Changing that line to use a template literal "fixes" the problem:
<div className="download__logo float-left"><img src={'/api/plugins/' + plugin.slug + '/logos/small'} alt={`${plugin.name} Logo`} /></div>
from eslint-plugin-jsx-a11y.
@DanCech published v1.1.0 with BinaryExpression
handler and basic error handling when getting an unknown expression type. Thanks for reporting 😄
from eslint-plugin-jsx-a11y.
Related Issues (20)
- semver pkg - ReDoS Vulnerability HOT 1
- jsx-a11y/control-has-associated-label throws an error on table elements HOT 5
- Changelog links broken due to different repo HOT 1
- jsx-a11y/label-has-associated-control gives error when for is put HOT 3
- label-has-associated-control regression
- How to configure `eslint-plugin-jsx-a11y` in `eslint.config.js` HOT 5
- [label-has-associated-control] regression - rule errors when a label does not directly have text, even if it has htmlFor HOT 8
- jsx-a11y/control-has-associated-label triggers on TD element HOT 1
- Coordinate NodeJS version support with axe-core HOT 9
- [img-redundant-alt] `words` option does not work with double-byte character words.
- `alt-text`: missing warning for empty `alt` for `<input type="image" alt="" />`
- [label-has-associated-control] Glob format not supporting labelComponents HOT 1
- Snyk: MPL 2.0 license vulnerability in axe-core HOT 2
- anchor-has-content and aria-labelledby
- Lint error on valid way for associating a `label` to an `input` control HOT 1
- `jsx-a11y/label-has-associated-control` behavior is apparently misdocumented HOT 10
- Add support for ESLint 9 HOT 2
- heading-has-content false positive for object spread HOT 1
- [control-has-associated-label]: Does not allow for custom components that would result in accessible labels HOT 1
- `jsx-a11y/media-has-caption` Eslint Warning for Missing Captions in Media Elements HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from eslint-plugin-jsx-a11y.