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
2 changes: 0 additions & 2 deletions .github/workflows/license-header.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ jobs:

- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 10.27.0

- name: Install dependencies
run: pnpm install --frozen-lockfile
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,6 @@ jobs:

- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 10.27.0

- name: Install dependencies
run: pnpm install --frozen-lockfile
Expand Down
2 changes: 1 addition & 1 deletion apps/backend/src/utils/drizzle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export const enumType = <T extends readonly string[]>(values: T, name?: string)
return 'text';
},
toDriver(value) {
if (!values.includes(value as any)) {
if (!(values as readonly string[]).includes(value)) {
throw new Error(`Invalid enum value: ${value}. Allowed values are: ${values.join(', ')}`);
}
return value;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"turbo": "^2.9.3",
"typescript": "^6.0.2"
},
"packageManager": "pnpm@10.27.0",
"packageManager": "pnpm@10.33.0+sha512.10568bb4a6afb58c9eb3630da90cc9516417abebd3fabbe6739f0ae795728da1491e9db5a544c76ad8eb7570f5c4bb3d6c637b2cb41bfdcdb47fa823c8649319",
"engines": {
"node": ">=18"
},
Expand Down
31 changes: 24 additions & 7 deletions packages/eslint-config/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@
* SPDX-License-Identifier: AGPL-3.0-or-later
*/

import js from "@eslint/js";
import eslintConfigPrettier from "eslint-config-prettier";
import turboPlugin from "eslint-plugin-turbo";
import tseslint from "typescript-eslint";
import onlyWarn from "eslint-plugin-only-warn";
import js from '@eslint/js';
import eslintConfigPrettier from 'eslint-config-prettier';
import turboPlugin from 'eslint-plugin-turbo';
import tseslint from 'typescript-eslint';
import onlyWarn from 'eslint-plugin-only-warn';
import globals from 'globals';

/**
* A shared ESLint configuration for the repository.
Expand All @@ -18,12 +19,28 @@ export const config = [
js.configs.recommended,
eslintConfigPrettier,
...tseslint.configs.recommended,
{
languageOptions: {
globals: {
...globals.node,
},
},
rules: {
'@typescript-eslint/no-unused-vars': [
'warn',
{
argsIgnorePattern: '^_',
caughtErrorsIgnorePattern: '^_',
},
],
},
},
Comment on lines +22 to +37
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Check how downstream configs handle globals and whether they need Node globals

# Find all eslint config files that extend baseConfig
rg -l 'baseConfig' --glob '*.js' packages/eslint-config/

# Check if any frontend code references Node globals like process
rg -n '\bprocess\.' --type ts --type js -g '!node_modules' apps/ packages/ | head -30

Repository: TeamCoderz/WordyMe

Length of output: 451


🏁 Script executed:

#!/bin/bash

# Read the downstream config files that override globals
echo "=== react-internal.js ==="
cat packages/eslint-config/react-internal.js | head -50

echo -e "\n=== next.js ==="
cat packages/eslint-config/next.js | head -50

# Check ESLint config in apps/web (frontend)
echo -e "\n=== Apps/web ESLint config ==="
find apps/web -name 'eslint.config.*' -o -name '.eslintrc*' | xargs cat 2>/dev/null || echo "No eslintrc found in apps/web"

# Check ESLint config in apps/backend
echo -e "\n=== Apps/backend ESLint config ==="
find apps/backend -name 'eslint.config.*' -o -name '.eslintrc*' | xargs cat 2>/dev/null || echo "No eslintrc found in apps/backend"

# Check if there's a root ESLint config
echo -e "\n=== Root ESLint config ==="
cat eslint.config.js 2>/dev/null | head -100

Repository: TeamCoderz/WordyMe

Length of output: 2936


🏁 Script executed:

#!/bin/bash

# List all JS files in eslint-config
echo "=== All JS files in packages/eslint-config/ ==="
ls -la packages/eslint-config/*.js

# Search for vite in eslint-config directory
echo -e "\n=== Searching for 'vite' in eslint-config ==="
rg -i 'vite' packages/eslint-config/

# Check the full base.js to see what's exported
echo -e "\n=== Full base.js file ==="
cat packages/eslint-config/base.js

# Check what `@repo/eslint-config` exports
echo -e "\n=== Check package.json for eslint-config exports ==="
cat packages/eslint-config/package.json | grep -A 20 '"exports"'

Repository: TeamCoderz/WordyMe

Length of output: 2194


🏁 Script executed:

#!/bin/bash

# Read the full vite.js file
echo "=== Full vite.js file ==="
cat packages/eslint-config/vite.js

Repository: TeamCoderz/WordyMe

Length of output: 1221


Multiple globals configuration issues need attention.

The globals.node in base.js is properly set, but several downstream configs either override or omit it:

  1. vite.js is missing from package.json exportsapps/web imports @repo/eslint-config/vite but the export is not declared. This will cause module resolution failures.

  2. vite.js loses Node globals entirely — It sets globals: globals.browser only and does not spread baseConfig, so Node globals are unavailable. However, apps/web/vite.config.ts uses process.cwd() (line 10), which requires Node globals for linting.

  3. react-internal.js and next.js override Node globals — Both configs spread baseConfig but then replace languageOptions.globals with browser/serviceworker globals only. This is acceptable if these configs are used exclusively for frontend code that doesn't reference Node APIs.

Action items:

  • Add "./vite": "./vite.js" to package.json exports
  • Update vite.js to spread baseConfig or explicitly include ...globals.node alongside globals.browser
  • Verify that react-internal.js and next.js are not applied to any files needing Node globals (e.g., build config files)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/eslint-config/base.js` around lines 22 - 37, The package is missing
an export for the Vite ESLint config and the Vite config file drops Node
globals; add an export entry for "./vite": "./vite.js" in package.json exports,
and update vite.js (the config that currently sets languageOptions.globals =
globals.browser) to either spread the baseConfig (baseConfig) or explicitly
merge ...globals.node with globals.browser so Node globals (globals.node) are
available for files like apps/web/vite.config.ts that call process.cwd(); also
audit react-internal.js and next.js to ensure they are not applied to files that
need Node globals (or else merge Node globals similarly).

{
plugins: {
turbo: turboPlugin,
},
rules: {
"turbo/no-undeclared-env-vars": "warn",
'turbo/no-undeclared-env-vars': 'warn',
},
},
{
Expand All @@ -32,6 +49,6 @@ export const config = [
},
},
{
ignores: ["dist/**"],
ignores: ['dist/**'],
},
];
5 changes: 3 additions & 2 deletions packages/eslint-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
"exports": {
"./base": "./base.js",
"./next-js": "./next.js",
"./react-internal": "./react-internal.js"
"./react-internal": "./react-internal.js",
"./vite": "./vite.js"
},
"devDependencies": {
"@eslint/js": "^10.0.1",
Expand All @@ -19,6 +20,6 @@
"eslint-plugin-turbo": "^2.8.16",
"globals": "^17.4.0",
"typescript": "^6.0.2",
"typescript-eslint": "^8.57.0"
"typescript-eslint": "^8.58.2"
}
}
57 changes: 35 additions & 22 deletions packages/eslint-config/vite.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,33 +4,46 @@
*/

import js from '@eslint/js';
import { defineConfig } from 'eslint/config';
import globals from 'globals';
import reactHooks from 'eslint-plugin-react-hooks';
import reactRefresh from 'eslint-plugin-react-refresh';
import tseslint from 'typescript-eslint';
import pluginQuery from '@tanstack/eslint-plugin-query';

export default tseslint.config({
extends: [js.configs.recommended, ...tseslint.configs.recommended],
files: ['**/*.{ts,tsx}'],
ignores: ['dist'],
languageOptions: {
ecmaVersion: 2020,
globals: globals.browser,
export default defineConfig(
{
extends: [js.configs.recommended, ...tseslint.configs.recommended],
files: ['**/*.{ts,tsx}'],
ignores: ['dist'],
languageOptions: {
ecmaVersion: 2020,
globals: {
...globals.browser,
},
},
plugins: {
'react-hooks': reactHooks,
'react-refresh': reactRefresh,
'@tanstack/query': pluginQuery,
},
rules: {
...reactHooks.configs.recommended.rules,
'react-refresh/only-export-components': ['warn', { allowConstantExport: true }],
'react/react-in-jsx-scope': 'off',
'react/prop-types': 'off',
'react-hooks/exhaustive-deps': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-unused-vars': 'off',
'no-empty-pattern': 'off',
},
},
plugins: {
'react-hooks': reactHooks,
'react-refresh': reactRefresh,
'@tanstack/query': pluginQuery,
{
files: ['**/*.config.{js,mjs,cjs,ts,mts,cts}', '**/vite.config.{js,mjs,cjs,ts,mts,cts}'],
languageOptions: {
globals: {
...globals.node,
},
},
},
rules: {
...reactHooks.configs.recommended.rules,
'react-refresh/only-export-components': ['warn', { allowConstantExport: true }],
'react/react-in-jsx-scope': 'off',
'react/prop-types': 'off',
'react-hooks/exhaustive-deps': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-unused-vars': 'off',
'no-empty-pattern': 'off',
},
});
);
Loading
Loading