-
-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
36 changed files
with
1,335 additions
and
413 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
name: Docs | ||
|
||
on: | ||
workflow_dispatch: {} | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
docs: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18 | ||
cache: yarn | ||
|
||
- name: Install dependencies | ||
run: yarn install --frozen-lockfile | ||
|
||
- name: Build docs | ||
run: npm run docs:build | ||
|
||
# https://github.com/crazy-max/ghaction-github-pages | ||
- name: Deploy to GitHub Pages | ||
uses: crazy-max/ghaction-github-pages@v3 | ||
with: | ||
target_branch: gh-pages | ||
build_dir: docs/.vitepress/dist | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,6 @@ | |
/.idea/ | ||
/dist/ | ||
/node_modules/ | ||
/docs/.vitepress/dist | ||
/docs/.vitepress/cache | ||
yarn-error.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
import { defineConfig } from "vitepress"; | ||
import { rules } from "./rulesForSidebar"; | ||
import { description, version } from "../../package.json"; | ||
|
||
// https://vitepress.dev/reference/site-config | ||
export default defineConfig({ | ||
title: "eslint-plugin-vuejs-a11y", | ||
base: "/eslint-plugin-vuejs-accessibility/", | ||
description, | ||
themeConfig: { | ||
// https://vitepress.dev/reference/default-theme-config | ||
nav: [ | ||
{ | ||
text: version, | ||
items: [ | ||
{ | ||
text: "Changelog", | ||
link: "https://github.com/vue-a11y/eslint-plugin-vuejs-accessibility/blob/main/CHANGELOG.md" | ||
} | ||
] | ||
} | ||
], | ||
|
||
sidebar: [ | ||
{ | ||
text: "Introduction", | ||
items: [ | ||
{ text: "Getting Started", link: "/" }, | ||
{ text: "Rule Overview", link: "/rule-overview/index" } | ||
] | ||
}, | ||
{ | ||
text: "Rules", | ||
items: rules | ||
} | ||
], | ||
|
||
editLink: { | ||
pattern: | ||
"https://github.com/vue-a11y/eslint-plugin-vuejs-accessibility/edit/master/docs/:path" | ||
}, | ||
|
||
socialLinks: [ | ||
{ | ||
icon: "github", | ||
link: "https://github.com/vue-a11y/eslint-plugin-vuejs-accessibility" | ||
} | ||
], | ||
|
||
search: { | ||
provider: "local" | ||
} | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import { join, parse } from "node:path"; | ||
import { Dirent, readdirSync } from "node:fs"; | ||
|
||
export const rules = getRulesForSideBar(); | ||
|
||
function getRulesForSideBar() { | ||
const rulesDirectory = join(__dirname, "../", "rules"); | ||
return readdirSync(rulesDirectory, { withFileTypes: true }) | ||
.filter(isFile) | ||
.filter(isMarkdown) | ||
.map(fileNameWithoutExtension) | ||
.map(ruleToSidebarItem); | ||
} | ||
|
||
function isFile(dirent: Dirent) { | ||
return !dirent.isDirectory(); | ||
} | ||
|
||
function isMarkdown(dirent: Dirent) { | ||
return dirent.name.endsWith(".md"); | ||
} | ||
|
||
function fileNameWithoutExtension(file: Dirent) { | ||
const parsedFileName = parse(file.name); | ||
const nameWithoutExtension = parsedFileName.name; | ||
return nameWithoutExtension; | ||
} | ||
|
||
function ruleToSidebarItem(ruleName: string) { | ||
return { | ||
text: ruleName, | ||
link: `/rules/${ruleName}` | ||
}; | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
# Getting Started | ||
|
||
An `eslint` plugin for checking accessibility rules from within `.vue` files. | ||
|
||
## 💿 Installation | ||
|
||
::: code-group | ||
|
||
```bash [yarn] | ||
yarn add --dev eslint-plugin-vuejs-accessibility | ||
``` | ||
|
||
```bash [npm] | ||
npm install --save-dev eslint-plugin-vuejs-accessibility | ||
``` | ||
|
||
```bash [pnpm] | ||
pnpm add -D eslint-plugin-vuejs-accessibility | ||
``` | ||
|
||
::: | ||
|
||
## 📖 Usage | ||
|
||
Add `vuejs-accessibility` to the plugins section of your `eslint` configuration. You can omit the `eslint-plugin-` prefix: | ||
|
||
```json | ||
{ | ||
"plugins": ["vuejs-accessibility"] | ||
} | ||
``` | ||
|
||
Then configure the rules you want to use under the rules section. | ||
|
||
```json | ||
{ | ||
"rules": { | ||
"vuejs-accessibility/rule-name": "error" | ||
} | ||
} | ||
``` | ||
|
||
You can also enable all the recommended rules at once. Add `plugin:vuejs-accessibility/recommended` in extends: | ||
|
||
```json | ||
{ | ||
"extends": ["plugin:vuejs-accessibility/recommended"] | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<script setup lang="ts"> | ||
import { data as rules } from "./rule-overview.data"; | ||
</script> | ||
|
||
<template> | ||
<div class="rule-table-container"> | ||
<div>✅ - Recommended</div> | ||
|
||
<table> | ||
<tr> | ||
<th>Rule</th> | ||
<th></th> | ||
</tr> | ||
|
||
<tr v-for="{ name, link, recommended } of rules"> | ||
<td> | ||
<a :href="link">{{ name }}</a> | ||
</td> | ||
|
||
<td v-if="recommended">✅</td> | ||
<td v-else></td> | ||
</tr> | ||
</table> | ||
</div> | ||
</template> | ||
|
||
<style scoped> | ||
.rule-table-container { | ||
margin-top: 24px; | ||
} | ||
table { | ||
width: 100%; | ||
display: table; | ||
} | ||
td:last-of-type { | ||
width: 50px; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
--- | ||
prev: | ||
text: Getting Started | ||
link: / | ||
next: | ||
text: alt-text | ||
link: /rules/alt-text | ||
--- | ||
|
||
<script setup lang="ts"> | ||
import RuleTable from './RuleTable.vue' | ||
</script> | ||
|
||
# Rule Overview | ||
|
||
<RuleTable /> |
Oops, something went wrong.