-
Notifications
You must be signed in to change notification settings - Fork 0
feat: Add globals support to ESLint #666
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🦋 Changeset detectedLatest commit: f56dd4c The changes in this PR will be included in the next version bump. This PR includes changesets to release 18 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
WalkthroughAdds ESLint global environment support via the globals package across configs and generators, wires a TPL_GLOBALS variable into templates, adds globals dependencies to relevant packages, inserts eslint-disable comments for document.cookie in sidebar components, and updates documentation by moving content to AGENTS.md and pointing CLAUDE.md to it. Adds two changesets. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests
Tip 👮 Agentic pre-merge checks are now available in preview!Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.
Please see the documentation for more information. Example: reviews:
pre_merge_checks:
custom_checks:
- name: "Undocumented Breaking Changes"
mode: "warning"
instructions: |
Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal).Please share your feedback with us on this Discord post. Comment |
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
🧹 Nitpick comments (9)
examples/todo-with-auth0/packages/web/src/components/ui/sidebar.tsx (1)
97-99: Fix typo in ESLint disable commentSpelling: “compatability” → “compatibility”.
- // eslint-disable-next-line unicorn/no-document-cookie -- to ensure browser compatability + // eslint-disable-next-line unicorn/no-document-cookie -- to ensure browser compatibilityCLAUDE.md (1)
1-1: Make the reference clickable for GitHub readers.Use a relative markdown link so it renders as a link on GitHub.
-See @AGENTS.md +See ./AGENTS.mdpackages/ui-components/src/components/ui/sidebar/sidebar.tsx (1)
96-98: Fix typo in ESLint disable note; optionally add SameSite for cookie.
- Correct “compatability” → “compatibility”.
- Optional hardening: explicitly set SameSite to Lax for this preference cookie.
- // eslint-disable-next-line unicorn/no-document-cookie -- to ensure browser compatability + // eslint-disable-next-line unicorn/no-document-cookie -- to ensure browser compatibility - document.cookie = `${SIDEBAR_COOKIE_NAME}=${openState}; path=/; max-age=${SIDEBAR_COOKIE_MAX_AGE}`; + document.cookie = `${SIDEBAR_COOKIE_NAME}=${openState}; path=/; max-age=${SIDEBAR_COOKIE_MAX_AGE}; SameSite=Lax`;examples/todo-with-auth0/packages/admin/src/components/ui/sidebar.tsx (1)
96-99: Fix typo in ESLint disable note; optionally add SameSite for cookie.Same adjustments as in the shared UI component.
- // eslint-disable-next-line unicorn/no-document-cookie -- to ensure browser compatability + // eslint-disable-next-line unicorn/no-document-cookie -- to ensure browser compatibility - document.cookie = `${SIDEBAR_COOKIE_NAME}=${openState}; path=/; max-age=${SIDEBAR_COOKIE_MAX_AGE}`; + document.cookie = `${SIDEBAR_COOKIE_NAME}=${openState}; path=/; max-age=${SIDEBAR_COOKIE_MAX_AGE}; SameSite=Lax`;packages/react-generators/src/generators/core/react-components/templates/components/ui/sidebar.tsx (1)
96-99: Fix typo in template so generated code inherits the correct wording.Update the comment spelling here to avoid propagating it to new projects.
- // eslint-disable-next-line unicorn/no-document-cookie -- to ensure browser compatability + // eslint-disable-next-line unicorn/no-document-cookie -- to ensure browser compatibilityexamples/blog-with-auth/packages/admin/src/components/ui/sidebar.tsx (1)
96-99: Fix typo in ESLint disable note; optionally add SameSite for cookie.Mirror the same improvements as the other sidebar files.
- // eslint-disable-next-line unicorn/no-document-cookie -- to ensure browser compatability + // eslint-disable-next-line unicorn/no-document-cookie -- to ensure browser compatibility - document.cookie = `${SIDEBAR_COOKIE_NAME}=${openState}; path=/; max-age=${SIDEBAR_COOKIE_MAX_AGE}`; + document.cookie = `${SIDEBAR_COOKIE_NAME}=${openState}; path=/; max-age=${SIDEBAR_COOKIE_MAX_AGE}; SameSite=Lax`;AGENTS.md (1)
1-1: Fix heading mismatch.File is AGENTS.md but the H1 says “CLAUDE.md”. Update the title.
-# CLAUDE.md +# AGENTS.mdAlso consider renaming to kebab-case (
agents.md) for consistency with repo naming, if not constrained by external tooling.packages/core-generators/src/generators/node/eslint/templates/eslint.config.js (1)
9-9: Template substitution forTPL_GLOBALS—ensure raw identifier, not a quoted string.If the renderer injects strings,
...globals.'browser'would break. Prefer the comment placeholder style used elsewhere for safety.Apply:
- globals: { - ...globals.TPL_GLOBALS, - }, + globals: { + ...globals./* TPL_GLOBALS:START */ node /* TPL_GLOBALS:END */, + },If keeping the bare token approach, please confirm the rendered files contain
...globals.browser/...globals.node(no quotes).Also applies to: 29-33
examples/todo-with-auth0/packages/web/eslint.config.js (1)
28-36: Duplicate ignore entry.
src/generated/graphql.tsxappears twice. Remove one to avoid churn in future diffs.Apply:
const IGNORE_FILES = /* TPL_IGNORE_FILES:START */ [ 'baseplate', 'build', 'dist', 'node_modules', - 'src/generated/graphql.tsx', 'src/generated/graphql.tsx', 'src/route-tree.gen.ts', ]; /* TPL_IGNORE_FILES:END */
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
⛔ Files ignored due to path filters (17)
examples/blog-with-auth/packages/admin/baseplate/generated/eslint.config.jsis excluded by!**/generated/**,!**/generated/**examples/blog-with-auth/packages/admin/baseplate/generated/package.jsonis excluded by!**/generated/**,!**/generated/**examples/blog-with-auth/packages/admin/baseplate/generated/src/components/ui/sidebar.tsxis excluded by!**/generated/**,!**/generated/**examples/blog-with-auth/packages/backend/baseplate/generated/eslint.config.mjsis excluded by!**/generated/**,!**/generated/**examples/blog-with-auth/packages/backend/baseplate/generated/package.jsonis excluded by!**/generated/**,!**/generated/**examples/blog-with-auth/pnpm-lock.yamlis excluded by!**/pnpm-lock.yamlexamples/todo-with-auth0/packages/admin/baseplate/generated/eslint.config.jsis excluded by!**/generated/**,!**/generated/**examples/todo-with-auth0/packages/admin/baseplate/generated/package.jsonis excluded by!**/generated/**,!**/generated/**examples/todo-with-auth0/packages/admin/baseplate/generated/src/components/ui/sidebar.tsxis excluded by!**/generated/**,!**/generated/**examples/todo-with-auth0/packages/backend/baseplate/generated/eslint.config.mjsis excluded by!**/generated/**,!**/generated/**examples/todo-with-auth0/packages/backend/baseplate/generated/package.jsonis excluded by!**/generated/**,!**/generated/**examples/todo-with-auth0/packages/web/baseplate/generated/eslint.config.jsis excluded by!**/generated/**,!**/generated/**examples/todo-with-auth0/packages/web/baseplate/generated/package.jsonis excluded by!**/generated/**,!**/generated/**examples/todo-with-auth0/packages/web/baseplate/generated/src/components/ui/sidebar.tsxis excluded by!**/generated/**,!**/generated/**examples/todo-with-auth0/pnpm-lock.yamlis excluded by!**/pnpm-lock.yamlpackages/core-generators/src/generators/node/eslint/generated/typed-templates.tsis excluded by!**/generated/**,!**/generated/**pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (26)
.changeset/eslint-globals-support.md(1 hunks).changeset/sidebar-eslint-disable.md(1 hunks)AGENTS.md(1 hunks)CLAUDE.md(1 hunks)examples/blog-with-auth/packages/admin/eslint.config.js(2 hunks)examples/blog-with-auth/packages/admin/package.json(1 hunks)examples/blog-with-auth/packages/admin/src/components/ui/sidebar.tsx(1 hunks)examples/blog-with-auth/packages/backend/eslint.config.mjs(2 hunks)examples/blog-with-auth/packages/backend/package.json(1 hunks)examples/todo-with-auth0/packages/admin/eslint.config.js(2 hunks)examples/todo-with-auth0/packages/admin/package.json(1 hunks)examples/todo-with-auth0/packages/admin/src/components/ui/sidebar.tsx(1 hunks)examples/todo-with-auth0/packages/backend/eslint.config.mjs(2 hunks)examples/todo-with-auth0/packages/backend/package.json(1 hunks)examples/todo-with-auth0/packages/web/eslint.config.js(2 hunks)examples/todo-with-auth0/packages/web/package.json(1 hunks)examples/todo-with-auth0/packages/web/src/components/ui/sidebar.tsx(1 hunks)packages/core-generators/src/constants/core-packages.ts(1 hunks)packages/core-generators/src/generators/node/eslint/eslint.generator.ts(2 hunks)packages/core-generators/src/generators/node/eslint/extractor.json(1 hunks)packages/core-generators/src/generators/node/eslint/templates/eslint.config.js(2 hunks)packages/react-generators/src/generators/core/react-components/templates/components/ui/sidebar.tsx(1 hunks)packages/tools/eslint-configs/react.js(2 hunks)packages/tools/eslint-configs/typescript.js(2 hunks)packages/tools/package.json(1 hunks)packages/ui-components/src/components/ui/sidebar/sidebar.tsx(1 hunks)
🧰 Additional context used
📓 Path-based instructions (13)
**/*.{ts,tsx}
📄 CodeRabbit inference engine (.cursor/rules/code-style.mdc)
**/*.{ts,tsx}: TypeScript with strict type checking
Always include return types on top-level functions including React components (React.ReactElement)
Include absolute paths in import statements via tsconfig paths (@src/is the alias forsrc/)
If a particular interface or type is not exported, change the file so it is exported
Files:
packages/ui-components/src/components/ui/sidebar/sidebar.tsxexamples/todo-with-auth0/packages/admin/src/components/ui/sidebar.tsxpackages/react-generators/src/generators/core/react-components/templates/components/ui/sidebar.tsxexamples/blog-with-auth/packages/admin/src/components/ui/sidebar.tsxpackages/core-generators/src/constants/core-packages.tspackages/core-generators/src/generators/node/eslint/eslint.generator.tsexamples/todo-with-auth0/packages/web/src/components/ui/sidebar.tsx
**/*.{js,ts,tsx}
📄 CodeRabbit inference engine (.cursor/rules/code-style.mdc)
Node 16 module resolution - include file extensions in imports (
.js)
Files:
packages/ui-components/src/components/ui/sidebar/sidebar.tsxexamples/todo-with-auth0/packages/admin/src/components/ui/sidebar.tsxpackages/react-generators/src/generators/core/react-components/templates/components/ui/sidebar.tsxexamples/blog-with-auth/packages/admin/src/components/ui/sidebar.tsxpackages/tools/eslint-configs/typescript.jspackages/core-generators/src/constants/core-packages.tsexamples/blog-with-auth/packages/admin/eslint.config.jspackages/core-generators/src/generators/node/eslint/eslint.generator.tsexamples/todo-with-auth0/packages/web/eslint.config.jspackages/tools/eslint-configs/react.jsexamples/todo-with-auth0/packages/admin/eslint.config.jspackages/core-generators/src/generators/node/eslint/templates/eslint.config.jsexamples/todo-with-auth0/packages/web/src/components/ui/sidebar.tsx
**/*.{ts,tsx,js}
📄 CodeRabbit inference engine (.cursor/rules/code-style.mdc)
**/*.{ts,tsx,js}: Sort imports by group: external libs first, then local imports
Use camelCase for variables/functions, PascalCase for types/classes
Order functions such that functions are placed below the variables/functions they use
We use the prefer using nullish coalescing operator (??) ESLint rule instead of a logical or (||), as it is a safer operator
Use console.info/warn/error instead of console.log
Files:
packages/ui-components/src/components/ui/sidebar/sidebar.tsxexamples/todo-with-auth0/packages/admin/src/components/ui/sidebar.tsxpackages/react-generators/src/generators/core/react-components/templates/components/ui/sidebar.tsxexamples/blog-with-auth/packages/admin/src/components/ui/sidebar.tsxpackages/tools/eslint-configs/typescript.jspackages/core-generators/src/constants/core-packages.tsexamples/blog-with-auth/packages/admin/eslint.config.jspackages/core-generators/src/generators/node/eslint/eslint.generator.tsexamples/todo-with-auth0/packages/web/eslint.config.jspackages/tools/eslint-configs/react.jsexamples/todo-with-auth0/packages/admin/eslint.config.jspackages/core-generators/src/generators/node/eslint/templates/eslint.config.jsexamples/todo-with-auth0/packages/web/src/components/ui/sidebar.tsx
**/*
📄 CodeRabbit inference engine (.cursor/rules/code-style.mdc)
Use kebab-case for file names
Files:
packages/ui-components/src/components/ui/sidebar/sidebar.tsxexamples/blog-with-auth/packages/backend/package.jsonexamples/todo-with-auth0/packages/admin/src/components/ui/sidebar.tsxexamples/blog-with-auth/packages/admin/package.jsonpackages/core-generators/src/generators/node/eslint/extractor.jsonpackages/react-generators/src/generators/core/react-components/templates/components/ui/sidebar.tsxexamples/blog-with-auth/packages/admin/src/components/ui/sidebar.tsxpackages/tools/eslint-configs/typescript.jspackages/tools/package.jsonexamples/todo-with-auth0/packages/backend/package.jsonpackages/core-generators/src/constants/core-packages.tsexamples/blog-with-auth/packages/admin/eslint.config.jsexamples/todo-with-auth0/packages/backend/eslint.config.mjsexamples/todo-with-auth0/packages/admin/package.jsonAGENTS.mdexamples/todo-with-auth0/packages/web/package.jsonpackages/core-generators/src/generators/node/eslint/eslint.generator.tsexamples/todo-with-auth0/packages/web/eslint.config.jspackages/tools/eslint-configs/react.jsCLAUDE.mdexamples/todo-with-auth0/packages/admin/eslint.config.jsexamples/blog-with-auth/packages/backend/eslint.config.mjspackages/core-generators/src/generators/node/eslint/templates/eslint.config.jsexamples/todo-with-auth0/packages/web/src/components/ui/sidebar.tsx
{packages/project-builder-web/**,packages/ui-components/**}/*.tsx
📄 CodeRabbit inference engine (.cursor/rules/ui-rules.mdc)
{packages/project-builder-web/**,packages/ui-components/**}/*.tsx: Use ShadCN-based components from@baseplate-dev/ui-componentsand always prefer these components over creating custom ones
Use Tailwind CSS utilities exclusively for styling; avoid writing custom CSS classes and use Tailwind's utility classes for all styling needs
In plugins, prefix all Tailwind classes with the plugin name (e.g.,auth-,storage-)
Use icons fromreact-icons/md(Material Design icons) and import them likeimport { MdAdd, MdDelete } from 'react-icons/md'; avoid using other icon libraries
Files:
packages/ui-components/src/components/ui/sidebar/sidebar.tsx
{packages,plugins,examples}/**/*.{ts,tsx}
📄 CodeRabbit inference engine (CLAUDE.md)
If a particular interface or type is not exported, update the file so it is exported
Files:
packages/ui-components/src/components/ui/sidebar/sidebar.tsxexamples/todo-with-auth0/packages/admin/src/components/ui/sidebar.tsxpackages/react-generators/src/generators/core/react-components/templates/components/ui/sidebar.tsxexamples/blog-with-auth/packages/admin/src/components/ui/sidebar.tsxpackages/core-generators/src/constants/core-packages.tspackages/core-generators/src/generators/node/eslint/eslint.generator.tsexamples/todo-with-auth0/packages/web/src/components/ui/sidebar.tsx
.changeset/*.md
📄 CodeRabbit inference engine (CLAUDE.md)
When adding or changing a feature, add a new Changeset in
.changeset/using the provided frontmatter format with patch changes
Files:
.changeset/eslint-globals-support.md.changeset/sidebar-eslint-disable.md
examples/blog-with-auth/{package.json,packages/**/package.json}
📄 CodeRabbit inference engine (examples/blog-with-auth/CLAUDE.md)
Use ESM only by setting
"type": "module"in package.json
Files:
examples/blog-with-auth/packages/backend/package.jsonexamples/blog-with-auth/packages/admin/package.json
examples/todo-with-auth0/packages/{admin,backend}/src/**/*.{ts,tsx}
📄 CodeRabbit inference engine (examples/todo-with-auth0/CLAUDE.md)
examples/todo-with-auth0/packages/{admin,backend}/src/**/*.{ts,tsx}: Always use .js extensions in import statements, even when importing from TypeScript files
Useimport typefor type-only imports in TypeScript
Always specify explicit return types for all functions
Files:
examples/todo-with-auth0/packages/admin/src/components/ui/sidebar.tsx
examples/todo-with-auth0/{packages/admin/src/{app,components,pages,hooks,services}/**/*.{ts,tsx},packages/backend/src/{modules,plugins,prisma,services,utils}/**/*.{ts,tsx}}
📄 CodeRabbit inference engine (examples/todo-with-auth0/CLAUDE.md)
Add JSDoc to all exported functions, interfaces, and classes including descriptions, params, returns, and fields (exclude generated code)
Files:
examples/todo-with-auth0/packages/admin/src/components/ui/sidebar.tsx
packages/{core-generators,react-generators,fastify-generators}/**/*.{ts,tsx}
📄 CodeRabbit inference engine (CLAUDE.md)
packages/{core-generators,react-generators,fastify-generators}/**/*.{ts,tsx}: Define generators withcreateGeneratorand configure them via a Zod descriptor schema
Create tasks withcreateGeneratorTaskimplementingrun(init) andbuild(code generation) phases
Export and consume providers explicitly and use provider scopes to control visibility and avoid collisions
Use the TypeScript rendering system (TsCodeFragment,TsCodeUtils, and the import builder) for code generation
Organize complex generation using Task Phases for ordered execution
Use Dynamic Tasks for data-driven generation where appropriate
Files:
packages/react-generators/src/generators/core/react-components/templates/components/ui/sidebar.tsxpackages/core-generators/src/constants/core-packages.tspackages/core-generators/src/generators/node/eslint/eslint.generator.ts
examples/blog-with-auth/packages/**/src/**/*.{ts,tsx}
📄 CodeRabbit inference engine (examples/blog-with-auth/CLAUDE.md)
examples/blog-with-auth/packages/**/src/**/*.{ts,tsx}: Always use .js extensions in import statements (even when importing from TypeScript files)
Useimport typefor type-only imports
Always specify explicit return types for all functions
Add JSDoc to all exported functions, interfaces, and classes (document parameters, return values, and fields)
Files:
examples/blog-with-auth/packages/admin/src/components/ui/sidebar.tsx
examples/todo-with-auth0/{package.json,packages/**/package.json}
📄 CodeRabbit inference engine (examples/todo-with-auth0/CLAUDE.md)
examples/todo-with-auth0/{package.json,packages/**/package.json}: Module system must be ESM only ("type": "module"in package.json)
Package manager is pnpm 10+ (enforce viapackageManagerfield)
Node version 22+ with Volta pinned to 22.18.0
Files:
examples/todo-with-auth0/packages/backend/package.jsonexamples/todo-with-auth0/packages/admin/package.jsonexamples/todo-with-auth0/packages/web/package.json
🧠 Learnings (23)
📚 Learning: 2025-09-03T17:03:33.250Z
Learnt from: CR
PR: halfdomelabs/baseplate#0
File: examples/todo-with-auth0/CLAUDE.md:0-0
Timestamp: 2025-09-03T17:03:33.250Z
Learning: Applies to examples/todo-with-auth0/{package.json,packages/**/package.json} : Node version 22+ with Volta pinned to 22.18.0
Applied to files:
examples/blog-with-auth/packages/backend/package.jsonexamples/blog-with-auth/packages/admin/package.jsonexamples/todo-with-auth0/packages/backend/package.jsonexamples/todo-with-auth0/packages/backend/eslint.config.mjsexamples/todo-with-auth0/packages/admin/package.jsonexamples/todo-with-auth0/packages/web/package.json
📚 Learning: 2025-07-22T09:10:31.413Z
Learnt from: CR
PR: halfdomelabs/baseplate#0
File: .cursor/rules/code-style.mdc:0-0
Timestamp: 2025-07-22T09:10:31.413Z
Learning: Applies to **/*.{js,ts,tsx} : Node 16 module resolution - include file extensions in imports (`.js`)
Applied to files:
packages/tools/eslint-configs/typescript.js
📚 Learning: 2025-07-22T09:10:31.413Z
Learnt from: CR
PR: halfdomelabs/baseplate#0
File: .cursor/rules/code-style.mdc:0-0
Timestamp: 2025-07-22T09:10:31.413Z
Learning: Applies to **/*.{ts,tsx} : Include absolute paths in import statements via tsconfig paths (`src/` is the alias for `src/`)
Applied to files:
packages/tools/eslint-configs/typescript.js
📚 Learning: 2025-09-12T13:36:14.111Z
Learnt from: CR
PR: halfdomelabs/baseplate#0
File: CLAUDE.md:0-0
Timestamp: 2025-09-12T13:36:14.111Z
Learning: Applies to {packages,plugins,examples}/**/*.{ts,tsx} : If a particular interface or type is not exported, update the file so it is exported
Applied to files:
packages/tools/eslint-configs/typescript.jsexamples/todo-with-auth0/packages/admin/eslint.config.js
📚 Learning: 2025-07-22T09:10:31.413Z
Learnt from: CR
PR: halfdomelabs/baseplate#0
File: .cursor/rules/code-style.mdc:0-0
Timestamp: 2025-07-22T09:10:31.413Z
Learning: Applies to **/*.{ts,tsx} : If a particular interface or type is not exported, change the file so it is exported
Applied to files:
packages/tools/eslint-configs/typescript.js
📚 Learning: 2025-07-22T09:10:31.413Z
Learnt from: CR
PR: halfdomelabs/baseplate#0
File: .cursor/rules/code-style.mdc:0-0
Timestamp: 2025-07-22T09:10:31.413Z
Learning: Applies to **/*.test.ts : Always import vitest globals explicitly (describe, it, expect)
Applied to files:
packages/tools/eslint-configs/typescript.jsexamples/todo-with-auth0/packages/backend/eslint.config.mjsexamples/blog-with-auth/packages/backend/eslint.config.mjspackages/core-generators/src/generators/node/eslint/templates/eslint.config.js
📚 Learning: 2025-07-22T09:10:31.413Z
Learnt from: CR
PR: halfdomelabs/baseplate#0
File: .cursor/rules/code-style.mdc:0-0
Timestamp: 2025-07-22T09:10:31.413Z
Learning: Applies to **/*.{ts,tsx} : TypeScript with strict type checking
Applied to files:
packages/tools/eslint-configs/typescript.js
📚 Learning: 2025-09-03T17:03:33.250Z
Learnt from: CR
PR: halfdomelabs/baseplate#0
File: examples/todo-with-auth0/CLAUDE.md:0-0
Timestamp: 2025-09-03T17:03:33.250Z
Learning: Applies to examples/todo-with-auth0/packages/**/tsconfig*.json : Use TypeScript moduleResolution set to `NodeNext` (ESM)
Applied to files:
packages/tools/eslint-configs/typescript.jsexamples/todo-with-auth0/packages/backend/eslint.config.mjsexamples/todo-with-auth0/packages/web/eslint.config.jsexamples/todo-with-auth0/packages/admin/eslint.config.js
📚 Learning: 2025-09-12T13:36:14.111Z
Learnt from: CR
PR: halfdomelabs/baseplate#0
File: CLAUDE.md:0-0
Timestamp: 2025-09-12T13:36:14.111Z
Learning: Applies to packages/{core-generators,react-generators,fastify-generators}/**/*.{ts,tsx} : Use the TypeScript rendering system (`TsCodeFragment`, `TsCodeUtils`, and the import builder) for code generation
Applied to files:
packages/tools/eslint-configs/typescript.jspackages/core-generators/src/generators/node/eslint/eslint.generator.tspackages/core-generators/src/generators/node/eslint/templates/eslint.config.js
📚 Learning: 2025-09-03T17:03:33.250Z
Learnt from: CR
PR: halfdomelabs/baseplate#0
File: examples/todo-with-auth0/CLAUDE.md:0-0
Timestamp: 2025-09-03T17:03:33.250Z
Learning: Applies to examples/todo-with-auth0/packages/{admin,backend}/src/**/*.{ts,tsx} : Use `import type` for type-only imports in TypeScript
Applied to files:
packages/tools/eslint-configs/typescript.jsexamples/todo-with-auth0/packages/backend/eslint.config.mjsexamples/todo-with-auth0/packages/web/eslint.config.jsexamples/todo-with-auth0/packages/admin/eslint.config.jsexamples/blog-with-auth/packages/backend/eslint.config.mjs
📚 Learning: 2025-09-03T17:03:33.250Z
Learnt from: CR
PR: halfdomelabs/baseplate#0
File: examples/todo-with-auth0/CLAUDE.md:0-0
Timestamp: 2025-09-03T17:03:33.250Z
Learning: Applies to examples/todo-with-auth0/{package.json,packages/**/package.json} : Package manager is pnpm 10+ (enforce via `packageManager` field)
Applied to files:
examples/todo-with-auth0/packages/backend/package.jsonexamples/todo-with-auth0/packages/admin/package.jsonexamples/todo-with-auth0/packages/web/package.json
📚 Learning: 2025-09-03T17:03:33.250Z
Learnt from: CR
PR: halfdomelabs/baseplate#0
File: examples/todo-with-auth0/CLAUDE.md:0-0
Timestamp: 2025-09-03T17:03:33.250Z
Learning: Applies to examples/todo-with-auth0/packages/{admin,backend}/src/**/*.{unit,int}.test.ts : Vitest: do not use globals; import `describe`, `it`, and `expect` from `vitest`
Applied to files:
examples/todo-with-auth0/packages/backend/package.jsonexamples/blog-with-auth/packages/admin/eslint.config.jsexamples/todo-with-auth0/packages/backend/eslint.config.mjsexamples/todo-with-auth0/packages/admin/package.jsonexamples/todo-with-auth0/packages/web/package.jsonexamples/todo-with-auth0/packages/web/eslint.config.jsexamples/todo-with-auth0/packages/admin/eslint.config.jsexamples/blog-with-auth/packages/backend/eslint.config.mjs
📚 Learning: 2025-09-03T17:03:33.250Z
Learnt from: CR
PR: halfdomelabs/baseplate#0
File: examples/todo-with-auth0/CLAUDE.md:0-0
Timestamp: 2025-09-03T17:03:33.250Z
Learning: Applies to examples/todo-with-auth0/{package.json,packages/**/package.json} : Module system must be ESM only (`"type": "module"` in package.json)
Applied to files:
examples/todo-with-auth0/packages/backend/package.jsonexamples/todo-with-auth0/packages/backend/eslint.config.mjsexamples/todo-with-auth0/packages/web/package.jsonexamples/todo-with-auth0/packages/web/eslint.config.jsexamples/todo-with-auth0/packages/admin/eslint.config.js
📚 Learning: 2025-09-12T13:36:14.111Z
Learnt from: CR
PR: halfdomelabs/baseplate#0
File: CLAUDE.md:0-0
Timestamp: 2025-09-12T13:36:14.111Z
Learning: Applies to packages/{core-generators,react-generators,fastify-generators}/**/*.{ts,tsx} : Export and consume providers explicitly and use provider scopes to control visibility and avoid collisions
Applied to files:
packages/core-generators/src/constants/core-packages.tspackages/core-generators/src/generators/node/eslint/eslint.generator.tsexamples/todo-with-auth0/packages/web/eslint.config.jspackages/core-generators/src/generators/node/eslint/templates/eslint.config.js
📚 Learning: 2025-09-03T17:02:31.412Z
Learnt from: CR
PR: halfdomelabs/baseplate#0
File: examples/blog-with-auth/CLAUDE.md:0-0
Timestamp: 2025-09-03T17:02:31.412Z
Learning: Applies to examples/blog-with-auth/{tsconfig*.json,packages/**/tsconfig*.json} : Use `moduleResolution: "NodeNext"` (ESM-aware resolution)
Applied to files:
examples/blog-with-auth/packages/admin/eslint.config.jsexamples/todo-with-auth0/packages/backend/eslint.config.mjsexamples/todo-with-auth0/packages/web/eslint.config.jsexamples/todo-with-auth0/packages/admin/eslint.config.jsexamples/blog-with-auth/packages/backend/eslint.config.mjs
📚 Learning: 2025-07-30T13:27:20.000Z
Learnt from: kingston
PR: halfdomelabs/baseplate#623
File: plugins/plugin-auth/src/local-auth/core/generators/react-session/templates/src/app/user-session-provider.tsx:6-12
Timestamp: 2025-07-30T13:27:20.000Z
Learning: Ignore ESLint import ordering rules for files in templates/** directories as these are code generation templates, not direct source code.
Applied to files:
examples/blog-with-auth/packages/admin/eslint.config.jsexamples/todo-with-auth0/packages/backend/eslint.config.mjspackages/core-generators/src/generators/node/eslint/eslint.generator.tsexamples/todo-with-auth0/packages/web/eslint.config.jsexamples/todo-with-auth0/packages/admin/eslint.config.jsexamples/blog-with-auth/packages/backend/eslint.config.mjspackages/core-generators/src/generators/node/eslint/templates/eslint.config.js
📚 Learning: 2025-09-03T17:03:33.250Z
Learnt from: CR
PR: halfdomelabs/baseplate#0
File: examples/todo-with-auth0/CLAUDE.md:0-0
Timestamp: 2025-09-03T17:03:33.250Z
Learning: Applies to examples/todo-with-auth0/{packages/admin/src/{app,components,pages,hooks,services}/**/*.{ts,tsx},packages/backend/src/{modules,plugins,prisma,services,utils}/**/*.{ts,tsx}} : Add JSDoc to all exported functions, interfaces, and classes including descriptions, params, returns, and fields (exclude generated code)
Applied to files:
examples/todo-with-auth0/packages/backend/eslint.config.mjsexamples/todo-with-auth0/packages/admin/eslint.config.js
📚 Learning: 2025-09-03T17:03:33.250Z
Learnt from: CR
PR: halfdomelabs/baseplate#0
File: examples/todo-with-auth0/CLAUDE.md:0-0
Timestamp: 2025-09-03T17:03:33.250Z
Learning: Applies to examples/todo-with-auth0/packages/**/tsconfig*.json : Enable strict type checking (`"strict": true`)
Applied to files:
examples/todo-with-auth0/packages/backend/eslint.config.mjsexamples/todo-with-auth0/packages/web/eslint.config.jsexamples/todo-with-auth0/packages/admin/eslint.config.js
📚 Learning: 2025-09-03T17:03:33.250Z
Learnt from: CR
PR: halfdomelabs/baseplate#0
File: examples/todo-with-auth0/CLAUDE.md:0-0
Timestamp: 2025-09-03T17:03:33.250Z
Learning: Applies to examples/todo-with-auth0/packages/**/tsconfig*.json : Enable `isolatedModules` in TypeScript configuration
Applied to files:
examples/todo-with-auth0/packages/backend/eslint.config.mjsexamples/todo-with-auth0/packages/web/eslint.config.jsexamples/todo-with-auth0/packages/admin/eslint.config.js
📚 Learning: 2025-09-03T17:03:33.250Z
Learnt from: CR
PR: halfdomelabs/baseplate#0
File: examples/todo-with-auth0/CLAUDE.md:0-0
Timestamp: 2025-09-03T17:03:33.250Z
Learning: Applies to examples/todo-with-auth0/packages/{admin,backend}/src/**/*.{ts,tsx} : Always use .js extensions in import statements, even when importing from TypeScript files
Applied to files:
examples/todo-with-auth0/packages/web/eslint.config.jsexamples/todo-with-auth0/packages/admin/eslint.config.js
📚 Learning: 2025-09-03T17:02:31.412Z
Learnt from: CR
PR: halfdomelabs/baseplate#0
File: examples/blog-with-auth/CLAUDE.md:0-0
Timestamp: 2025-09-03T17:02:31.412Z
Learning: Applies to examples/blog-with-auth/packages/**/src/**/*.{ts,tsx} : Use `import type` for type-only imports
Applied to files:
examples/todo-with-auth0/packages/web/eslint.config.jsexamples/blog-with-auth/packages/backend/eslint.config.mjs
📚 Learning: 2025-09-03T17:02:31.412Z
Learnt from: CR
PR: halfdomelabs/baseplate#0
File: examples/blog-with-auth/CLAUDE.md:0-0
Timestamp: 2025-09-03T17:02:31.412Z
Learning: Applies to examples/blog-with-auth/{package.json,packages/**/package.json} : Use ESM only by setting `"type": "module"` in package.json
Applied to files:
examples/blog-with-auth/packages/backend/eslint.config.mjs
📚 Learning: 2025-09-03T17:02:31.412Z
Learnt from: CR
PR: halfdomelabs/baseplate#0
File: examples/blog-with-auth/CLAUDE.md:0-0
Timestamp: 2025-09-03T17:02:31.412Z
Learning: Applies to examples/blog-with-auth/packages/**/src/**/*.{ts,tsx} : Add JSDoc to all exported functions, interfaces, and classes (document parameters, return values, and fields)
Applied to files:
examples/blog-with-auth/packages/backend/eslint.config.mjs
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (8)
- GitHub Check: Lint Examples (blog-with-auth)
- GitHub Check: Lint Examples (todo-with-auth0)
- GitHub Check: Verify Sync (blog-with-auth)
- GitHub Check: Verify Sync (todo-with-auth0)
- GitHub Check: Socket Security: Pull Request Alerts
- GitHub Check: Lint
- GitHub Check: Test E2E
- GitHub Check: test
🔇 Additional comments (20)
packages/tools/package.json (1)
73-73: Addingglobalsto tools deps is correctESLint configs here import
globals, so keeping it independencies(not dev) is right for downstream consumers. No further action.examples/blog-with-auth/packages/admin/package.json (1)
80-80: LGTM: addglobalsdevDependencyMatches ESLint config usage in this package. Nothing else needed.
examples/blog-with-auth/packages/backend/package.json (1)
77-77: LGTM: addglobalsdevDependencyConsistent with ESLint config changes. No issues spotted.
.changeset/eslint-globals-support.md (1)
1-6: Changeset looks validCorrect frontmatter and concise summary. Good to ship.
.changeset/sidebar-eslint-disable.md (1)
1-6: Changeset looks validFrontmatter and scope are correct for a patch note.
examples/todo-with-auth0/packages/backend/package.json (1)
93-93: LGTM: addglobalsdevDependencyMatches the ESLint config’s use of
globals.node.examples/todo-with-auth0/packages/admin/eslint.config.js (1)
10-10: Browser globals integration: LGTM — devDependency present ([email protected]).Confirmed examples/todo-with-auth0/packages/admin/package.json lists devDependencies.globals = "16.4.0".
examples/todo-with-auth0/packages/web/package.json (1)
80-80: LGTM — add "globals" devDependency; verify repo-wide version consistencyMatches the ESLint usage.
[email protected] found in:
- examples/blog-with-auth/packages/admin/package.json
- examples/blog-with-auth/packages/backend/package.json
- examples/todo-with-auth0/packages/admin/package.json
- examples/todo-with-auth0/packages/backend/package.json
- examples/todo-with-auth0/packages/web/package.json
jq reported "Invalid numeric literal" during the scan, preventing a full verification — re-run the check or fix the malformed package.json to confirm no other mismatched versions.
packages/core-generators/src/generators/node/eslint/eslint.generator.ts (2)
95-96: Addingglobalsto devDeps is correct.Matches CORE_PACKAGES and templates’ usage.
160-161: Double-check emitted code forTPL_GLOBALS.Passing
'browser' | 'node'must render as an identifier in the template (not a JS string). If there’s any risk, switch the template to the comment placeholder variant as suggested.packages/core-generators/src/generators/node/eslint/extractor.json (1)
20-21: New variableTPL_GLOBALSis correctly declared.Plugs the generator->template gap cleanly.
examples/blog-with-auth/packages/backend/eslint.config.mjs (1)
8-8: Node globals inclusion LGTM.Import +
languageOptions.globals: { ...globals.node }are consistent with templates.Also applies to: 45-49
examples/todo-with-auth0/packages/web/eslint.config.js (1)
10-10: Browser globals inclusion LGTM.Import +
languageOptions.globals: { ...globals.browser }are correct.Also applies to: 47-51
packages/tools/eslint-configs/react.js (1)
11-11: Browser globals for React config look good.Matches the pattern and avoids false positives for
window,document, etc.Also applies to: 23-25
packages/core-generators/src/constants/core-packages.ts (1)
18-18: Approve —globalspinned to 16.4.0 across repoFound
"globals": "16.4.0"in: packages/tools/package.json:73, examples/todo-with-auth0/packages/web/package.json:80, examples/todo-with-auth0/packages/admin/package.json:84, examples/todo-with-auth0/packages/backend/package.json:93, examples/blog-with-auth/packages/backend/package.json:77, examples/blog-with-auth/packages/admin/package.json:80.packages/tools/eslint-configs/typescript.js (1)
9-9: Approve —globalspresent in packages/tools/package.jsonNode globals via
globalsare wired correctly; import + spread match repo pattern. Verified: packages/tools/package.json lists "globals": "16.4.0" (line 73).examples/todo-with-auth0/packages/backend/eslint.config.mjs (2)
8-8: Enable Node globals — good addition.Using the globals package aligns with Flat config best practices and avoids no-undef for Node built-ins (process, __dirname, etc.).
45-49: languageOptions.globals set to Node — verified and approved.
globals devDependency = 16.4.0 present in both example packages; both example configs include the spread (e.g. ...globals.node / ...globals.browser) and the generator template contains the TPL_GLOBALS placeholder.examples/blog-with-auth/packages/admin/eslint.config.js (2)
10-10: Bring in browser globals — good call.Prevents spurious no-undef for window, document, etc.
47-51: languageOptions.globals set to browser — appropriate for admin UI.No changes needed.
| "eslint-plugin-react": "7.37.5", | ||
| "eslint-plugin-react-hooks": "5.2.0", | ||
| "eslint-plugin-unicorn": "60.0.0", | ||
| "globals": "16.4.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add packageManager field to enforce pnpm 10+ (repo rule for this example)
This example series requires explicit packageManager enforcement. Engines + only-allow are good, but please also add the field.
Apply this diff near the top-level fields:
{
"name": "@prisma-crud/admin",
"version": "1.0.0",
"private": true,
"description": "Web app for todo-with-auth0",
"license": "UNLICENSED",
"type": "module",
+ "packageManager": "[email protected]",
"scripts": {🤖 Prompt for AI Agents
In examples/todo-with-auth0/packages/admin/package.json around line 84, the
package.json lacks the repository rule-required packageManager field to enforce
pnpm 10+; add a top-level "packageManager" entry (e.g., "packageManager":
"[email protected]") near the other top-level fields so the project specifies and
enforces pnpm v10+ for this example.
| "eslint-plugin-import-x": "4.16.1", | ||
| "eslint-plugin-perfectionist": "4.15.0", | ||
| "eslint-plugin-unicorn": "60.0.0", | ||
| "globals": "16.4.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
Module system must be ESM for this example; file is currently CommonJS
Per repo rules for todo-with-auth0 examples, set "type": "module". This may require verifying TS/compiler options and any .cjs/.mjs files.
- "type": "commonjs",
+ "type": "module",🏁 Script executed:
#!/bin/bash
# Verify ESM requirements for @prisma-crud/backend
echo "Current package type:"
jq -r '.type' examples/todo-with-auth0/packages/backend/package.json
echo "Check TS module/resolution (should be NodeNext/ES2022 or ESM-compatible):"
fd -a tsconfig.json examples/todo-with-auth0/packages/backend | while read -r f; do
echo "---- $f"
cat "$f" | jq -r '.compilerOptions.module?, .compilerOptions.moduleResolution?, .compilerOptions.target?'
done
echo "Scan for CommonJS-only patterns (require/module.exports) in src:"
rg -n -C1 -g 'examples/todo-with-auth0/packages/backend/src/**' -e '\brequire\(' -e '\bmodule\.exports\b' || true
echo "Scan for ESM imports with missing .js extensions (repo rule may require .js):"
rg -n -C0 -g 'examples/todo-with-auth0/packages/backend/src/**' -e 'from\s+[\"|\'][^\"\'\.]+[\"|\']' --type=ts --type=tsx || trueLength of output: 853
Make the backend package ESM: set "type": "module" and align TS + code
- examples/todo-with-auth0/packages/backend/package.json — currently "type": "commonjs": change to "module".
- "type": "commonjs",
+ "type": "module",- examples/todo-with-auth0/packages/backend/tsconfig.json — replace Node16 settings with ESM-aware config: set compilerOptions.moduleResolution to "NodeNext" and compilerOptions.module to an ESM value (e.g. "ES2022" or "ESNext"); update or add the same to scripts/tsconfig.json if needed.
- examples/todo-with-auth0/packages/backend/src/tests/scripts/mock-redis.ts:10-11 — contains require('ioredis-mock'); convert to ESM import or mark the test file as .cjs. Search & fix any other require/module.exports occurrences.
- Ensure all local imports use .js extensions where required and use
import typefor type-only imports.
Committable suggestion skipped: line range outside the PR's diff.
🤖 Prompt for AI Agents
In examples/todo-with-auth0/packages/backend/package.json around line 93, change
"type": "commonjs" to "module" and then update TypeScript configs: in
examples/todo-with-auth0/packages/backend/tsconfig.json set
compilerOptions.moduleResolution to "NodeNext" and compilerOptions.module to an
ESM target like "ES2022" or "ESNext" (also update scripts/tsconfig.json if
present), convert any CommonJS test files such as
examples/todo-with-auth0/packages/backend/src/tests/scripts/mock-redis.ts (lines
~10-11) to use ESM imports (replace require('ioredis-mock') with an import or
rename the file to .cjs), search and replace any other require/module.exports
occurrences, update local imports to include .js extensions where required and
use "import type" for type-only imports.
Summary by CodeRabbit
Documentation
Chores
Tests
Bug Fixes