mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-16 16:30:15 +01:00
* 🗑️ chore: Remove @microsoft/eslint-formatter-sarif from dependencies and update ESLint CI workflow
- Removed @microsoft/eslint-formatter-sarif from package.json and package-lock.json.
- Updated ESLint CI workflow to eliminate SARIF upload logic and related environment variables.
* chore: Remove ts-jest from dependencies in jest.config and package files
* chore: Update package dependencies to latest versions
- Upgraded @rollup/plugin-commonjs from 25.0.2 to 29.0.0 across multiple packages.
- Updated rimraf from 5.0.1 to 6.1.2 in packages/api, client, data-provider, and data-schemas.
- Added new dependencies: @isaacs/balanced-match and @isaacs/brace-expansion in package-lock.json.
- Updated glob from 8.1.0 to 13.0.0 and adjusted related dependencies accordingly.
* chore: remove prettier-eslint dependency from package.json
* chore: npm audit fix
* fix: correct `getBasePath` import
59 lines
No EOL
1.6 KiB
YAML
59 lines
No EOL
1.6 KiB
YAML
name: ESLint Code Quality Checks
|
|
|
|
on:
|
|
pull_request:
|
|
branches:
|
|
- main
|
|
- dev
|
|
- release/*
|
|
paths:
|
|
- 'api/**'
|
|
- 'client/**'
|
|
|
|
jobs:
|
|
eslint_checks:
|
|
name: Run ESLint Linting
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: read
|
|
security-events: write
|
|
actions: read
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Set up Node.js 20.x
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 20
|
|
cache: npm
|
|
|
|
- name: Install dependencies
|
|
run: npm ci
|
|
|
|
# Run ESLint on changed files within the api/ and client/ directories.
|
|
- name: Run ESLint on changed files
|
|
run: |
|
|
# Extract the base commit SHA from the pull_request event payload.
|
|
BASE_SHA=$(jq --raw-output .pull_request.base.sha "$GITHUB_EVENT_PATH")
|
|
echo "Base commit SHA: $BASE_SHA"
|
|
|
|
# Get changed files (only JS/TS files in api/ or client/)
|
|
CHANGED_FILES=$(git diff --name-only --diff-filter=ACMRTUXB "$BASE_SHA" HEAD | grep -E '^(api|client)/.*\.(js|jsx|ts|tsx)$' || true)
|
|
|
|
# Debug output
|
|
echo "Changed files:"
|
|
echo "$CHANGED_FILES"
|
|
|
|
# Ensure there are files to lint before running ESLint
|
|
if [[ -z "$CHANGED_FILES" ]]; then
|
|
echo "No matching files changed. Skipping ESLint."
|
|
exit 0
|
|
fi
|
|
|
|
# Run ESLint
|
|
npx eslint --no-error-on-unmatched-pattern \
|
|
--config eslint.config.mjs \
|
|
$CHANGED_FILES |