Skip to content

Commit a146175

Browse files
jessebeachbeefancohen
authored andcommitted
Remove href-no-hash rule
1 parent 5755a1d commit a146175

File tree

6 files changed

+6
-286
lines changed

6 files changed

+6
-286
lines changed

CHANGELOG.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
6.0.0 / 2017-06-05
22
=================
33
- [new] Add rule `anchor-is-valid`. See documentation for configuration options. Thanks @AlmeroSteyn.
4-
- [update] The rule `label-has-for` now allows inputs nested in label tags. Previously it was strict about requiring a `for` attribute. Thanks @ignatiusreza.
4+
- [breaking] `href-no-hash` replaced with `anchor-is-valid` in the recommended and strict configs. Use the `invalidHref` aspect (active by default) in `anchor-is-valid` to continue to apply the behavior provided by `href-no-hash`.
5+
- [update] The rule `label-has-for` now allows inputs nested in label tags. Previously it was strict about requiring a `for` attribute. Thanks @ignatiusreza.
56
- [update] New configuration for `interactive-supports-focus`. Recommended and strict configs for now contain a trimmed-down whitelist of roles that will be checked.
67
- [fix] Incompatibility between node version 4 and 5. Thanks @evilebottnawi.
78
- [fix] Missing README entry for `media-has-caption`. Thanks @ismail-syed.
@@ -26,13 +27,13 @@
2627
==================
2728
- [breaking] Refactor `img-has-alt` rule into `alt-text` rule
2829
- [breaking] Rule `onclick-has-role` is removed. Replaced with `no-static-element-interactions` and `no-noninteractive-element-interactions`.
29-
- [breaking] Rule `onclick-has-focus` is removed. Replaced with `interactive-supports-focus`.
30+
- [breaking] Rule `onclick-has-focus` is removed. Replaced with `interactive-supports-focus`.
3031
- [new] - Add rule `media-has-caption` rule
3132
- [new] - Add `ignoreNonDOM` option to `no-autofocus`.
3233
- [new] - Add rule `no-interactive-element-to-noninteractive-role`
3334
- [new] - Add rule `no-noninteractive-element-to-interactive-role`
3435
- [new] - Add rule `no-noninteractive-tabindex`
35-
- [new] - Configs split into "recommended" and "strict".
36+
- [new] - Configs split into "recommended" and "strict".
3637
- [enhanced] - Configuration options added to `no-static-element-interactions` and `no-noninteractive-element-interactions`. Options allow for fine-tuning of elements and event handlers to check.
3738

3839

__tests__/src/rules/anchor-is-valid-test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ const componentsAndSpecialLinkAndNoHrefAspect = [{
8686
ruleTester.run('anchor-is-valid', rule, {
8787
valid: [
8888
// DEFAULT ELEMENT 'a' TESTS
89+
{ code: '<Anchor />;' },
8990
{ code: '<a {...props} />' },
9091
{ code: '<a href="foo" />' },
9192
{ code: '<a href={foo} />' },
@@ -250,7 +251,6 @@ ruleTester.run('anchor-is-valid', rule, {
250251
{ code: '<a href="javascript:void(0)" />', options: noHrefPreferButtonAspect },
251252
{ code: '<a href={"javascript:void(0)"} />', options: noHrefPreferButtonAspect },
252253

253-
254254
// SHOULD BE BUTTON
255255
{ code: '<a onClick={() => void 0} />', options: invalidHrefAspect },
256256
{ code: '<a href="#" onClick={() => void 0} />', options: noHrefAspect },

__tests__/src/rules/href-no-hash-test.js

Lines changed: 0 additions & 173 deletions
This file was deleted.

docs/rules/href-no-hash.md

Lines changed: 0 additions & 51 deletions
This file was deleted.

src/index.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ module.exports = {
1313
'aria-unsupported-elements': require('./rules/aria-unsupported-elements'),
1414
'click-events-have-key-events': require('./rules/click-events-have-key-events'),
1515
'heading-has-content': require('./rules/heading-has-content'),
16-
'href-no-hash': require('./rules/href-no-hash'),
1716
'html-has-lang': require('./rules/html-has-lang'),
1817
'iframe-has-title': require('./rules/iframe-has-title'),
1918
'img-redundant-alt': require('./rules/img-redundant-alt'),
@@ -48,14 +47,14 @@ module.exports = {
4847
'jsx-a11y/accessible-emoji': 'error',
4948
'jsx-a11y/alt-text': 'error',
5049
'jsx-a11y/anchor-has-content': 'error',
50+
'jsx-a11y/anchor-is-valid': 'error',
5151
'jsx-a11y/aria-activedescendant-has-tabindex': 'error',
5252
'jsx-a11y/aria-props': 'error',
5353
'jsx-a11y/aria-proptypes': 'error',
5454
'jsx-a11y/aria-role': 'error',
5555
'jsx-a11y/aria-unsupported-elements': 'error',
5656
'jsx-a11y/click-events-have-key-events': 'error',
5757
'jsx-a11y/heading-has-content': 'error',
58-
'jsx-a11y/href-no-hash': 'error',
5958
'jsx-a11y/html-has-lang': 'error',
6059
'jsx-a11y/iframe-has-title': 'error',
6160
'jsx-a11y/img-redundant-alt': 'error',
@@ -171,7 +170,6 @@ module.exports = {
171170
'jsx-a11y/aria-unsupported-elements': 'error',
172171
'jsx-a11y/click-events-have-key-events': 'error',
173172
'jsx-a11y/heading-has-content': 'error',
174-
'jsx-a11y/href-no-hash': 'error',
175173
'jsx-a11y/html-has-lang': 'error',
176174
'jsx-a11y/iframe-has-title': 'error',
177175
'jsx-a11y/img-redundant-alt': 'error',

src/rules/href-no-hash.js

Lines changed: 0 additions & 55 deletions
This file was deleted.

0 commit comments

Comments
 (0)