Skip to content

Commit

Permalink
Setup a11y rules with Eslint for local development
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuasmall committed Oct 21, 2021
1 parent c265491 commit bd5b6a3
Show file tree
Hide file tree
Showing 5 changed files with 321 additions and 27,659 deletions.
4 changes: 2 additions & 2 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ module.exports = {
'plugin:vue/essential',
'plugin:vue/strongly-recommended',
'plugin:vue/recommended',
'plugin:vuejs-accessibility/recommended',
'prettier',
'plugin:vue-a11y/base',
],
plugins: ['jest', 'prettier', 'vue', 'vuejs-accessibility'],
plugins: ['jest', 'prettier', 'vue', 'vue-a11y'],
root: true,
// add your custom rules here
rules: {
Expand Down
8 changes: 7 additions & 1 deletion components/SiteNavbar/SiteNavbar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@
<CoreSignUpButton />
<button
class="items-center rounded text-black lg:hidden"
@click="mobileNavIsActive = !mobileNavIsActive"
@click="toggleMobileNav"
@keydown.space="toggleMobileNav"
>
<svg
class="fill-current h-5 w-5 mx-2"
Expand Down Expand Up @@ -112,5 +113,10 @@ export default defineComponent({
mobileNavIsActive,
};
},
methods: {
toggleMobileNav() {
this.mobileNavIsActive = !this.mobileNavIsActive;
},
},
});
</script>
7 changes: 6 additions & 1 deletion components/core/SearchBar/SearchBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,12 @@
placeholder="search..."
@keyup.enter="onEnter"
/>
<button data-testid="search-button" type="submit" @click="onClick">
<button
data-testid="search-button"
type="submit"
aria-hidden="true"
@click="onClick"
>
<svg
xmlns="http://www.w3.org/2000/svg"
fill="none"
Expand Down
Loading

0 comments on commit bd5b6a3

Please sign in to comment.