Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"root": true,
"env": {
"browser": true,
"es2020": true,
"node": true
},
"extends": ["eslint:recommended", "plugin:react/recommended", "prettier"],
"parserOptions": {
"ecmaFeatures": {
"jsx": true
},
"ecmaVersion": 11,
"sourceType": "module"
},
"settings": {
"react": {
"version": "detect"
}
},
"plugins": ["react"],
"rules": {
"react/prop-types": "off",
"react/display-name": "off"
}
}
1 change: 1 addition & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ jobs:
GITHUB_USER_PERSONAL_ACCESS_TOKEN: ${{ secrets.USER_PAT }}
- run: |
npm install
npm run lint
npm run build
git config user.name "${{ secrets.USER_NAME }}"
git config user.email "${{ secrets.USER_EMAIL }}"
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,5 @@ jobs:
with:
GITHUB_USER_PERSONAL_ACCESS_TOKEN: ${{ secrets.USER_PAT }}
- run: npm install
- run: npm run lint
- run: npm run build
11 changes: 11 additions & 0 deletions build/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"env": {
"node": true
},
"extends": ["eslint:recommended", "prettier"],
"parserOptions": {
"ecmaVersion": 11,
"sourceType": "module"
},
"rules": {}
}
2 changes: 1 addition & 1 deletion build/create-testcases.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ async function init(program) {
* -> get code snippets
* -> and their relevant titles
*/
for (const { frontmatter, body, markdownAST } of rulesData) {
for (const { frontmatter, markdownAST } of rulesData) {
const { id: ruleId, name: ruleName, accessibility_requirements: ruleAccessibilityRequirements } = frontmatter

/**
Expand Down
20 changes: 8 additions & 12 deletions build/get-implementations.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,19 +37,15 @@ async function init({ implementationsFile }) {
execCommand(`mkdir -p "./_data/implementations"`)

for (const { organisation, toolName, jsonReports, testcases: actTestcases, output, description } of implementations) {
try {
const earlReports = await loadJson(jsonReports)
const [testcases] = await loadJson(actTestcases)
const mapping = await actMapGenerator(earlReports, testcases, { organisation, toolName })
const result = {
...mapping,
description,
}
await createFile(output, JSON.stringify(result, undefined, 2))
console.info(`Generated implementations for ${toolName} from ${organisation}`)
} catch (error) {
throw error
const earlReports = await loadJson(jsonReports)
const [testcases] = await loadJson(actTestcases)
const mapping = await actMapGenerator(earlReports, testcases, { organisation, toolName })
const result = {
...mapping,
description,
}
await createFile(output, JSON.stringify(result, undefined, 2))
console.info(`Generated implementations for ${toolName} from ${organisation}`)
}
}

Expand Down
3 changes: 2 additions & 1 deletion gatsby/get-node-data.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const getNodeData = async options => {
}

switch (sourceInstanceName) {
case 'rules':
case 'rules': {
const { id } = attributes
const path = `${sourceInstanceName}/${id}`
const gitUrl = `https://api.github.com/repos/act-rules/act-rules.github.io/commits?path=_rules/${relativePath}`
Expand All @@ -33,6 +33,7 @@ const getNodeData = async options => {
path,
changelog: JSON.stringify(logs),
}
}
default:
return {
...defaults,
Expand Down
Loading