Skip to content
Merged
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
4 changes: 2 additions & 2 deletions .github/workflows/cpd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ jobs:

steps:
- uses: actions/checkout@v4
- name: Use Node.js 20
- name: Use Node.js 24
uses: actions/setup-node@v4
with:
node-version: 20
node-version: 24
cache: "npm"
- name: npm cpd
run: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ jobs:

steps:
- uses: actions/checkout@v4
- name: Use Node.js 20
- name: Use Node.js 24
uses: actions/setup-node@v4
with:
node-version: 20
node-version: 24
cache: "npm"
- name: npm lint
run: |
Expand Down
24 changes: 18 additions & 6 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
# For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages

name: Node.js Package

on:
Expand All @@ -14,7 +11,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
node-version: 24
- run: npm ci
- run: npm test

Expand All @@ -23,12 +20,27 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.GH_PAT }} # Use your PAT here!
- uses: actions/setup-node@v4
with:
node-version: 20
node-version: 24
registry-url: https://registry.npmjs.org/
- run: npm ci
- name: Set version from tag
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
TAG=${GITHUB_REF#refs/tags/}
TAG=${TAG#v}
git fetch origin main
git checkout main
git pull
npm version $TAG --no-git-tag-version
git add package.json package-lock.json
git commit -m "ci: set version to $TAG [skip ci]" || true

Copilot AI Jun 16, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] The use of '|| true' here may suppress commit errors and hide potential issues in the version update process. Consider handling commit failures explicitly so that any unexpected issues can be detected and addressed.

Suggested change
git commit -m "ci: set version to $TAG [skip ci]" || true
if ! git diff --cached --quiet; then
git commit -m "ci: set version to $TAG [skip ci]" || { echo "Error: git commit failed"; exit 1; }
else
echo "No changes to commit."
fi

Copilot uses AI. Check for mistakes.
git push origin main
- run: npm run build --if-present
- run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
NODE_AUTH_TOKEN: ${{ secrets.npm_token }}
4 changes: 2 additions & 2 deletions .github/workflows/sonarcloud.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ jobs:

steps:
- uses: actions/checkout@v4
- name: Use Node.js 20
- name: Use Node.js 24
uses: actions/setup-node@v4
with:
node-version: 20
node-version: 24
cache: "npm"
- name: npm install, lint, and test
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:

strategy:
matrix:
node-version: [18.x, 20.x, 21.x, 22.x]
node-version: [20.x, 21.x, 22.x, 23.x, 24.x]

steps:
- uses: actions/checkout@v4
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/vulnerabilities.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ jobs:

steps:
- uses: actions/checkout@v4
- name: Use Node.js 20
- name: Use Node.js 24
uses: actions/setup-node@v4
with:
node-version: 20
node-version: 24
cache: "npm"
- name: npm vulnerabilities
run: |
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
22.11.0
24
Empty file added coverage/.gitkeep
Empty file.
64 changes: 21 additions & 43 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,49 +1,27 @@
import globals from 'globals';
import pluginJs from '@eslint/js';
import jsdoc from 'eslint-plugin-jsdoc';
import stylisticJs from '@stylistic/eslint-plugin-js'
import sonarjs from 'eslint-plugin-sonarjs';
import globals from 'globals'
import { plugins, rules } from '@trojs/lint'

export default [
sonarjs.configs.recommended,
{

files: ['**/*.js'],
languageOptions: { globals: globals.node },

languageOptions: {
ecmaVersion: 'latest',

Copilot AI Jun 16, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Using 'latest' for ecmaVersion can expose the project to future breaking changes in ECMAScript standards. Consider pinning a specific version to maintain consistent behavior over time.

Suggested change
ecmaVersion: 'latest',
ecmaVersion: 2023,

Copilot uses AI. Check for mistakes.
sourceType: 'module',
globals: {
...globals.node,
...globals.es2024
}
},
settings: {
jsdoc: {
mode: 'typescript'
}
},
plugins: {
'@stylistic/js': stylisticJs,
jsdoc: jsdoc
...plugins
},
rules: {
'@stylistic/js/indent': ['error', 2],
'consistent-return': [
'error'
],
'no-param-reassign': [
'error',
{
'props': true,
'ignorePropertyModificationsFor': [
'acc',
'accumulator',
'e',
'req',
'request',
'res',
'response'
]
}
],
'quotes': [
'error',
'single',
{
'avoidEscape': true,
'allowTemplateLiterals': true
}
],
}
},
pluginJs.configs.recommended,
];
...rules.all
},
files: ['**/*.js']
}
]
Loading
Loading