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

[fix]: Fix optional chaining bug in img-redundant-alt rule #832

Merged

Conversation

uncommon-type
Copy link
Contributor

@uncommon-type uncommon-type commented Feb 18, 2022

Description

This PR fixes an optional chaining bug in the img-redundant-alt rule. It adds valid test cases with optional chaining operator to the img-redundant-alt-test file and makes sure they have a parserOptions property for configuring parser behaviour. Along with that, it adds semver@6 to ensure that tests using optional chaining skip eslint < 6

Related Issue

Closes #794

Acceptance Criteria

  • Add test cases with optional chaining operator
  • Add parserOptions prop to each test case to configure parser behaviour
  • Add semver to tests using optional chaining to ensure they skip eslint < 6

Type of Changes

Type
βœ“ πŸ› Bug fix
✨ New feature
πŸ”¨ Refactoring
πŸ’― Add tests
πŸ”— Update dependencies
πŸ“œ Docs

- Add test cases with optional chaining
- Add parserOptions prop to each test case to configure parser behaviour

Closes jsx-eslint#794
@codecov
Copy link

codecov bot commented Feb 18, 2022

Codecov Report

Merging #832 (d2c35b6) into main (f878d3b) will not change coverage.
The diff coverage is n/a.

❗ Current head d2c35b6 differs from pull request most recent head ea877c4. Consider uploading reports for the commit ea877c4 to get more accurate results

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #832   +/-   ##
=======================================
  Coverage   99.22%   99.22%           
=======================================
  Files          98       98           
  Lines        1419     1419           
  Branches      479      479           
=======================================
  Hits         1408     1408           
  Misses         11       11           

Continue to review full report at Codecov.

Legend - Click here to learn more
Ξ” = absolute <relative> (impact), ΓΈ = not affected, ? = missing data
Powered by Codecov. Last update f878d3b...ea877c4. Read the comment docs.

@uncommon-type uncommon-type marked this pull request as ready for review February 21, 2022 18:44
__tests__/src/rules/img-redundant-alt-test.js Outdated Show resolved Hide resolved
__tests__/src/rules/img-redundant-alt-test.js Outdated Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
@ljharb ljharb force-pushed the issue794-optional-chaining-bug branch from d2c35b6 to ea877c4 Compare February 22, 2022 18:22
Copy link
Member

@ljharb ljharb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! Will land once tests pass.

@ljharb ljharb merged commit ea877c4 into jsx-eslint:main Feb 22, 2022
@uncommon-type uncommon-type deleted the issue794-optional-chaining-bug branch February 23, 2022 09:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

img-redundant-alt warning cannot handle optional chaining operator
2 participants