Skip to content

Conversation

@maparent
Copy link
Collaborator

@maparent maparent commented Jun 25, 2025

Those are the new changes to the eslint configuration:
prefer-arrow-functions,
naming-conventions,
max-params.

@linear
Copy link

linear bot commented Jun 25, 2025

@vercel
Copy link

vercel bot commented Jun 25, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
discourse-graph ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 25, 2025 6:33pm

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jun 25, 2025

Important

Review skipped

Auto reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

📝 Walkthrough

Walkthrough

This update migrates ESLint configurations across multiple project directories to ESLint's flat config format, replacing legacy .eslintrc files with new eslint.config modules. TypeScript configurations are standardized, with new tsconfig.lint.json files added for linting contexts and explicit exclusions for build and dependency directories. Various package dependencies are updated, and workspace settings are refined for improved development consistency.

Changes

File(s) Change Summary
.vscode/settings.json, discourse-graph.code-workspace Updated VSCode settings for ESLint flat config and workspace folder structure.
apps/obsidian/eslint.config.mjs, apps/roam/eslint.config.mjs, apps/website/eslint.config.mjs, packages/ui/eslint.config.js Added new ESLint flat config files extending internal/shared configs, with TypeScript and JSX support.
apps/obsidian/tsconfig.json, apps/roam/tsconfig.json, apps/website/tsconfig.json, packages/ui/tsconfig.json Updated TypeScript configs to exclude build/dependency directories and/or simplify settings.
apps/obsidian/tsconfig.lint.json, apps/roam/tsconfig.lint.json, apps/website/tsconfig.lint.json, packages/database/tsconfig.lint.json, packages/ui/tsconfig.lint.json Added or simplified TypeScript lint configs to extend base/local tsconfig.
apps/obsidian/package.json, apps/roam/package.json, apps/website/package.json, packages/ui/package.json Updated lint scripts and/or dependency versions, relaxed ESLint warning limits.
packages/database/tsconfig.json Added new TypeScript config for the database package.
packages/eslint-config/next.js, packages/eslint-config/react-internal.js Migrated ESLint configs to flat config format, expanded plugin and rule usage.
packages/eslint-config/library.js, packages/ui/.eslintrc.js, apps/website/.eslintrc.js Deleted legacy .eslintrc and config files.
packages/eslint-config/package.json Declared ES module type, updated and expanded ESLint-related dependencies.
package.json Updated Prettier and Prettier plugin versions.

Sequence Diagram(s)

sequenceDiagram
    participant VSCode
    participant Developer
    participant ESLint
    participant TypeScript

    Developer->>VSCode: Opens workspace
    VSCode->>ESLint: Applies workspace settings (flat config, workingDirs)
    Developer->>ESLint: Runs "lint" script
    ESLint->>TypeScript: Reads tsconfig(.lint).json for project info
    ESLint->>ESLint: Loads flat config (eslint.config.mjs/js)
    ESLint->>Developer: Reports lint results
Loading

Poem

In the warren, configs shift and grow,
Flat as a meadow where code can flow.
TypeScript paths now clear and bright,
Linting scripts hop left and right.
With Prettier fur and ESLint’s keen nose,
Our code garden blooms—oh, how it shows!
🐇✨


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.

@maparent
Copy link
Collaborator Author

@CodeRabbit review

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jun 25, 2025

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

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 (3)
apps/roam/eslint.config.mjs (1)

6-13: Same project: true issue as in apps/website

The boolean will crash the parser; replace it with the path to the lint tsconfig.

packages/ui/eslint.config.js (1)

6-13: project: true is invalid here as well

Provide the explicit tsconfig path to keep ESLint functional.

-        tsconfigRootDir: ".",
-        project: true,
+        tsconfigRootDir: ".",
+        project: "./tsconfig.lint.json",
apps/obsidian/eslint.config.mjs (1)

6-13: project needs a path, not true

Same correction as the other configs—point to ./tsconfig.lint.json.

🧹 Nitpick comments (5)
apps/website/package.json (1)

11-12: Consider adding an auto-fix variant of the lint script.

A second script such as "lint:fix": "eslint . --fix" is cheap to wire up and dramatically improves DX by letting developers apply safe autofixes in one step.

No action required if your workflow already covers this elsewhere.

discourse-graph.code-workspace (1)

22-25: Broaden watcher exclusions to reduce VS Code churn.

You already ignore target; most projects in this repo generate dist and/or .next. Excluding them here prevents unnecessary file-watcher load.

     "files.watcherExclude": {
         "**/target": true,
+        "**/dist": true,
+        "**/.next": true
     },
packages/ui/tsconfig.lint.json (1)

1-3: Add noEmit to prevent accidental JS output during linting

Even though the file is only used by ESLint, TypeScript may still attempt to emit JS if noEmit is not explicitly disabled upstream. Being explicit removes that risk and signals intent.

 {
-  "extends": "./tsconfig.json"
+  "extends": "./tsconfig.json",
+  "compilerOptions": {
+    "noEmit": true
+  }
 }
packages/eslint-config/next.js (2)

13-15: Consider setting minimum Node.js version to 20.11.

As the comment suggests, you could use import.meta.dirname directly if you set the minimum Node.js version to 20.11. This would simplify the code and remove the workaround.


40-47: Important: Document the parserOptions limitation.

The comment indicates that parserOptions must be repeated in each project because cwd fails in editors. This is a significant limitation that should be:

  1. Documented in the project's ESLint setup guide
  2. Verified in all consuming projects
#!/bin/bash
# Description: Verify that consuming projects have proper parserOptions configuration

echo "=== Checking ESLint configs in apps for parserOptions ==="
fd -e mjs -e js "eslint.config" apps/ --exec grep -l "parserOptions" {} \;

echo -e "\n=== Checking for tsconfig.lint.json files ==="
fd "tsconfig.lint.json" apps/
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between e2055f6 and ef83e10.

⛔ Files ignored due to path filters (2)
  • apps/roam/package-lock.json is excluded by !**/package-lock.json
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (27)
  • .vscode/settings.json (1 hunks)
  • apps/obsidian/eslint.config.mjs (1 hunks)
  • apps/obsidian/package.json (1 hunks)
  • apps/obsidian/tsconfig.json (1 hunks)
  • apps/obsidian/tsconfig.lint.json (1 hunks)
  • apps/roam/eslint.config.mjs (1 hunks)
  • apps/roam/package.json (1 hunks)
  • apps/roam/tsconfig.json (1 hunks)
  • apps/roam/tsconfig.lint.json (1 hunks)
  • apps/website/.eslintrc.js (0 hunks)
  • apps/website/eslint.config.mjs (1 hunks)
  • apps/website/package.json (1 hunks)
  • apps/website/tsconfig.json (2 hunks)
  • apps/website/tsconfig.lint.json (1 hunks)
  • discourse-graph.code-workspace (1 hunks)
  • package.json (2 hunks)
  • packages/database/tsconfig.json (1 hunks)
  • packages/database/tsconfig.lint.json (1 hunks)
  • packages/eslint-config/library.js (0 hunks)
  • packages/eslint-config/next.js (1 hunks)
  • packages/eslint-config/package.json (1 hunks)
  • packages/eslint-config/react-internal.js (1 hunks)
  • packages/ui/.eslintrc.js (0 hunks)
  • packages/ui/eslint.config.js (1 hunks)
  • packages/ui/package.json (2 hunks)
  • packages/ui/tsconfig.json (1 hunks)
  • packages/ui/tsconfig.lint.json (1 hunks)
💤 Files with no reviewable changes (3)
  • apps/website/.eslintrc.js
  • packages/eslint-config/library.js
  • packages/ui/.eslintrc.js
🧰 Additional context used
🪛 Biome (1.9.4)
apps/website/tsconfig.lint.json

[error] 2-3: Expected a property but instead found '}'.

Expected a property here.

(parse)

🔇 Additional comments (19)
apps/obsidian/tsconfig.lint.json (1)

1-3: Config is minimal and correct

Extending the project’s main tsconfig.json without overrides is the recommended pattern for ESLint’s parserOptions.project.

apps/roam/tsconfig.lint.json (1)

1-3: Consistent lint-specific tsconfig – looks good

Matches the approach adopted in other packages; no issues spotted.

packages/database/tsconfig.lint.json (1)

1-3: OK as a pass-through lint config

No problems; inherits all options from the primary tsconfig.json.

packages/ui/package.json (2)

19-19: Raising --max-warnings to 20 dilutes lint gate – verify intent

Previously the script failed on any warning; the new threshold allows up to 20 warnings before CI breaks.
Confirm this relaxation is intentional and that CI still enforces the style-guide standards you expect.


33-34: Eslint patch upgrade – 👍

Updating to 8.57.1 is safe; no breaking changes between patch releases.

apps/roam/tsconfig.json (1)

3-3: dist exclusion is spot-on

Excluding the emitted dist folder prevents the compiler from needlessly scanning build artefacts and eliminates false-positive duplicate identifier errors in project references.

apps/roam/package.json (1)

10-10: Local lint script added – confirm Turbo picks it up

With Turborepo, a package-level "lint" script is automatically executed by turbo run lint.
Double-check that the root turbo.json (or package.json pipeline) still targets the workspace’s lint task so the command isn’t orphaned.

package.json (1)

13-15: Prettier 3 upgrade – run the formatter once

Jumping from 3.4.x3.6.x can update heuristics and whitespace rules.
Run npm run format (or equivalent) and commit any large formatting diff now to avoid polluting future PRs.

apps/website/tsconfig.json (2)

4-4: baseUrl set to project root

Good call – this simplifies absolute imports (~/foo) and aligns with the existing paths map.


22-22: Exclude dist to avoid stale type leakage

Keeps the compiler from ingesting old .d.ts files emitted by Next.js builds.

apps/obsidian/tsconfig.json (1)

17-17: Adds dist to the ignore list

Matches the pattern applied across sibling apps and prevents type clashes with bundled output.

packages/ui/tsconfig.json (1)

3-4: LGTM – simplification is consistent with the new shared config.

No functional or tooling regressions detected.

.vscode/settings.json (1)

5-7: Settings align with ESLint flat-config migration.

Verified that VS Code picks up these keys; nothing further to change.

apps/obsidian/package.json (2)

10-10: LGTM! Standard lint script addition.

Adding the ESLint script aligns with the PR's goal of style guide automation.


18-18: ```shell
#!/bin/bash

Verify if the obsidian app imports any Node.js built-in modules

echo "=== Checking for ES import of Node.js built-ins ==="
rg -n "import .* from '"['"]" apps/obsidian

echo -e "\n=== Checking for require() of Node.js built-ins ==="
rg -n "require('"['"])" apps/obsidian


</details>
<details>
<summary>packages/eslint-config/package.json (2)</summary>

`6-6`: **Good! ES module declaration aligns with flat config migration.**

The `"type": "module"` declaration is necessary for the ES module exports used in the ESLint flat config files.

---

`13-19`: [web_search]
```web
What breaking changes were introduced in eslint-config-prettier v10.1.5 compared to v9.x?
packages/eslint-config/react-internal.js (2)

29-29: Clarify the commented turbo config.

The turbo config is commented out here but included in next.js. Is this intentional? Please either:

  • Remove the comment if not needed
  • Add a comment explaining why it's excluded for React internal libraries

26-82: Good consistency with next.js config structure.

The configuration maintains excellent consistency with the next.js config, which will make maintenance easier. The main differences are appropriate for the different use cases (Next.js apps vs React internal libraries).

@maparent
Copy link
Collaborator Author

This is now working and tested. I updated quite a few dependencies, and I advise everyone to have a look. But it also gives us much more comprehensive linting in vscode and cursor. The variable name setting is noisy and needs tuning, but even then I think it's worth incorporating.

@maparent maparent requested a review from mdroidian June 25, 2025 18:37
Base automatically changed from lint-sql-schemas to main June 25, 2025 22:13
Copy link
Contributor

@mdroidian mdroidian left a comment

Choose a reason for hiding this comment

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

There is a lot going on here and there are huge ramifications for these decisions. I'm not sure where to begin. Some initial thoughts:

Let separate this into multiple smaller PR's, so we can go through them in order. If that is not possible, could you add inline comments in GitHub's UI to help explain what changes are made and what problem they are solving.

EG: Could each of the following be it's own PR? If not, for each, could you link to the files changed, or specific commit, and explain the choices made.

I decided to start with a modernization of our eslint configuration, with new flat configs.

Then, this did not work as well in vscode, so I had to be more more explicit about subprojects.

Finally I added some new functionality: checking for variable names (may need tuning), arrow functions and parameter count. (The issue with no-used-vars got solved by the new config not relying on eslint:recommended, but the typescript version.)

Formatting

There is a bunch of formatting changes in this PR as well.
Could this be it's own PR to help reduce the noise?

package-lock.json

Roam's package-lock.json was removed. Is this necessary in this PR? Why?
Also, have you checked and does this solve the reason it was still there?

@maparent
Copy link
Collaborator Author

Each step is a separate commit, and the third could be made into its own pr easily. It makes less sense to separate the other two: basically after the first, the cli works well but vscode cannot parse anything.

I'll see about separating format later tonight, but I doubt you'll gain that much.

The sad fact is that this was going from one non working state to a working state with days of trial and error; none of the steps worked until the end; and finding functional seams may be more days of work.

What I propose instead: let's look at it (minus last step) as a whole together, tell me what you're uncomfortable about, and we'll see if we can revert it without breaking.

Copy link
Contributor

Because there are so many files changed and many of the commits are force-pushed (thus unnamed), it would be extremely helpful if you could provide some additional context. Even if it is just linking a commit to each step listed above.

@maparent maparent force-pushed the ENG-369-style-guide-automation branch from d23bb68 to 7c9ffd7 Compare June 26, 2025 01:33
@maparent maparent changed the base branch from main to ENG-521-eslint-flat-config June 26, 2025 02:39
@maparent
Copy link
Collaborator Author

Ok. I separated the last layer from the previous one. I'll try to break it down even more, but this is a step.

@maparent
Copy link
Collaborator Author

maparent commented Jun 26, 2025

One other comment: The endless force-push that I realize you're not comfortable with are how I was separating the layers, so whatever was new was separate from just fixing/rewriting the old. I had to reorder commits to maintain this. This allowed me to separate these steps easily just now. (ETA: missing a negation)

@maparent maparent force-pushed the ENG-369-style-guide-automation branch from 7c9ffd7 to b04a008 Compare June 26, 2025 02:54
@maparent maparent force-pushed the ENG-521-eslint-flat-config branch from 6eb3a2e to d990d4d Compare June 26, 2025 02:54
@maparent
Copy link
Collaborator Author

maparent commented Jun 26, 2025

Ok, on roam/package-lock.json: That was a mistake on my part, I got into situations where I would add a package, npm install, run in trouble, revert my package.json change, reinstall, and the trouble would remain there, i.e. there was path-dependency and reverting changes to package.json did not get me back to status quo. So I zapped node_modules and package-lock a few times to get to a pristine state and retry. It was a nightmare. Still, between removing something and git rm, there is a huge difference, and I should have noticed. That said: without the package-lock, I was building fine. So it's possible the issue you describe has gone away through other updates. (maybe including the ones on this branch.) Not sure how to test this, we should look at it together.
ETA: Oh, and I restored the package-lock.

@maparent
Copy link
Collaborator Author

Ok, it's getting late, so here's what I see:

First, let's be clear: I can delineate logical units, but none of the steps will be runnable until the last.

  1. The formatting changes mostly follow from making the eslint-config files into modules. I'll see if I can separate this in a commit, but won't be absolutely obvious.
  2. version updates
  3. conversion of eslint-config files to use flat files
  4. introduction of flat-config to eslint-config files
  5. subsequent normalization of tsconfig / tsconfig.lint
  6. vscode changes
  7. small changes to packages (lint:fix, replace next lint by eslint)

Breaking this into separate commits is probably ~3h work.
OR I could walk you through it in 30-40 minutes.
I suspect after separating the commits, we'll still have to discuss it tbh.
So not strictly against it, but I highly question the added value.

Copy link
Contributor

@mdroidian mdroidian left a comment

Choose a reason for hiding this comment

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

Can next import react-internal so we can de-duplicate code?

@maparent maparent force-pushed the ENG-369-style-guide-automation branch from fa076a9 to 4badb54 Compare June 29, 2025 14:43
@maparent maparent force-pushed the ENG-521-eslint-flat-config branch from d162479 to 9061e69 Compare June 29, 2025 14:46
@maparent maparent force-pushed the ENG-369-style-guide-automation branch 4 times, most recently from f391e59 to 4541bce Compare July 1, 2025 01:02
@maparent maparent force-pushed the ENG-521-eslint-flat-config branch from 76aafa8 to e7f1471 Compare July 1, 2025 01:02
@maparent maparent force-pushed the ENG-369-style-guide-automation branch from 4541bce to a3089bc Compare July 3, 2025 19:55
@maparent maparent force-pushed the ENG-521-eslint-flat-config branch from e7f1471 to f627479 Compare July 3, 2025 19:56
@maparent maparent force-pushed the ENG-369-style-guide-automation branch from a3089bc to 439256f Compare July 3, 2025 21:13
@maparent maparent force-pushed the ENG-521-eslint-flat-config branch 2 times, most recently from ca51ac2 to ab6b589 Compare July 5, 2025 21:00
@maparent maparent force-pushed the ENG-369-style-guide-automation branch 2 times, most recently from bfb9c7e to 5e6345a Compare July 6, 2025 21:20
@maparent maparent force-pushed the ENG-521-eslint-flat-config branch from ab6b589 to cf46de8 Compare July 6, 2025 21:20
@maparent maparent force-pushed the ENG-369-style-guide-automation branch from 5e6345a to 613be9b Compare July 10, 2025 18:22
@maparent maparent force-pushed the ENG-521-eslint-flat-config branch from cf46de8 to bbb4a41 Compare July 10, 2025 18:23
@maparent maparent force-pushed the ENG-369-style-guide-automation branch from 613be9b to 2f11733 Compare July 14, 2025 02:38
@maparent maparent force-pushed the ENG-521-eslint-flat-config branch from bbb4a41 to 0384559 Compare July 14, 2025 02:38
@maparent maparent force-pushed the ENG-369-style-guide-automation branch from 2f11733 to 50b334e Compare July 14, 2025 14:50
@maparent maparent force-pushed the ENG-521-eslint-flat-config branch from 0384559 to baa2946 Compare July 14, 2025 14:51
@mdroidian mdroidian merged commit f763a3e into ENG-521-eslint-flat-config Jul 19, 2025
3 checks passed
@mdroidian mdroidian deleted the ENG-369-style-guide-automation branch July 19, 2025 22:38
@github-project-automation github-project-automation bot moved this to Done in General Jul 19, 2025
mdroidian added a commit that referenced this pull request Jul 19, 2025
* ENG-369: eslint with new flat configuration files.

* make it work in vscode

* coderabbit improvements

* make it look closer to turbo skeleton

* most additions have no obvious effect

* add preferArrows, naming conventions, max-params. (#241)

* Update tsconfig.json to include trailing comma in compilerOptions

---------

Co-authored-by: Michael Gartner <mclicks@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

No open projects
Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants