Skip to content

Commit abc6090

Browse files
committed
Update Node.js engine, workflows, and test coverage
Lowered the minimum Node.js engine requirement to 18 in package.json and added Node.js 18 to the test matrix. Updated CodeQL GitHub Actions to v3.30.2 and improved documentation for GitHub Actions usage. Removed a test that checked for rule presence in rules/index.mdx. Update website.yml Update project rules and labeler workflow formatting Expanded general project rules to include line endings, code formatting, rule ordering, and GitHub Actions best practices. Also standardized comment spacing in the labeler workflow permissions section.
1 parent 422aa48 commit abc6090

File tree

9 files changed

+32
-32
lines changed

9 files changed

+32
-32
lines changed

.cursor/rules/general.mdc

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,16 @@ description: General rules for the project
33
globs:
44
alwaysApply: true
55
---
6-
- When adding a new rule to website ensure that it has the frontmatter: `pagefind: false sidebar: badge: New hidden: true`
7-
- Always run `npm run lint` before declaring that a task is complete (if you've changed any files)
86

7+
- When adding a new rule to website ensure that it has the frontmatter: `pagefind: false sidebar: badge: New hidden: true`.
8+
- Always run `npm run lint` before declaring that a task is complete (if you've changed any files).
9+
- Always use lf for line endings.
10+
- Code is formatted with prettier.
11+
- As a general rule, rules should be listed alphabetically.
12+
13+
## GitHub Actions
14+
15+
- The GitHub Actions workflows should be placed in the .github/workflows directory.
16+
- The workflows should be named `<workflow-name>.yml`.
17+
- All GitHub Actions should be pinned versions to avoid breaking changes (SHA-1).
18+
- If using actions/checkout, it should have `persist-credentials: false` set.

.github/copilot-instructions.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
- Node v20 is used for development.
1010
- Core code is in TypeScript v5.4.5.
1111
- All new rules for HTMLHint should be placed in the rules directory.
12-
- Tests for new rules should be added in rules and follow the naming pattern <rule-name>.spec.js.
12+
- Tests for new rules should be added in rules and follow the naming pattern `<rule-name>.spec.js`.
1313
- Do not use deprecated Node.js or TypeScript features.
1414
- All user-facing messages and documentation should use clear, concise US English.
1515
- Keep dependencies up to date and avoid unnecessary packages.
@@ -19,3 +19,10 @@
1919
- Use the provided code snippets as examples for rule documentation.
2020
- Newly added rules pages for the website should have the frontmatter: sidebar: hidden: true badge: New
2121
- Always run `npm run build` before running tests or committing changes.
22+
23+
## GitHub Actions
24+
25+
- The GitHub Actions workflows should be placed in the .github/workflows directory.
26+
- The workflows should be named `<workflow-name>.yml`.
27+
- All GitHub Actions should be pinned versions to avoid breaking changes (SHA-1).
28+
- If using actions/checkout, it should have `persist-credentials: false` set.

.github/workflows/codeql-analysis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@ jobs:
3030
persist-credentials: false
3131

3232
- name: Initialize CodeQL
33-
uses: github/codeql-action/init@f1f6e5f6af878fb37288ce1c627459e94dbf7d01 # v3.30.1
33+
uses: github/codeql-action/init@d3678e237b9c32a6c9bffb3315c335f976f3549f # v3.30.2
3434
with:
3535
config-file: ./.github/codeql/codeql-config.yml
3636
languages: 'javascript'
3737
queries: +security-and-quality
3838

3939
- name: Perform CodeQL Analysis
40-
uses: github/codeql-action/analyze@f1f6e5f6af878fb37288ce1c627459e94dbf7d01 # v3.30.1
40+
uses: github/codeql-action/analyze@d3678e237b9c32a6c9bffb3315c335f976f3549f # v3.30.2

.github/workflows/labeler.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
name: Pull Request Labeler
22

33
on:
4-
- pull_request_target
4+
workflow_dispatch:
55

66
permissions:
77
contents: read
88

99
jobs:
1010
triage:
1111
permissions:
12-
contents: read # for actions/labeler to determine modified files
13-
pull-requests: write # for actions/labeler to add labels to PRs
12+
contents: read # for actions/labeler to determine modified files
13+
pull-requests: write # for actions/labeler to add labels to PRs
1414
runs-on: ubuntu-latest
1515
steps:
1616
- uses: actions/labeler@634933edcd8ababfe52f92936142cc22ac488b1b # v6.0.1

.github/workflows/test.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,15 @@ jobs:
3434

3535
build:
3636
permissions:
37-
actions: write # for styfle/cancel-workflow-action to cancel/stop running workflows
38-
contents: read # for actions/checkout to fetch code
37+
actions: write # for styfle/cancel-workflow-action to cancel/stop running workflows
38+
contents: read # for actions/checkout to fetch code
3939
runs-on: ${{ matrix.os }}
4040
needs: lint
4141
strategy:
4242
fail-fast: false
4343
matrix:
4444
node:
45+
- 18
4546
- 20
4647
- 22
4748
- 24

.github/workflows/website.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ permissions:
1919
jobs:
2020
build:
2121
permissions:
22-
contents: read # for actions/checkout to fetch code
23-
security-events: write # for github/codeql-action/upload-sarif to upload SARIF results
22+
contents: read # for actions/checkout to fetch code
23+
security-events: write # for github/codeql-action/upload-sarif to upload SARIF results
2424
runs-on: ubuntu-latest
2525
steps:
2626
- name: ⬇️ Checkout

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: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@
7878
"typescript": "5.4.5"
7979
},
8080
"engines": {
81-
"node": ">=20"
81+
"node": ">=18"
8282
},
8383
"volta": {
8484
"node": "20.19.4"

test/rules/documentation.spec.js

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -25,27 +25,9 @@ describe('Rules documentation', () => {
2525
)
2626
.map((doc) => doc.replace('.mdx', ''))
2727

28-
const rulesListPage = fs.readFileSync(
29-
path.join(
30-
__dirname,
31-
'..',
32-
'..',
33-
'website',
34-
'src',
35-
'content',
36-
'docs',
37-
'rules',
38-
'index.mdx'
39-
),
40-
'utf-8'
41-
)
42-
4328
rules.forEach((rule) => {
4429
it(`${rule} should have a documentation page`, () => {
4530
expect(docs).toContain(rule)
4631
})
47-
it(`${rule} should be on the rules/index.mdx`, () => {
48-
expect(rulesListPage).toContain(rule)
49-
})
5032
})
5133
})

0 commit comments

Comments
 (0)