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
8 changes: 0 additions & 8 deletions packages/core-services/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,4 @@
{
"extends": ["@rocket.chat/eslint-config"],
"overrides": [
{
"files": ["**/*.spec.js", "**/*.spec.jsx"],
"env": {
"jest": true
}
}
],
"ignorePatterns": ["dist"]
}
3 changes: 0 additions & 3 deletions packages/core-services/babel.config.js

This file was deleted.

9 changes: 3 additions & 6 deletions packages/core-services/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@
"scripts": {
"build": "rm -rf dist && tsc",
"dev": "tsc --watch --preserveWatchOutput",
"lint": "eslint --ext .js,.jsx,.ts,.tsx .",
"lint:fix": "eslint --ext .js,.jsx,.ts,.tsx . --fix",
"lint": "eslint .",
"lint:fix": "eslint --fix .",
Comment on lines +13 to +14
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify ESLint configuration for Jest globals

# Check the base ESLint config for Jest support
echo "=== Checking @rocket.chat/eslint-config for Jest support ==="
find . -path "*/eslint-config*" -name "*.js" -o -path "*/eslint-config*" -name ".eslintrc*" 2>/dev/null | head -5
echo ""

# Look for @rocket.chat/eslint-config in packages
fd "eslint-config" -t d | head -5

# Check the main eslint-config directory
if [ -d "packages/eslint-config" ]; then
  echo "=== Contents of packages/eslint-config ==="
  ls -la packages/eslint-config/
  echo ""
  echo "=== Main config file ==="
  cat packages/eslint-config/index.js 2>/dev/null || cat packages/eslint-config/.eslintrc.json 2>/dev/null || echo "Not found"
fi

# Check packages/core-services ESLint configuration
echo -e "\n=== packages/core-services ESLint config ==="
if [ -d "packages/core-services" ]; then
  cat packages/core-services/.eslintrc.json 2>/dev/null || echo ".eslintrc.json not found"
fi

# Check root .eslintrc.json for Jest overrides
echo -e "\n=== Root .eslintrc.json (first 50 lines) ==="
head -50 .eslintrc.json 2>/dev/null || echo "Not found"

# Check if spec files exist in core-services
echo -e "\n=== Check for spec files in packages/core-services ==="
find packages/core-services -name "*.spec.ts" -o -name "*.spec.js" 2>/dev/null | head -10

Repository: RocketChat/Rocket.Chat

Length of output: 1589


🏁 Script executed:

#!/bin/bash
# Check the standard ESLint config content
echo "=== packages/eslint-config/standard/index.js ==="
cat packages/eslint-config/standard/index.js

# Check if other packages in monorepo have Jest spec files
echo -e "\n=== Packages with spec files in monorepo ==="
find packages ee/packages -name "*.spec.ts" -o -name "*.spec.js" 2>/dev/null | head -20

# Check ESLint config in one package that has spec files (if any)
echo -e "\n=== Checking for ESLint overrides in packages with tests ==="
for pkg in $(find packages ee/packages -maxdepth 2 -name ".eslintrc.json" | head -5); do
  if grep -l "files.*spec" "$pkg" 2>/dev/null; then
    echo "Found Jest override in: $pkg"
    cat "$pkg"
  fi
done

# Check if ee/packages/abac has Jest config
echo -e "\n=== ee/packages/abac/.eslintrc.json ==="
cat ee/packages/abac/.eslintrc.json 2>/dev/null || echo "Not found"

Repository: RocketChat/Rocket.Chat

Length of output: 5328


The simplified lint commands are appropriate. However, note that @rocket.chat/eslint-config does not include Jest globals support by default. If test files are added to this package in the future, ensure Jest globals (describe, it, expect, etc.) are either imported from @jest/globals in test files or configure ESLint overrides with Jest support.

🤖 Prompt for AI Agents
In packages/core-services/package.json around lines 13 to 14, the lint scripts
are fine but the project ESLint config (@rocket.chat/eslint-config) doesn't
enable Jest globals; to prepare for future test files either (A) add an ESLint
override in the package's ESLint config enabling the jest environment or adding
the recommended plugin/config for Jest so describe/it/expect are recognized, or
(B) ensure test files import Jest globals from @jest/globals; implement one of
these approaches to avoid lint errors when adding tests.

"test": "jest",
"testunit": "jest",
"typecheck": "tsc --noEmit"
},
Expand All @@ -28,15 +29,11 @@
"@rocket.chat/ui-kit": "workspace:~"
},
"devDependencies": {
"@babel/core": "~7.28.5",
"@babel/preset-env": "~7.28.5",
"@babel/preset-typescript": "~7.27.1",
"@rocket.chat/apps-engine": "workspace:^",
"@rocket.chat/eslint-config": "workspace:^",
"@rocket.chat/jest-presets": "workspace:~",
"@rocket.chat/tsconfig": "workspace:*",
"@types/jest": "~30.0.0",
"babel-jest": "~30.2.0",
"eslint": "~8.45.0",
"jest": "~30.2.0",
"mongodb": "6.16.0",
Expand Down
6 changes: 1 addition & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -8461,9 +8461,6 @@ __metadata:
version: 0.0.0-use.local
resolution: "@rocket.chat/core-services@workspace:packages/core-services"
dependencies:
"@babel/core": "npm:~7.28.5"
"@babel/preset-env": "npm:~7.28.5"
"@babel/preset-typescript": "npm:~7.27.1"
"@rocket.chat/apps-engine": "workspace:^"
"@rocket.chat/core-typings": "workspace:^"
"@rocket.chat/eslint-config": "workspace:^"
Expand All @@ -8479,7 +8476,6 @@ __metadata:
"@rocket.chat/tsconfig": "workspace:*"
"@rocket.chat/ui-kit": "workspace:~"
"@types/jest": "npm:~30.0.0"
babel-jest: "npm:~30.2.0"
eslint: "npm:~8.45.0"
jest: "npm:~30.2.0"
mongodb: "npm:6.16.0"
Expand Down Expand Up @@ -10797,7 +10793,7 @@ __metadata:
peerDependencies:
"@rocket.chat/layout": "*"
"@rocket.chat/tools": 0.2.3
"@rocket.chat/ui-contexts": 25.0.1
"@rocket.chat/ui-contexts": 25.0.2
"@tanstack/react-query": "*"
react: "*"
react-hook-form: "*"
Expand Down
Loading