Skip to content

Conversation

matteobruni
Copy link
Contributor

@matteobruni matteobruni commented May 1, 2024

Summary by CodeRabbit

  • New Features

    • Introduced shareable ESLint 9 Flat Config for consistent linting across packages.
  • Bug Fixes

    • Resolved minor configuration issues in linting and build tooling packages.
  • Chores

    • Added build:ci script for CI builds.
    • Upgraded TypeScript to 5.9 and refreshed ESLint/Prettier/Babel/Webpack tooling.
    • Migrated select packages to ESM and adjusted TypeScript/ESLint configs accordingly.
    • Bumped package versions to 3.0.0 and updated workspace/lerna settings.
  • Documentation

    • Updated changelogs with new release entries and notes.

@matteobruni matteobruni changed the title Updated dips Updated deps May 1, 2024
Copy link

coderabbitai bot commented May 1, 2024

Warning

Rate limit exceeded

@matteobruni has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 14 minutes and 16 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 22d5568 and 49f24ef.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (14)
  • .github/workflows/node.js-ci.yml (2 hunks)
  • .gitignore (1 hunks)
  • CHANGELOG.md (1 hunks)
  • lerna.json (2 hunks)
  • packages/eslint-config/CHANGELOG.md (1 hunks)
  • packages/eslint-config/package.json (1 hunks)
  • packages/eslint-config/src/eslint.config.ts (1 hunks)
  • packages/eslint-config/tsconfig.json (1 hunks)
  • packages/prettier-config/CHANGELOG.md (1 hunks)
  • packages/prettier-config/package.json (2 hunks)
  • packages/tsconfig/CHANGELOG.md (1 hunks)
  • packages/tsconfig/package.json (1 hunks)
  • packages/webpack-config/CHANGELOG.md (1 hunks)
  • packages/webpack-config/package.json (2 hunks)

Walkthrough

Repository-wide tooling upgrades and version bumps. Introduces a new ESLint 9 Flat Config package with TypeScript-focused rules, builds it via TypeScript, and migrates the webpack-config package to consume it and ESM. Root scripts and workspace settings adjusted. Multiple changelogs updated to 3.0.0.

Changes

Cohort / File(s) Summary
Monorepo tooling
package.json, pnpm-workspace.yaml, lerna.json
Added root script build:ci; upgraded dev tooling (@nrwl/workspace, nx, lerna, typescript); set workspace ignoredBuiltDependencies: nx; bumped Lerna version to 3.0.0.
ESLint Flat Config package
packages/eslint-config/package.json, packages/eslint-config/tsconfig.json, packages/eslint-config/src/eslint.config.ts
New ESM package version 3.0.0 with ESLint 9 Flat Config output (dist/eslint.config.js), peerDep on ESLint ^9, TypeScript build setup, and comprehensive TS/Stylistic/JSDoc/Prettier rules.
Webpack config lint/ESM migration
packages/webpack-config/package.json, packages/webpack-config/.eslintrc.js, packages/webpack-config/eslint.config.js, packages/webpack-config/.eslintignore, packages/webpack-config/tsconfig.json
Package moved to ESM (type: module), dev/tooling versions updated, switched from .eslintrc to Flat Config re-export, removed ignores for dist/node_modules, TS module set to ES2015.
Shared configs
packages/prettier-config/package.json, packages/tsconfig/package.json
Version bumps to 3.0.0; updated Prettier and TypeScript versions.
Changelogs
CHANGELOG.md, packages/eslint-config/CHANGELOG.md, packages/prettier-config/CHANGELOG.md, packages/tsconfig/CHANGELOG.md, packages/webpack-config/CHANGELOG.md
Added 3.0.0 entries and historical notes; documentation-only updates.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor Dev as Developer
  participant ESLint as ESLint CLI
  participant WC as packages/webpack-config
  participant EC as @tsparticles/eslint-config
  participant Plugins as ESLint Plugins & Parser

  Dev->>ESLint: run "eslint ."
  ESLint->>WC: load eslint.config.js
  WC-->>ESLint: export default from @tsparticles/eslint-config
  ESLint->>EC: initialize flat config
  EC->>Plugins: load @typescript-eslint, @stylistic, jsdoc, tsdoc, prettier
  EC->>EC: detect tsconfig.json (optional) for parserOptions.project
  ESLint->>ESLint: apply composed rules & ignores
  ESLint-->>Dev: report diagnostics
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

I twitch my ears at version three,
New linting burrows, tidy as can be.
TypeScript trails are marked and bright,
Flat maps guide my hops just right.
With Prettier whiskers and Webpack cheer,
I thump-release: 3.0’s here! 🥕✨

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch dev

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore or @coderabbit ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 19

Out of diff range and nitpick comments (2)
CHANGELOG.md (1)

10-10: Excessive blank lines detected.

Please reduce the number of consecutive blank lines to maintain a clean and professional document format.

packages/tsconfig/CHANGELOG.md (1)

10-10: Excessive blank lines detected.

Please reduce the number of consecutive blank lines to maintain a clean and professional document format.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 7

🧹 Nitpick comments (10)
package.json (1)

16-20: Pin the package manager and Node engine for reproducible installs.

Lock pnpm version and Node range to match toolchain (ESLint 9, TS 5.9, rimraf 6 typically need Node ≥18).

Apply:

   "devDependencies": {
     "@nrwl/workspace": "^19.8.4",
     "lerna": "^8.2.3",
     "nx": "19.8.4",
     "typescript": "^5.9.2"
   },
+  "packageManager": "pnpm@9",
+  "engines": {
+    "node": ">=18.18"
+  }
packages/webpack-config/package.json (2)

11-23: Prettier scripts only match top-level files; include subfolders.

Safer globs prevent misses when src has nested dirs.

Apply:

-    "prettify:ci:src": "prettier --check ./src/*",
+    "prettify:ci:src": "prettier --check \"src/**/*\"",
-    "prettify:src": "prettier --write ./src/*",
+    "prettify:src": "prettier --write \"src/**/*\"",

23-24: Consider adding engines field.

Rimraf 6 and ESLint 9 generally require Node ≥18. Add engines to fail-fast.

Apply:

   "scripts": {
     ...
   },
+  "engines": {
+    "node": ">=18.18"
+  },
packages/eslint-config/eslint.config.ts (6)

27-31: Prefer projectService (monorepo/published-config friendly) over hardcoded project path.

Hardcoding "./tsconfig.json" can fail in consumers with different layouts. projectService autodiscovers tsconfigs and is the recommended path for flat configs.

         languageOptions: {
             parser: tseslint.parser,
             parserOptions: {
-                project: "./tsconfig.json",
+                // autodiscover tsconfigs; set root for relative resolution
+                projectService: true,
+                tsconfigRootDir: import.meta.dirname,
             },
         },

21-26: Remove the explicit prettier plugin registration here.

You're already appending eslint-plugin-prettier/recommended, which registers the plugin/rule. Keeping a second alias (prettierPlugin) is redundant and potentially confusing.

         plugins: {
             "@stylistic": stylistic,
             "@typescript-eslint": tseslint.plugin,
             jsdoc,
             tsdoc,
-            prettierPlugin,
         },

34-47: These stylistic rules are mostly superseded by Prettier; consider dropping to reduce noise.

Since you include eslint-config-prettier/flat and eslint-plugin-prettier/recommended, many of these will be disabled or overlap. Removing them simplifies the config.

-            // --- stylistic ---
-            "@stylistic/comma-spacing": ["error"],
-            "@stylistic/quote-props": ["error", "as-needed"],
-            "@stylistic/space-in-parens": ["error", "never"],
-            "@stylistic/spaced-comment": ["error", "always", {block: {balanced: true}}],
-            "@stylistic/arrow-spacing": "error",
-            "@stylistic/arrow-parens": ["error", "as-needed"],
-            "@stylistic/quotes": ["error", "double", {allowTemplateLiterals: true, avoidEscape: true}],
-            "@stylistic/semi": ["error", "always"],
-            "@stylistic/space-before-blocks": "error",
-            "@stylistic/space-infix-ops": "error",
-            "@stylistic/keyword-spacing": "error",
-            "@stylistic/no-extra-semi": "error",
+            // stylistic rules delegated to Prettier (via eslint-config-prettier + plugin:prettier/recommended)

151-162: Import ordering: consider eslint-plugin-import for grouping and consistency.

Core sort-imports doesn't handle module grouping or type/value separation well. import/order gives better control.

If you want this, add eslint-plugin-import and switch to rules like import/order (and add it as a peer dependency).


19-19: Use globbed ignore patterns.

"dist" and "node_modules" without globs can miss nested folders. The diff above switches to /dist/ and /node_modules/.


196-202: English-only comments for repo consistency.

Minor copy edit.

-            // disabilitazioni duplicate (sostituite da @typescript-eslint)
+            // duplicate disables (superseded by @typescript-eslint)
packages/eslint-config/package.json (1)

1-35: Declare Node engine compatible with ESLint 9.

Helps avoid install/run on unsupported Node versions.

+  "engines": {
+    "node": ">=18.18.0"
+  },
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between f516d82 and 240a141.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (8)
  • package.json (2 hunks)
  • packages/eslint-config/eslint.config.ts (1 hunks)
  • packages/eslint-config/package.json (1 hunks)
  • packages/eslint-config/tsconfig.json (1 hunks)
  • packages/prettier-config/package.json (2 hunks)
  • packages/tsconfig/package.json (1 hunks)
  • packages/webpack-config/package.json (2 hunks)
  • pnpm-workspace.yaml (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • packages/eslint-config/tsconfig.json
⏰ 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). (1)
  • GitHub Check: Codacy Static Code Analysis
🔇 Additional comments (8)
pnpm-workspace.yaml (2)

2-2: Unquoting packages/ is fine.*

YAML parsing unchanged; workspace glob remains correct.


4-5: NX build hooks not found: No postinstall/prepare scripts in any package.json, nor any nx invocations in source or CI configs. Ignoring built dependencies is safe.

packages/tsconfig/package.json (1)

3-3: Version bump LGTM.

packages/prettier-config/package.json (1)

3-3: Version bump LGTM.

package.json (1)

6-6: New build:ci script LGTM.

packages/webpack-config/package.json (3)

3-3: Version bump LGTM.


31-33: Align eslint-config version with the repo’s ESLint 9 setup.

This package depends on @tsparticles/eslint-config ^2.3.0; elsewhere it’s 3.x with ESLint 9/flat config. Bump to ^3.0.0 for consistency.

Already covered in the diff above; confirm no consumers rely on v2 config shape.


1-6: Folder/package name mismatch: verify publish configs.
Folder packages/webpack-config declares "name": "@tsparticles/webpack-plugin". Confirm this discrepancy is intentional and that your Lerna/Nx/publishing setup maps the folder to the correct package name.

Comment on lines 19 to 32
ignores: ["dist", "node_modules"],
plugins: {
"@stylistic": stylistic,
"@typescript-eslint": tseslint.plugin,
jsdoc,
tsdoc,
prettierPlugin,
},
languageOptions: {
parser: tseslint.parser,
parserOptions: {
project: "./tsconfig.json",
},
},
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Scope the TS parser/config to TS files to avoid breaking JS.

Without a files filter, ts-eslint's parser applies to all files (including .js), which can cause parse errors and slower linting. Limit this block to TS only and tighten ignore globs.

-        ignores: ["dist", "node_modules"],
+        // limit this block to TS sources and ignore build artifacts
+        files: ["**/*.ts", "**/*.tsx"],
+        ignores: ["**/dist/**", "**/node_modules/**"],
         plugins: {
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
ignores: ["dist", "node_modules"],
plugins: {
"@stylistic": stylistic,
"@typescript-eslint": tseslint.plugin,
jsdoc,
tsdoc,
prettierPlugin,
},
languageOptions: {
parser: tseslint.parser,
parserOptions: {
project: "./tsconfig.json",
},
},
// limit this block to TS sources and ignore build artifacts
files: ["**/*.ts", "**/*.tsx"],
ignores: ["**/dist/**", "**/node_modules/**"],
plugins: {
"@stylistic": stylistic,
"@typescript-eslint": tseslint.plugin,
jsdoc,
tsdoc,
prettierPlugin,
},
languageOptions: {
parser: tseslint.parser,
parserOptions: {
project: "./tsconfig.json",
},
},
🤖 Prompt for AI Agents
In packages/eslint-config/eslint.config.ts around lines 19 to 32, the ts-eslint
parser block is not scoped and its ignores are too broad; add a files filter to
apply this block only to TS files (e.g. "**/*.ts" and "**/*.tsx") and tighten
the ignores to globs like "dist/**" and "**/node_modules/**" (and optionally
build artifacts like "**/*.d.ts") so JS files are not parsed by the TS parser
and linting remains fast and correct.

Comment on lines 5 to 9
"main": "eslint.config.ts",
"license": "MIT",
"files": [
"eslint-config.js"
"dist/eslint.config.js"
],
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

main points to a non-published TS file; consumers will fail to import.

"main": "eslint.config.ts" while only "dist/eslint.config.js" is published. This is a runtime breakage.

-  "main": "eslint.config.ts",
+  "main": "dist/eslint.config.js",
+  "type": "module",
+  "exports": {
+    ".": {
+      "import": "./dist/eslint.config.js"
+    }
+  },
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"main": "eslint.config.ts",
"license": "MIT",
"files": [
"eslint-config.js"
"dist/eslint.config.js"
],
"main": "dist/eslint.config.js",
"type": "module",
"exports": {
".": {
"import": "./dist/eslint.config.js"
}
},
"license": "MIT",
"files": [
"dist/eslint.config.js"
],
🤖 Prompt for AI Agents
In packages/eslint-config/package.json around lines 5 to 9, the "main" field
points to a non-published TypeScript file ("eslint.config.ts") which will break
consumers at runtime; change the "main" value to the published JS entry
("dist/eslint.config.js") or update the package "exports" to point to the built
file and ensure "dist/eslint.config.js" is included in the published "files"
list so consumers import the JS output.

💡 Verification agent

🧩 Analysis chain

Verify ESM output vs package type.

If tsc emits ESM (module: ES2022/NodeNext), "type": "module" is required; otherwise emit CJS. The diff above assumes ESM.

Also applies to: 27-31


🏁 Script executed:

#!/bin/bash
# Confirm emitted module format and entry resolution
jq -r '.compilerOptions.module // "MISSING"' packages/eslint-config/tsconfig.json 2>/dev/null || true
jq -r '.main,.type,.exports' packages/eslint-config/package.json
# Check entry exists (post-build) and is ESM-ish
[ -f packages/eslint-config/dist/eslint.config.js ] && head -n 1 packages/eslint-config/dist/eslint.config.js || echo "dist not built yet"

Length of output: 287


🏁 Script executed:

#!/bin/bash
sed -n '1,200p' packages/eslint-config/tsconfig.json

Length of output: 429


Add “type”: “module” and correct the “main” entry

  • packages/eslint-config/package.json is missing "type": "module", so Node will treat any .js output as CommonJS despite module: "ESNext" in tsconfig.json.
  • Change "main" from "eslint.config.ts" to "dist/eslint.config.js" (the compiled ESM file) and add
    "type": "module",
    "exports": { ".": "./dist/eslint.config.js" }
    to ensure proper ESM resolution.
🤖 Prompt for AI Agents
In packages/eslint-config/package.json around lines 5 to 9, the package is
missing "type": "module" and has an incorrect "main" pointing to the source
TypeScript file; update package.json to set "type" to "module", change "main" to
point to the compiled ESM output ("dist/eslint.config.js"), and add an "exports"
field mapping "." to "./dist/eslint.config.js" so Node resolves the compiled ESM
entry correctly.

Comment on lines 14 to 26
"devDependencies": {
"@eslint/js": "^9.34.0",
"@stylistic/eslint-plugin": "^5.2.3",
"@tsparticles/prettier-config": "^2.1.6",
"eslint": "^9.34.0",
"eslint-config-prettier": "^10.1.8",
"eslint-plugin-jsdoc": "^54.1.1",
"eslint-plugin-prettier": "^5.5.4",
"eslint-plugin-tsdoc": "^0.4.0",
"prettier": "^3.6.2",
"typescript": "^5.9.2",
"typescript-eslint": "^8.41.0"
},
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

Plugins/configs used at runtime must be peerDependencies (and/or dependencies), not only devDependencies.

The config imports these modules; if they’re only devDeps here, consumers won’t have them and resolution will fail. Keep them as devDeps for local dev, but also declare as peers so consumers install compatible versions.

   "peerDependencies": {
-    "eslint": "^9.0.0"
+    "eslint": "^9.0.0",
+    "@eslint/js": "^9.34.0",
+    "@stylistic/eslint-plugin": "^5.2.3",
+    "eslint-config-prettier": "^10.1.8",
+    "eslint-plugin-jsdoc": "^54.1.1",
+    "eslint-plugin-prettier": "^5.5.4",
+    "eslint-plugin-tsdoc": "^0.4.0",
+    "prettier": "^3.6.2",
+    "typescript": "^5.9.2",
+    "typescript-eslint": "^8.41.0"
   }

Also applies to: 32-34

🤖 Prompt for AI Agents
In packages/eslint-config/package.json around lines 14-26 (and also apply to
lines 32-34), the ESLint plugins/configs used at runtime are only listed under
devDependencies which will break consumers; add those runtime packages (e.g.,
@eslint/js, @stylistic/eslint-plugin, eslint, eslint-config-prettier,
eslint-plugin-jsdoc, eslint-plugin-prettier, eslint-plugin-tsdoc, and any other
imported rules/plugins) to peerDependencies (and to dependencies only if the
package must bundle them) while keeping them in devDependencies for local
development; ensure compatible semver ranges and update package.json
accordingly, then run a local install/test to verify consumers can resolve the
plugins.

Comment on lines +15 to 17
"prettier": "^3.6.2",
"prettier-plugin-multiline-arrays": "^4.0.3"
}
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Make Prettier and its plugin peers, not direct deps.

Prettier should be provided by the consuming repo to avoid duplication/version conflicts.

Suggested change:

   "dependencies": {
-    "prettier": "^3.6.2",
-    "prettier-plugin-multiline-arrays": "^4.0.3"
-  }
+  },
+  "peerDependencies": {
+    "prettier": "^3.6.0",
+    "prettier-plugin-multiline-arrays": "^4.0.0"
+  },
+  "devDependencies": {
+    "prettier": "^3.6.2",
+    "prettier-plugin-multiline-arrays": "^4.0.3"
+  }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"prettier": "^3.6.2",
"prettier-plugin-multiline-arrays": "^4.0.3"
}
"dependencies": {},
"peerDependencies": {
"prettier": "^3.6.0",
"prettier-plugin-multiline-arrays": "^4.0.0"
},
"devDependencies": {
"prettier": "^3.6.2",
"prettier-plugin-multiline-arrays": "^4.0.3"
}
🤖 Prompt for AI Agents
In packages/prettier-config/package.json around lines 15-17, the package
currently lists "prettier" and "prettier-plugin-multiline-arrays" as direct
dependencies; change this so they are peerDependencies instead to let the
consuming repo provide Prettier and avoid version duplication/conflicts—remove
them from "dependencies" and add them under "peerDependencies" with appropriate
semver ranges (and optionally keep them in "devDependencies" for local
testing/linting).

Comment on lines +10 to 11
"typescript": "^5.9.2"
}
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Avoid bundling TypeScript in this config package; use peerDependencies to prevent duplicates.

Publishing TS as a dependency can pull multiple TS versions into consumers.

Apply:

   "dependencies": {
-    "typescript": "^5.9.2"
-  }
+  },
+  "peerDependencies": {
+    "typescript": ">=5.4 <6"
+  },
+  "devDependencies": {
+    "typescript": "^5.9.2"
+  }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"typescript": "^5.9.2"
}
"dependencies": {
},
"peerDependencies": {
"typescript": ">=5.4 <6"
},
"devDependencies": {
"typescript": "^5.9.2"
}
🤖 Prompt for AI Agents
In packages/tsconfig/package.json around lines 10-11, TypeScript is listed as a
regular dependency which can force consumers to install a separate TS copy;
remove "typescript" from dependencies and instead add it to "peerDependencies"
with the same semver (e.g. "^5.9.2") so consuming projects provide the TS
version, and optionally keep the version in "devDependencies" for local
development and CI only.

Comment on lines 27 to 54
"dependencies": {
"@babel/core": "^7.23.9",
"@babel/preset-env": "^7.23.9",
"@tsparticles/eslint-config": "^2.1.0",
"@tsparticles/prettier-config": "^2.1.0",
"@types/node": "^20.11.9",
"@types/webpack-bundle-analyzer": "^4.6.3",
"@types/webpack-env": "^1.18.4",
"@typescript-eslint/eslint-plugin": "^6.19.1",
"@typescript-eslint/parser": "^6.19.1",
"babel-loader": "^9.1.3",
"browserslist": "^4.22.3",
"@babel/core": "^7.28.3",
"@babel/preset-env": "^7.28.3",
"@stylistic/eslint-plugin": "^5.2.3",
"@tsparticles/eslint-config": "^2.3.0",
"@tsparticles/prettier-config": "^2.1.6",
"@types/node": "^24.3.0",
"@types/webpack-bundle-analyzer": "^4.7.0",
"@types/webpack-env": "^1.18.8",
"@typescript-eslint/eslint-plugin": "^8.41.0",
"@typescript-eslint/parser": "^8.41.0",
"babel-loader": "^10.0.0",
"browserslist": "^4.25.4",
"copyfiles": "^2.4.1",
"eslint": "^8.56.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-jsdoc": "^48.0.4",
"eslint-plugin-tsdoc": "^0.2.17",
"prettier": "^3.2.4",
"prettier-plugin-multiline-arrays": "^3.0.1",
"rimraf": "^5.0.5",
"terser-webpack-plugin": "^5.3.10",
"typescript": "^5.3.3",
"webpack": "^5.90.0",
"webpack-bundle-analyzer": "^4.10.1",
"webpack-cli": "^5.1.4"
"eslint": "^9.34.0",
"eslint-config-prettier": "^10.1.8",
"eslint-plugin-import": "^2.32.0",
"eslint-plugin-jsdoc": "^54.1.1",
"eslint-plugin-tsdoc": "^0.4.0",
"prettier": "^3.6.2",
"prettier-plugin-multiline-arrays": "^4.0.3",
"rimraf": "^6.0.1",
"terser-webpack-plugin": "^5.3.14",
"typescript": "^5.9.2",
"webpack": "^5.101.3",
"webpack-bundle-analyzer": "^4.10.2",
"webpack-cli": "^6.0.1"
}
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Reclassify dependencies: move dev-only tooling to devDependencies and set webpack as a peer.

Publishing ESLint/Prettier/TS/@types/babel/webpack-cli as runtime deps bloats consumers and risks version conflicts. Typical plugin pattern:

  • peerDependencies: webpack (and only what must match the consumer).
  • devDependencies: build, lint, types, analyzers, loaders used only for local builds/tests.

Apply:

   "dependencies": {
-    "@babel/core": "^7.28.3",
-    "@babel/preset-env": "^7.28.3",
-    "@stylistic/eslint-plugin": "^5.2.3",
-    "@tsparticles/eslint-config": "^2.3.0",
-    "@tsparticles/prettier-config": "^2.1.6",
-    "@types/node": "^24.3.0",
-    "@types/webpack-bundle-analyzer": "^4.7.0",
-    "@types/webpack-env": "^1.18.8",
-    "@typescript-eslint/eslint-plugin": "^8.41.0",
-    "@typescript-eslint/parser": "^8.41.0",
-    "babel-loader": "^10.0.0",
-    "browserslist": "^4.25.4",
-    "copyfiles": "^2.4.1",
-    "eslint": "^9.34.0",
-    "eslint-config-prettier": "^10.1.8",
-    "eslint-plugin-import": "^2.32.0",
-    "eslint-plugin-jsdoc": "^54.1.1",
-    "eslint-plugin-tsdoc": "^0.4.0",
-    "prettier": "^3.6.2",
-    "prettier-plugin-multiline-arrays": "^4.0.3",
-    "rimraf": "^6.0.1",
-    "terser-webpack-plugin": "^5.3.14",
-    "typescript": "^5.9.2",
-    "webpack": "^5.101.3",
-    "webpack-bundle-analyzer": "^4.10.2",
-    "webpack-cli": "^6.0.1"
+    "terser-webpack-plugin": "^5.3.14"
+  },
+  "peerDependencies": {
+    "webpack": "^5.0.0"
+  },
+  "devDependencies": {
+    "@babel/core": "^7.28.3",
+    "@babel/preset-env": "^7.28.3",
+    "@stylistic/eslint-plugin": "^5.2.3",
+    "@tsparticles/eslint-config": "^3.0.0",
+    "@tsparticles/prettier-config": "^2.1.6",
+    "@types/node": "^24.3.0",
+    "@types/webpack-bundle-analyzer": "^4.7.0",
+    "@types/webpack-env": "^1.18.8",
+    "@typescript-eslint/eslint-plugin": "^8.41.0",
+    "@typescript-eslint/parser": "^8.41.0",
+    "babel-loader": "^10.0.0",
+    "browserslist": "^4.25.4",
+    "copyfiles": "^2.4.1",
+    "eslint": "^9.34.0",
+    "eslint-config-prettier": "^10.1.8",
+    "eslint-plugin-import": "^2.32.0",
+    "eslint-plugin-jsdoc": "^54.1.1",
+    "eslint-plugin-tsdoc": "^0.4.0",
+    "prettier": "^3.6.2",
+    "prettier-plugin-multiline-arrays": "^4.0.3",
+    "rimraf": "^6.0.1",
+    "typescript": "^5.9.2",
+    "webpack-bundle-analyzer": "^4.10.2",
+    "webpack-cli": "^6.0.1",
+    "webpack": "^5.101.3"
   }

Optional: add engines to reflect Node ≥18 due to ESLint 9/TS 5.9/rimraf 6.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"dependencies": {
"@babel/core": "^7.23.9",
"@babel/preset-env": "^7.23.9",
"@tsparticles/eslint-config": "^2.1.0",
"@tsparticles/prettier-config": "^2.1.0",
"@types/node": "^20.11.9",
"@types/webpack-bundle-analyzer": "^4.6.3",
"@types/webpack-env": "^1.18.4",
"@typescript-eslint/eslint-plugin": "^6.19.1",
"@typescript-eslint/parser": "^6.19.1",
"babel-loader": "^9.1.3",
"browserslist": "^4.22.3",
"@babel/core": "^7.28.3",
"@babel/preset-env": "^7.28.3",
"@stylistic/eslint-plugin": "^5.2.3",
"@tsparticles/eslint-config": "^2.3.0",
"@tsparticles/prettier-config": "^2.1.6",
"@types/node": "^24.3.0",
"@types/webpack-bundle-analyzer": "^4.7.0",
"@types/webpack-env": "^1.18.8",
"@typescript-eslint/eslint-plugin": "^8.41.0",
"@typescript-eslint/parser": "^8.41.0",
"babel-loader": "^10.0.0",
"browserslist": "^4.25.4",
"copyfiles": "^2.4.1",
"eslint": "^8.56.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-jsdoc": "^48.0.4",
"eslint-plugin-tsdoc": "^0.2.17",
"prettier": "^3.2.4",
"prettier-plugin-multiline-arrays": "^3.0.1",
"rimraf": "^5.0.5",
"terser-webpack-plugin": "^5.3.10",
"typescript": "^5.3.3",
"webpack": "^5.90.0",
"webpack-bundle-analyzer": "^4.10.1",
"webpack-cli": "^5.1.4"
"eslint": "^9.34.0",
"eslint-config-prettier": "^10.1.8",
"eslint-plugin-import": "^2.32.0",
"eslint-plugin-jsdoc": "^54.1.1",
"eslint-plugin-tsdoc": "^0.4.0",
"prettier": "^3.6.2",
"prettier-plugin-multiline-arrays": "^4.0.3",
"rimraf": "^6.0.1",
"terser-webpack-plugin": "^5.3.14",
"typescript": "^5.9.2",
"webpack": "^5.101.3",
"webpack-bundle-analyzer": "^4.10.2",
"webpack-cli": "^6.0.1"
}
"dependencies": {
"terser-webpack-plugin": "^5.3.14"
},
"peerDependencies": {
"webpack": "^5.0.0"
},
"devDependencies": {
"@babel/core": "^7.28.3",
"@babel/preset-env": "^7.28.3",
"@stylistic/eslint-plugin": "^5.2.3",
"@tsparticles/eslint-config": "^3.0.0",
"@tsparticles/prettier-config": "^2.1.6",
"@types/node": "^24.3.0",
"@types/webpack-bundle-analyzer": "^4.7.0",
"@types/webpack-env": "^1.18.8",
"@typescript-eslint/eslint-plugin": "^8.41.0",
"@typescript-eslint/parser": "^8.41.0",
"babel-loader": "^10.0.0",
"browserslist": "^4.25.4",
"copyfiles": "^2.4.1",
"eslint": "^9.34.0",
"eslint-config-prettier": "^10.1.8",
"eslint-plugin-import": "^2.32.0",
"eslint-plugin-jsdoc": "^54.1.1",
"eslint-plugin-tsdoc": "^0.4.0",
"prettier": "^3.6.2",
"prettier-plugin-multiline-arrays": "^4.0.3",
"rimraf": "^6.0.1",
"typescript": "^5.9.2",
"webpack-bundle-analyzer": "^4.10.2",
"webpack-cli": "^6.0.1",
"webpack": "^5.101.3"
}
🤖 Prompt for AI Agents
In packages/webpack-config/package.json around lines 27 to 54, the file
currently lists build/lint/type and CLI tools as runtime dependencies and
includes webpack as a normal dependency; move all dev-only packages into
devDependencies (e.g., @babel/core, @babel/preset-env, @stylistic/eslint-plugin,
@tsparticles/eslint-config, @tsparticles/prettier-config, @types/node,
@types/webpack-bundle-analyzer, @types/webpack-env,
@typescript-eslint/eslint-plugin, @typescript-eslint/parser, babel-loader,
browserslist, copyfiles, eslint, eslint-config-prettier, eslint-plugin-import,
eslint-plugin-jsdoc, eslint-plugin-tsdoc, prettier,
prettier-plugin-multiline-arrays, rimraf, terser-webpack-plugin, typescript,
webpack-bundle-analyzer, webpack-cli); remove webpack from dependencies and
declare it in peerDependencies (so consumers provide the matching webpack),
update devDependencies accordingly, run npm/yarn to refresh the lockfile, and
optionally add an engines field (node >=18) to package.json to reflect required
Node version.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

♻️ Duplicate comments (3)
packages/tsconfig/package.json (1)

9-11: Make TypeScript a peerDependency (keep as devDependency for local builds).

Prevents duplicate TS versions in consumers of this config package.

   "dependencies": {
-    "typescript": "^5.9.2"
-  }
+  },
+  "peerDependencies": {
+    "typescript": ">=5.4 <6"
+  },
+  "devDependencies": {
+    "typescript": "^5.9.2"
+  }

Run to confirm no other config packages ship TS as a direct dep:

#!/bin/bash
rg -nP '"name":\s*"@tsparticles/[^"]+"' -g 'packages/**/package.json'
echo "---- Direct TypeScript deps ----"
rg -nP '"dependencies"\s*:\s*{[^}]*"typescript"' -g 'packages/**/package.json' -C2
echo "---- Peer TypeScript deps ----"
rg -nP '"peerDependencies"\s*:\s*{[^}]*"typescript"' -g 'packages/**/package.json' -C2
packages/prettier-config/package.json (1)

15-17: Make Prettier and its plugin peerDependencies (keep as devDeps for local use).

Avoids forcing duplicate Prettier installs in downstream repos.

   "dependencies": {
-    "prettier": "^3.6.2",
-    "prettier-plugin-multiline-arrays": "^4.0.3"
-  }
+  },
+  "peerDependencies": {
+    "prettier": "^3.6.0",
+    "prettier-plugin-multiline-arrays": "^4.0.0"
+  },
+  "devDependencies": {
+    "prettier": "^3.6.2",
+    "prettier-plugin-multiline-arrays": "^4.0.3"
+  }
packages/webpack-config/package.json (1)

27-54: Move build/lint/type/CLI tools to devDependencies and set webpack as a peer to prevent consumer bloat and version conflicts.

Currently, almost all entries under dependencies are dev-only, and bundling webpack as a runtime dep risks duplicate webpack instances for consumers.

Apply:

   "prettier": "@tsparticles/prettier-config",
-  "dependencies": {
-    "@babel/core": "^7.28.3",
-    "@babel/preset-env": "^7.28.3",
-    "@stylistic/eslint-plugin": "^5.2.3",
-    "@tsparticles/eslint-config": "workspace:^3.0.0",
-    "@tsparticles/prettier-config": "workspace:^3.0.0",
-    "@types/node": "^24.3.0",
-    "@types/webpack-bundle-analyzer": "^4.7.0",
-    "@types/webpack-env": "^1.18.8",
-    "@typescript-eslint/eslint-plugin": "^8.41.0",
-    "@typescript-eslint/parser": "^8.41.0",
-    "babel-loader": "^10.0.0",
-    "browserslist": "^4.25.4",
-    "copyfiles": "^2.4.1",
-    "eslint": "^9.34.0",
-    "eslint-config-prettier": "^10.1.8",
-    "eslint-plugin-import": "^2.32.0",
-    "eslint-plugin-jsdoc": "^54.1.1",
-    "eslint-plugin-tsdoc": "^0.4.0",
-    "prettier": "^3.6.2",
-    "prettier-plugin-multiline-arrays": "^4.0.3",
-    "rimraf": "^6.0.1",
-    "terser-webpack-plugin": "^5.3.14",
-    "typescript": "^5.9.2",
-    "webpack": "^5.101.3",
-    "webpack-bundle-analyzer": "^4.10.2",
-    "webpack-cli": "^6.0.1"
-  }
+  "dependencies": {
+    "terser-webpack-plugin": "^5.3.14"
+  },
+  "peerDependencies": {
+    "webpack": "^5.0.0"
+  },
+  "devDependencies": {
+    "@babel/core": "^7.28.3",
+    "@babel/preset-env": "^7.28.3",
+    "@stylistic/eslint-plugin": "^5.2.3",
+    "@tsparticles/eslint-config": "workspace:^3.0.0",
+    "@tsparticles/prettier-config": "workspace:^3.0.0",
+    "@types/node": "^24.3.0",
+    "@types/webpack-bundle-analyzer": "^4.7.0",
+    "@types/webpack-env": "^1.18.8",
+    "@typescript-eslint/eslint-plugin": "^8.41.0",
+    "@typescript-eslint/parser": "^8.41.0",
+    "babel-loader": "^10.0.0",
+    "browserslist": "^4.25.4",
+    "copyfiles": "^2.4.1",
+    "eslint": "^9.34.0",
+    "eslint-config-prettier": "^10.1.8",
+    "eslint-plugin-import": "^2.32.0",
+    "eslint-plugin-jsdoc": "^54.1.1",
+    "eslint-plugin-tsdoc": "^0.4.0",
+    "prettier": "^3.6.2",
+    "prettier-plugin-multiline-arrays": "^4.0.3",
+    "rimraf": "^6.0.1",
+    "typescript": "^5.9.2",
+    "webpack": "^5.101.3",
+    "webpack-bundle-analyzer": "^4.10.2",
+    "webpack-cli": "^6.0.1"
+  },
+  "engines": {
+    "node": ">=18"
+  }

Quick checks:

#!/bin/bash
# 1) Verify no lint/build tools remain in dependencies
jq -r '.dependencies|keys[]' packages/webpack-config/package.json

# 2) Ensure webpack is peer + listed in dev for local builds
jq -r '.peerDependencies, .devDependencies|to_entries[]?|select(.key=="webpack")' packages/webpack-config/package.json
🧹 Nitpick comments (3)
packages/eslint-config/CHANGELOG.md (1)

6-12: Fix heading levels to satisfy MD001 (no skips).

Use H2 for versions under the top “Change Log” H1; keep “Bug Fixes” as H3.

-# [3.0.0](https://github.com/tsparticles/utils/compare/v2.3.0...v3.0.0) (2025-08-31)
+## [3.0.0](https://github.com/tsparticles/utils/compare/v2.3.0...v3.0.0) (2025-08-31)
 
-### Bug Fixes
+### Bug Fixes
packages/webpack-config/CHANGELOG.md (1)

6-12: Align heading levels with the document hierarchy.

Promote the version header to H2; keep “Bug Fixes” as H3 to avoid level jumps.

-# [3.0.0](https://github.com/tsparticles/utils/compare/v2.3.0...v3.0.0) (2025-08-31)
+## [3.0.0](https://github.com/tsparticles/utils/compare/v2.3.0...v3.0.0) (2025-08-31)
 
-### Bug Fixes
+### Bug Fixes
CHANGELOG.md (1)

6-16: Fix heading levels and de-duplicate rimraf bumps in the same release.

  • Use H2 for the 3.0.0 section under the top H1; keep “Bug Fixes” as H3.
  • Consider keeping only the latest rimraf line to reduce noise.
-# [3.0.0](https://github.com/tsparticles/utils/compare/v2.3.0...v3.0.0) (2025-08-31)
+## [3.0.0](https://github.com/tsparticles/utils/compare/v2.3.0...v3.0.0) (2025-08-31)
 
-### Bug Fixes
+### Bug Fixes
@@
-* **deps:** update dependency rimraf to v5.0.6 ([cff82d5](https://github.com/tsparticles/utils/commit/cff82d5693cc9329fcf31d0e6527d59df5f994f5))
 * **deps:** update dependency rimraf to v5.0.7 ([ba00fb8](https://github.com/tsparticles/utils/commit/ba00fb8f0daeb8e6ec4625e84e77ae5500b29d7d))
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 240a141 and 4bc9fa9.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (10)
  • CHANGELOG.md (1 hunks)
  • lerna.json (2 hunks)
  • packages/eslint-config/CHANGELOG.md (1 hunks)
  • packages/eslint-config/package.json (1 hunks)
  • packages/prettier-config/CHANGELOG.md (1 hunks)
  • packages/prettier-config/package.json (2 hunks)
  • packages/tsconfig/CHANGELOG.md (1 hunks)
  • packages/tsconfig/package.json (1 hunks)
  • packages/webpack-config/CHANGELOG.md (1 hunks)
  • packages/webpack-config/package.json (2 hunks)
✅ Files skipped from review due to trivial changes (3)
  • packages/tsconfig/CHANGELOG.md
  • lerna.json
  • packages/prettier-config/CHANGELOG.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/eslint-config/package.json
🧰 Additional context used
🪛 markdownlint-cli2 (0.17.2)
CHANGELOG.md

9-9: Heading levels should only increment by one level at a time
Expected: h2; Actual: h3

(MD001, heading-increment)

packages/eslint-config/CHANGELOG.md

9-9: Heading levels should only increment by one level at a time
Expected: h2; Actual: h3

(MD001, heading-increment)

packages/webpack-config/CHANGELOG.md

9-9: Heading levels should only increment by one level at a time
Expected: h2; Actual: h3

(MD001, heading-increment)

🔇 Additional comments (1)
packages/webpack-config/package.json (1)

3-3: Cross-package alignment confirmed: no 2.x references found in any package.json.

Copy link

@coderabbitai coderabbitai bot left a 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

♻️ Duplicate comments (2)
packages/webpack-config/package.json (1)

28-55: Reclassify tooling to devDependencies and make webpack a peer.

Tooling (babel/eslint/prettier/typescript/@types/cli/analyzers) shouldn’t be runtime deps; consumers will inherit them unnecessarily. Webpack should be a peer to avoid version pinning for consumers.

   "dependencies": {
-    "@babel/core": "^7.28.3",
-    "@babel/preset-env": "^7.28.3",
-    "@stylistic/eslint-plugin": "^5.2.3",
-    "@tsparticles/eslint-config": "workspace:^3.0.0",
-    "@tsparticles/prettier-config": "workspace:^3.0.0",
-    "@types/node": "^24.3.0",
-    "@types/webpack-bundle-analyzer": "^4.7.0",
-    "@types/webpack-env": "^1.18.8",
-    "@typescript-eslint/eslint-plugin": "^8.41.0",
-    "@typescript-eslint/parser": "^8.41.0",
-    "babel-loader": "^10.0.0",
-    "browserslist": "^4.25.4",
-    "copyfiles": "^2.4.1",
-    "eslint": "^9.34.0",
-    "eslint-config-prettier": "^10.1.8",
-    "eslint-plugin-import": "^2.32.0",
-    "eslint-plugin-jsdoc": "^54.1.1",
-    "eslint-plugin-tsdoc": "^0.4.0",
-    "prettier": "^3.6.2",
-    "prettier-plugin-multiline-arrays": "^4.0.3",
-    "rimraf": "^6.0.1",
-    "terser-webpack-plugin": "^5.3.14",
-    "typescript": "^5.9.2",
-    "webpack": "^5.101.3",
-    "webpack-bundle-analyzer": "^4.10.2",
-    "webpack-cli": "^6.0.1"
+    "terser-webpack-plugin": "^5.3.14"
+  },
+  "peerDependencies": {
+    "webpack": "^5.0.0"
+  },
+  "devDependencies": {
+    "@babel/core": "^7.28.3",
+    "@babel/preset-env": "^7.28.3",
+    "@stylistic/eslint-plugin": "^5.2.3",
+    "@tsparticles/eslint-config": "workspace:^3.0.0",
+    "@tsparticles/prettier-config": "workspace:^3.0.0",
+    "@types/node": "^24.3.0",
+    "@types/webpack-bundle-analyzer": "^4.7.0",
+    "@types/webpack-env": "^1.18.8",
+    "@typescript-eslint/eslint-plugin": "^8.41.0",
+    "@typescript-eslint/parser": "^8.41.0",
+    "babel-loader": "^10.0.0",
+    "browserslist": "^4.25.4",
+    "copyfiles": "^2.4.1",
+    "eslint": "^9.34.0",
+    "eslint-config-prettier": "^10.1.8",
+    "eslint-plugin-import": "^2.32.0",
+    "eslint-plugin-jsdoc": "^54.1.1",
+    "eslint-plugin-tsdoc": "^0.4.0",
+    "prettier": "^3.6.2",
+    "prettier-plugin-multiline-arrays": "^4.0.3",
+    "rimraf": "^6.0.1",
+    "typescript": "^5.9.2",
+    "webpack-bundle-analyzer": "^4.10.2",
+    "webpack-cli": "^6.0.1",
+    "webpack": "^5.101.3"
   }

Optional: add "engines": {"node": ">=18.18"}.

packages/eslint-config/package.json (1)

34-36: Declare runtime ESLint plugins/configs as peers so consumers can resolve them.

The config imports these at runtime; if not present in consumer deps, resolution fails. Keep them as devDeps for local dev, but also add as peerDependencies.

   "peerDependencies": {
-    "eslint": "^9.0.0"
+    "eslint": "^9.0.0",
+    "@eslint/js": "^9.34.0",
+    "@stylistic/eslint-plugin": "^5.2.3",
+    "eslint-config-prettier": "^10.1.8",
+    "eslint-plugin-jsdoc": "^54.1.1",
+    "eslint-plugin-prettier": "^5.5.4",
+    "eslint-plugin-tsdoc": "^0.4.0",
+    "prettier": "^3.6.2",
+    "typescript": "^5.9.2",
+    "typescript-eslint": "^8.41.0"
   }
🧹 Nitpick comments (6)
packages/webpack-config/tsconfig.json (1)

7-8: Align TS module settings with ESM package; prefer NodeNext/ESNext.

Using "module": "es2015" + "moduleResolution": "node" works but is dated and may miss Node ESM/package.exports nuances. Recommend NodeNext/ESNext to match "type": "module".

-        "module": "es2015",
+        "module": "ESNext",
...
-        "moduleResolution": "node",
+        "moduleResolution": "NodeNext",

Also applies to: 56-57

packages/webpack-config/eslint.config.js (1)

3-3: Add a trailing newline.

Small formatting nit to satisfy linters and POSIX tools.

-export default tsParticlesESLintConfig;
+export default tsParticlesESLintConfig;
+
packages/eslint-config/src/eslint.config.ts (3)

200-205: Use English for comments.

Standardize repo comments to English for consistency.

-            // disabilitazioni duplicate (sostituite da @typescript-eslint)
+            // duplicate disables (replaced by @typescript-eslint)

30-33: Optional: set sourceType module to match ESM defaults.

Flat configs default to module in many setups, but being explicit can avoid surprises in mixed repos.

         languageOptions: {
             parser: tseslint.parser,
-            parserOptions: parserProject ? { project: parserProject } : undefined,
+            parserOptions: parserProject ? { project: parserProject } : undefined,
+            sourceType: "module",
         },

12-13: Skip tsconfig.json requirement for config-only packages
Adjust the workspace verification to only enforce a tsconfig.json on packages containing TypeScript sources (for example, by detecting .ts files or a types field in their package.json). Packages like packages/prettier-config only ship JSON configs and can be exempt.

packages/eslint-config/package.json (1)

6-10: Optional: add exports for Node’s package entry clarity.

"main" is fine; exports improves resolution and tooling.

   "main": "dist/eslint.config.js",
+  "exports": {
+    ".": "./dist/eslint.config.js"
+  },
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 4bc9fa9 and 22d5568.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (8)
  • packages/eslint-config/package.json (1 hunks)
  • packages/eslint-config/src/eslint.config.ts (1 hunks)
  • packages/eslint-config/tsconfig.json (1 hunks)
  • packages/webpack-config/.eslintignore (0 hunks)
  • packages/webpack-config/.eslintrc.js (0 hunks)
  • packages/webpack-config/eslint.config.js (1 hunks)
  • packages/webpack-config/package.json (2 hunks)
  • packages/webpack-config/tsconfig.json (1 hunks)
💤 Files with no reviewable changes (2)
  • packages/webpack-config/.eslintignore
  • packages/webpack-config/.eslintrc.js
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/eslint-config/tsconfig.json
🔇 Additional comments (1)
packages/webpack-config/eslint.config.js (1)

1-3: Re-export looks correct for ESLint 9 Flat Config.

No issues; resolves the workspace config cleanly.

Comment on lines +15 to +21
export default tseslint.config(
js.configs.recommended,
stylistic.configs.recommended,
jsdoc.configs["flat/recommended-typescript"],
...tseslint.configs.strictTypeChecked,
...tseslint.configs.stylisticTypeChecked,
{
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Avoid hard-requiring type-aware configs when no tsconfig is present.

Including strictTypeChecked/stylisticTypeChecked unconditionally can error out in consumers lacking a tsconfig.json. Gate them on parserProject and fall back to non-type-checked presets.

-export default tseslint.config(
-    js.configs.recommended,
-    stylistic.configs.recommended,
-    jsdoc.configs["flat/recommended-typescript"],
-    ...tseslint.configs.strictTypeChecked,
-    ...tseslint.configs.stylisticTypeChecked,
+export default tseslint.config(
+    js.configs.recommended,
+    stylistic.configs.recommended,
+    jsdoc.configs["flat/recommended-typescript"],
+    ...(parserProject ? tseslint.configs.strictTypeChecked : tseslint.configs.strict),
+    ...(parserProject ? tseslint.configs.stylisticTypeChecked : []),
     {
         ignores: ["dist", "node_modules"],
         plugins: {
             "@stylistic": stylistic,
             "@typescript-eslint": tseslint.plugin,
             jsdoc,
             tsdoc,
-            prettierPlugin,
+            // register as "prettier" for conventional rule ids (prettier/prettier)
+            prettier: prettierPlugin,
         },
         languageOptions: {
             parser: tseslint.parser,
             parserOptions: parserProject ? { project: parserProject } : undefined,
         },

Also applies to: 30-33

🤖 Prompt for AI Agents
In packages/eslint-config/src/eslint.config.ts around lines 15-21 (and also
apply same change to lines 30-33), the config currently unconditionally spreads
tseslint.configs.strictTypeChecked and tseslint.configs.stylisticTypeChecked
which will throw when a consumer has no tsconfig.json; change this to detect
whether the parserOptions.parserOptions?.project (or parserProject) is provided
and only include the type-checked presets when a project is configured,
otherwise fall back to the non-type-checked presets (e.g., use
tseslint.configs.strict and tseslint.configs.stylistic or the provided
non-type-checked equivalents). Ensure the gating is done inline where the arrays
are composed so the resulting exported config always works without a tsconfig.

Comment on lines +4 to 6
"type": "module",
"main": "dist/webpack-tsparticles.js",
"types": "dist/webpack-tsparticles.d.ts",
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Prevent breaking CJS consumers; ship dual ESM+CJS and wire exports.

With "type":"module" and a single ESM "main", require() from commonjs webpack.config.js will fail (ERR_REQUIRE_ESM). Publish dual outputs and conditionally export.

   "type": "module",
   "main": "dist/webpack-tsparticles.js",
   "types": "dist/webpack-tsparticles.d.ts",
+  "exports": {
+    ".": {
+      "import": "./dist/webpack-tsparticles.js",
+      "require": "./dist/webpack-tsparticles.cjs",
+      "types": "./dist/webpack-tsparticles.d.ts"
+    }
+  },
@@
-    "compile": "pnpm run build:ts",
-    "compile:ci": "pnpm run build:ts",
-    "build:ts": "pnpm run build:ts:cjs",
-    "build:ts:cjs": "tsc",
+    "compile": "pnpm run build:ts",
+    "compile:ci": "pnpm run build:ts",
+    "build:ts": "pnpm run build:ts:esm && pnpm run build:ts:cjs",
+    "build:ts:esm": "tsc -p tsconfig.json",
+    "build:ts:cjs": "tsc -p tsconfig.cjs.json",

Follow-up: add tsconfig.cjs.json with "module":"CommonJS" and output to dist/webpack-tsparticles.cjs.

Also applies to: 18-22

🤖 Prompt for AI Agents
packages/webpack-config/package.json lines 4-6: because the package is marked
"type":"module" and only provides an ESM main entry, CommonJS consumers using
require() will error; produce and publish both ESM and CJS builds, add a
conditional "exports" map pointing to the ESM dist/webpack-tsparticles.js for
import and dist/webpack-tsparticles.cjs for require, keep "main" pointing to the
CJS entry for compatibility or remove it in favor of "exports", and ensure
package.json also includes "types" mapping for both builds; create a
tsconfig.cjs.json that sets "module":"CommonJS" with its outDir emitting
dist/webpack-tsparticles.cjs and run the CJS build in your build script so both
artifacts are published.

@matteobruni matteobruni merged commit 897bbbd into main Aug 31, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant