Skip to content

feat: adding standard scripts for lint and format check#7326

Merged
sriramveeraghanta merged 6 commits intopreviewfrom
standard-package-scripts
Jul 4, 2025
Merged

feat: adding standard scripts for lint and format check#7326
sriramveeraghanta merged 6 commits intopreviewfrom
standard-package-scripts

Conversation

@sriramveeraghanta
Copy link
Member

@sriramveeraghanta sriramveeraghanta commented Jul 2, 2025

Description

  • Create standardised package scripts for apps and packages

Type of Change

  • Feature (non-breaking change which adds functionality)

Summary by CodeRabbit

  • Chores
    • Updated project scripts to provide more granular commands for cleaning, checking, and fixing code quality and formatting issues.
    • Introduced stricter linting and formatting checks, separating checking from automatic fixing.
    • Enhanced clean-up scripts to remove additional build directories including .next.
    • Restructured task configuration for code quality processes to improve clarity and maintainability.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jul 2, 2025

Caution

Review failed

The pull request is closed.

"""

Walkthrough

The changes restructure and standardize code quality scripts and Turbo task configurations across multiple apps and the root project. Linting, formatting, and type checking scripts are split into explicit "check" and "fix" commands, with cleanup scripts expanded. The Turbo pipeline is refactored for granular check/fix tasks with disabled caching.

Changes

File(s) Change Summary
apps/admin/package.json Replaced generic format/lint scripts with granular clean, check, and fix scripts for linting, types, and format.
apps/live/package.json Updated clean script to also remove .next directory.
apps/space/package.json, apps/web/package.json Removed old lint/export scripts; added granular clean, check, and fix scripts for linting, types, and format.
packages/constants/package.json, packages/logger/package.json, packages/ui/package.json, packages/shared-state/package.json, packages/i18n/package.json, packages/propel/package.json, packages/services/package.json, packages/types/package.json Expanded clean scripts to remove .next directory; replaced lint scripts with comprehensive check/fix lint, types, and format scripts.
packages/decorators/package.json, packages/editor/package.json, packages/hooks/package.json Replaced old lint scripts with expanded check/fix lint, types, format scripts; added clean scripts; renamed type check scripts; simplified build scripts in hooks.
packages/hooks/tsup.config.ts Added tsup bundler configuration specifying entry, output formats, declaration generation, cleaning, and external react.
packages/utils/package.json, packages/utils/tsup.config.ts Revised build scripts to two-step process with tsc and tsup; added dev, clean, check, and fix scripts; added tsup config with entry, formats, dts, and external react.
package.json Removed root lint/format scripts; added "fix" and "check" scripts to run Turbo tasks.
turbo.json Refactored tasks: split lint/test into granular check/fix tasks, added aggregate tasks, disabled caching.
packages/hooks/.eslintrc.js, packages/utils/.eslintrc.js Removed parserOptions property entirely from ESLint configs.

Sequence Diagram(s)

sequenceDiagram
    participant Dev as Developer
    participant NPM as npm/yarn
    participant Turbo as turbo
    participant Lint as ESLint
    participant Type as TypeScript
    participant Format as Prettier

    Dev->>NPM: run check
    NPM->>Turbo: turbo run check
    Turbo->>Lint: check:lint (ESLint, no warnings)
    Turbo->>Type: check:types (type check, no emit)
    Turbo->>Format: check:format (Prettier check)
    Lint-->>Turbo: Lint results
    Type-->>Turbo: Type results
    Format-->>Turbo: Format results
    Turbo-->>NPM: Aggregate check results
    NPM-->>Dev: Output

    Dev->>NPM: run fix
    NPM->>Turbo: turbo run fix
    Turbo->>Lint: fix:lint (ESLint --fix)
    Turbo->>Format: fix:format (Prettier --write)
    Lint-->>Turbo: Lint fix results
    Format-->>Turbo: Format fix results
    Turbo-->>NPM: Aggregate fix results
    NPM-->>Dev: Output
Loading

Suggested labels

✨feature, 🛠️refactor, ready_to_merge

Suggested reviewers

  • pablohashescobar
  • prateekshourya29

Poem

In the warren of scripts, we sweep and we check,
With lint and with format, we keep code in check.
Turbo now guides us, with tasks split anew,
Clean burrows for bunnies, and type checks too!
Hop, hop, hooray—our code’s fresh as dew!
🐇✨
"""


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between dbd6336 and d959e07.

📒 Files selected for processing (1)
  • packages/logger/package.json (1 hunks)

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.
    • Explain this complex logic.
    • 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. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • 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 src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

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

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai 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

Documentation and Community

  • 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.

@sriramveeraghanta sriramveeraghanta marked this pull request as ready for review July 2, 2025 21:59
Copy link
Contributor

@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: 1

🧹 Nitpick comments (6)
apps/live/package.json (1)

13-18: Use rimraf to make the clean script cross-platform

rm -rf fails on Windows shells and forces contributors to install a Unix layer. Using rimraf (already very common in JS repos) keeps the command portable and simpler.

-    "clean": "rm -rf .turbo && rm -rf .next && rm -rf node_modules && rm -rf dist"
+    "clean": "rimraf .turbo .next node_modules dist"

You’ll need to add rimraf to devDependencies once at the workspace root (it will be hoisted).

turbo.json (1)

37-60: Re-enable Turbo caching for check tasks to speed up CI

Disabling the cache for purely-deterministic tasks (eslint, prettier --check, tsc --noEmit) forces them to run every time and will noticeably slow large CI matrices. Unless you’ve hit a specific caching bug, consider restoring the default:

-    "check:types": {
-      "dependsOn": ["^build"],
-      "cache": false
+    "check:types": {
+      "dependsOn": ["^build"]
     },
-    "check:lint": {
-      "cache": false
+    "check:lint": {},
-    "check:format": {
-      "cache": false
+    "check:format": {},

Same for the aggregate check task.

package.json (1)

17-19: Minor: document what fix vs check do at the root

The script names are clear to us but not to casual contributors. A short comment in the README (or "description" fields in scripts once Yarn 2+ is adopted) will avoid confusion.

No code change required.

apps/admin/package.json (1)

13-18: Same portability concern for clean here

Mirror the earlier suggestion: replace chained rm -rf calls with a single rimraf invocation.

-    "clean": "rm -rf .turbo && rm -rf .next && rm -rf node_modules && rm -rf dist",
+    "clean": "rimraf .turbo .next node_modules dist",

Keeps the monorepo consistent across OSes.

apps/web/package.json (1)

11-16: Portability & duplication – adopt a workspace-level clean

Identical to the admin & live packages:

  1. Swap out rm -rf for rimraf for Windows compatibility.
  2. Consider hoisting the clean script to the root and invoking it with
    yarn workspaces foreach -t run clean to avoid four nearly-identical definitions.
-    "clean": "rm -rf .turbo && rm -rf .next && rm -rf node_modules && rm -rf dist",
+    "clean": "rimraf .turbo .next node_modules dist",
apps/space/package.json (1)

12-16: Exclude build artefacts from lint/format globs to speed CI

Running ESLint & Prettier over the entire repo (. / **/*) hits .next, dist, and possibly generated code.
Even if these are ignored via .eslintignore / .prettierignore, the glob walk still incurs IO overhead.

Consider narrowing the scope:

-    "check:lint": "eslint . --max-warnings 0",
+    "check:lint": "eslint \"src/**/*.{ts,tsx}\" --max-warnings 0",

-    "check:format": "prettier --check \"**/*.{ts,tsx,md,json,css,scss}\"",
+    "check:format": "prettier --check \"src/**/*.{ts,tsx,md,css,scss}\"",

-    "fix:lint": "eslint . --fix",
+    "fix:lint": "eslint \"src/**/*.{ts,tsx}\" --fix",

-    "fix:format": "prettier --write \"src/**/*.{ts,tsx,md,css,scss}\""
+    "fix:format": "prettier --write \"src/**/*.{ts,tsx,md,css,scss}\""

This shaves minutes off CI for large workspaces and avoids accidental formatting changes in vendored/generated files.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7d417c5 and 81dc328.

📒 Files selected for processing (6)
  • apps/admin/package.json (1 hunks)
  • apps/live/package.json (1 hunks)
  • apps/space/package.json (1 hunks)
  • apps/web/package.json (1 hunks)
  • package.json (1 hunks)
  • turbo.json (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Analyze (javascript)

Copy link
Contributor

@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: 3

♻️ Duplicate comments (6)
packages/propel/package.json (1)

7-13: Same clean-script portability issue as noted for @plane/types

See the previous comment about replacing rm -rf ... && ... with a single rimraf invocation (or a shared root script).

packages/ui/package.json (1)

20-26: Duplicate portability concern for the clean script

Replicate the rimraf-based fix suggested in @plane/types to ensure Windows compatibility and reduce duplication.

packages/services/package.json (1)

8-13: Duplicate portability concern for the clean script

Adopt the cross-platform rimraf approach described earlier.

packages/logger/package.json (1)

16-22: Duplicate portability concern for the clean script

Apply the same rimraf refactor as outlined for @plane/types.

packages/shared-state/package.json (1)

10-16: clean script not portable

Same rm -rf pattern — adopt rimraf/del-cli for cross-platform safety.

packages/decorators/package.json (1)

16-21: clean script portability

rm -rf assumes a POSIX shell. Swap in rimraf or similar to avoid breaking Windows usage.

🧹 Nitpick comments (4)
packages/i18n/package.json (2)

10-10: Add --cache flag to speed up repeated ESLint runs

eslint . --max-warnings 0 is correct but will re-analyze the entire tree every time. Adding the cache flag dramatically reduces CI and local turnaround without changing behaviour:

-"check:lint": "eslint . --max-warnings 0",
+"check:lint": "eslint . --max-warnings 0 --cache",

12-14: Broaden the Prettier glob to cover common source files

JS/JSX and configuration files (yml, yaml, cjs, mjs) are formatted elsewhere in the repo but are not included here. Omitting them risks inconsistent formatting enforcement between packages.

-"check:format": "prettier --check \"**/*.{ts,tsx,md,json,css,scss}\"",
-"fix:format": "prettier --write \"**/*.{ts,tsx,md,json,css,scss}\"",
+"check:format": "prettier --check \"**/*.{ts,tsx,js,jsx,md,json,yml,yaml,css,scss}\"",
+"fix:format": "prettier --write \"**/*.{ts,tsx,js,jsx,md,json,yml,yaml,css,scss}\"",
packages/hooks/package.json (1)

16-20: Lint / format commands walk dist/** — expect noise & slow runs

eslint . and the wide Prettier glob will traverse generated output. Either put dist in .eslintignore / .prettierignore, or scope the commands to source files only:

"check:lint": "eslint \"src/**/*.{ts,tsx}\" --max-warnings 0",
"check:format": "prettier --check \"src/**/*.{ts,tsx,md,json,css,scss}\"",

This keeps CI fast and avoids false positives on compiled code.

packages/editor/package.json (1)

27-33: Portable cleaning + tighter quality scope

  1. Replace rm -rf … with rimraf for Windows support.
  2. Consider excluding build artefacts (dist, .turbo, etc.) from eslint . / Prettier checks to cut runtime.
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 81dc328 and 8a78e09.

📒 Files selected for processing (13)
  • packages/constants/package.json (1 hunks)
  • packages/decorators/package.json (1 hunks)
  • packages/editor/package.json (1 hunks)
  • packages/hooks/.eslintrc.js (0 hunks)
  • packages/hooks/package.json (1 hunks)
  • packages/hooks/tsup.config.ts (1 hunks)
  • packages/i18n/package.json (1 hunks)
  • packages/logger/package.json (1 hunks)
  • packages/propel/package.json (1 hunks)
  • packages/services/package.json (1 hunks)
  • packages/shared-state/package.json (1 hunks)
  • packages/types/package.json (1 hunks)
  • packages/ui/package.json (1 hunks)
💤 Files with no reviewable changes (1)
  • packages/hooks/.eslintrc.js
✅ Files skipped from review due to trivial changes (2)
  • packages/constants/package.json
  • packages/hooks/tsup.config.ts
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Analyze (javascript)

Copy link
Contributor

@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

🧹 Nitpick comments (3)
packages/utils/package.json (2)

14-18: Duplicate tsc --noEmit invocation – keep one source of truth
tsc --noEmit is executed both in build and in check:types. This doubles CI time. Either:

  1. Drop it from build (since type errors fail check:types anyway), or
  2. Remove the separate check:types script and call npm run build inside the turbo task instead.

18-20: **Formatting pattern omits .js / .jsx files
If utility code ever includes plain JS/JSX (e.g. stories, config, tests) they will be left unformatted. Add them unless you intentionally exclude.

- "prettier --check \"**/*.{ts,tsx,md,json,css,scss}\""
+ "prettier --check \"**/*.{js,jsx,ts,tsx,md,json,css,scss}\""

(Apply the same change to fix:format.)

turbo.json (1)

31-54: Disabling cache for every check/fix task forfeits Turbo’s biggest benefit
cache: false forces these tasks to run on every CI job, even when nothing changed, slowing pipelines. Turbo can safely cache lint/format/type-check by listing appropriate input globs (e.g. "inputs": ["**/*.ts","**/*.tsx",".eslintrc.*"]). Consider re-enabling caching with explicit inputs/outputs.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8a78e09 and 6b4ec1f.

📒 Files selected for processing (4)
  • packages/utils/.eslintrc.js (0 hunks)
  • packages/utils/package.json (1 hunks)
  • packages/utils/tsup.config.ts (1 hunks)
  • turbo.json (1 hunks)
💤 Files with no reviewable changes (1)
  • packages/utils/.eslintrc.js
✅ Files skipped from review due to trivial changes (1)
  • packages/utils/tsup.config.ts
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Analyze (javascript)
🔇 Additional comments (1)
turbo.json (1)

27-30: dev task no longer depends on build – verify DX
Removing dependsOn means running turbo run dev in an app that imports a freshly-cloned package will fail until the package is built once manually. Confirm that all consumer apps can boot on a cold repository.

@sriramveeraghanta sriramveeraghanta merged commit ba884d1 into preview Jul 4, 2025
3 of 5 checks passed
@sriramveeraghanta sriramveeraghanta deleted the standard-package-scripts branch July 4, 2025 08:53
@coderabbitai coderabbitai bot mentioned this pull request Jul 22, 2025
2 tasks
lifeiscontent pushed a commit that referenced this pull request Aug 18, 2025
* feat: adding standard scripts for lint and format check

* fix: update packages scripts

* fix: adding tsup config to utils package

* chore: updated build scripts in logger pacakge
@coderabbitai coderabbitai bot mentioned this pull request Nov 27, 2025
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants