Skip to content

Commit ed73a98

Browse files
committed
Add jsx-a11y rules and workflow for building RAD UI
1 parent 59265bc commit ed73a98

File tree

4 files changed

+64
-7
lines changed

4 files changed

+64
-7
lines changed

.eslintrc.cjs

Lines changed: 33 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ module.exports = {
88
'plugin:react/recommended',
99
'eslint:recommended',
1010
'standard',
11-
'plugin:jsx-a11y/recommended',
11+
'plugin:jsx-a11y/recommended'
1212
],
1313
overrides: [
1414
],
@@ -19,7 +19,7 @@ module.exports = {
1919
},
2020
plugins: [
2121
'react',
22-
'jsx-a11y',
22+
'jsx-a11y'
2323
],
2424
rules: {
2525
'jsx-a11y/alt-text': 'warn',
@@ -64,6 +64,36 @@ module.exports = {
6464
semi: [
6565
'warn',
6666
'always'
67-
]
67+
],
68+
'jsx-a11y/accessible-emoji': 'warn',
69+
'jsx-a11y/anchor-has-content': 'warn',
70+
'jsx-a11y/aria-activedescendant-has-tabindex': 'warn',
71+
'jsx-a11y/aria-props': 'warn',
72+
'jsx-a11y/aria-proptypes': 'warn',
73+
'jsx-a11y/aria-role': 'warn',
74+
'jsx-a11y/aria-unsupported-elements': 'warn',
75+
'jsx-a11y/click-events-have-key-events': 'warn',
76+
'jsx-a11y/heading-has-content': 'warn',
77+
'jsx-a11y/html-has-lang': 'warn',
78+
'jsx-a11y/iframe-has-title': 'warn',
79+
'jsx-a11y/img-redundant-alt': 'warn',
80+
'jsx-a11y/interactive-supports-focus': 'warn',
81+
'jsx-a11y/label-has-associated-control': 'warn',
82+
'jsx-a11y/media-has-caption': 'warn',
83+
'jsx-a11y/mouse-events-have-key-events': 'warn',
84+
'jsx-a11y/no-access-key': 'warn',
85+
'jsx-a11y/no-autofocus': 'warn',
86+
'jsx-a11y/no-distracting-elements': 'warn',
87+
'jsx-a11y/no-interactive-element-to-noninteractive-role': 'warn',
88+
'jsx-a11y/no-noninteractive-element-interactions': 'warn',
89+
'jsx-a11y/no-noninteractive-element-to-interactive-role': 'warn',
90+
'jsx-a11y/no-noninteractive-tabindex': 'warn',
91+
'jsx-a11y/no-onchange': 'warn',
92+
'jsx-a11y/no-redundant-roles': 'warn',
93+
'jsx-a11y/no-static-element-interactions': 'warn',
94+
'jsx-a11y/role-has-required-aria-props': 'warn',
95+
'jsx-a11y/role-supports-aria-props': 'warn',
96+
'jsx-a11y/scope': 'warn',
97+
'jsx-a11y/tabindex-no-positive': 'warn'
6898
}
6999
};

.github/workflows/build-rad-ui.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Build RAD UI
2+
3+
on:
4+
pull_request:
5+
branches: [ main ]
6+
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- uses: actions/checkout@v4
13+
14+
- name: Setup Node.js
15+
uses: actions/setup-node@v4
16+
with:
17+
node-version: '20'
18+
cache: 'npm'
19+
20+
- name: Install dependencies
21+
run: npm ci
22+
23+
- name: Build
24+
run: npm run build

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,12 @@
4646
"build-css": "rollup -c rollup-css.config.js",
4747
"generate-tokens": "tsx ./scripts/tokenGen/index.js",
4848
"bundle-tokens": "rollup --config rollup-tokens.config.js",
49-
"build-components": "rollup -c --bundleConfigAsCjs --max-old-space-size=8076",
50-
"copy-components": "mkdirp ./dist/components && cp -r ./dist/temp-cleanup/*js ./dist/components && rimraf dist/temp-cleanup",
51-
"build": "npm run test && npm run clean && npm run build-css && npm run generate-tokens && npm run bundle-tokens && npm run build-components && npm run copy-components --max-old-space-size=4076",
49+
"compile-components": "rollup -c --bundleConfigAsCjs --max-old-space-size=8076",
50+
"process-components": "mkdirp ./dist/components && cp -r ./dist/temp-cleanup/*js ./dist/components && rimraf dist/temp-cleanup",
51+
"prebuild": "npm run test && npm run clean",
52+
"build:css": "npm run generate-tokens && npm run bundle-tokens && npm run build-css",
53+
"build:components": "npm run compile-components && npm run process-components",
54+
"build": "npm run prebuild && npm run build:css && NODE_OPTIONS='--max-old-space-size=4076' npm run build:components",
5255
"release": "npm publish --access public",
5356
"lint": "eslint --ext .js,.jsx,.ts,.tsx . --fix",
5457
"update-rad": "npm update @radui/ui",

0 commit comments

Comments
 (0)