Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vb-branch-1 #339

Merged
merged 2 commits into from
Dec 29, 2024
Merged

vb-branch-1 #339

merged 2 commits into from
Dec 29, 2024

Conversation

vicb
Copy link
Owner

@vicb vicb commented Dec 29, 2024

Summary by Sourcery

Upgrade Nx to 20.3.0 and ESLint to 9.8.0.

Build:

  • Update build configurations to reflect the Nx and ESLint upgrades.

Tests:

  • Remove eslint disables and unnecessary requires from tests.

Chores:

  • Remove eslint disables and unnecessary requires.

Summary by CodeRabbit

Based on the comprehensive summary of changes, here are the release notes:

  • ESLint Configuration

    • Migrated from .eslintrc.json to eslint.config.js across multiple projects
    • Introduced a centralized ESLint configuration with enhanced linting rules
    • Improved code quality and consistency checks
  • Dependency Updates

    • Updated multiple @nx packages from version 20.2.2 to 20.3.0
    • Upgraded ESLint to version 9.8.0
    • Added new dependencies like @eslint/eslintrc and typescript-eslint
  • Minor Code Improvements

    • Removed ESLint disable comments in various files
    • Refined naming conventions in some modules
    • Enhanced TypeScript type checking and import management
  • Package Management

    • Updated several development and production dependencies
    • Streamlined project-wide configuration files

Copy link

cloudflare-workers-and-pages bot commented Dec 29, 2024

Deploying flyxc with  Cloudflare Pages  Cloudflare Pages

Latest commit: a65300a
Status: ✅  Deploy successful!
Preview URL: https://3979dcd0.flyxc.pages.dev
Branch Preview URL: https://vb-branch-1.flyxc.pages.dev

View logs

Copy link
Contributor

sourcery-ai bot commented Dec 29, 2024

Reviewer's Guide by Sourcery

This PR upgrades Nx to 20.3.0 and ESLint to 9.8.0, along with several dependency updates and minor code fixes.

Class diagram showing updated ESLint configuration structure

classDiagram
    class BaseESLintConfig {
        +plugins
        +rules
        +files
        +ignores
    }

    class ModuleConfig {
        +extends BaseConfig
        +customRules
        +moduleSpecificIgnores
    }

    class ESLintPlugins {
        +@nx/eslint-plugin
        +require-node-import-prefix
        +simple-import-sort
        +import
    }

    BaseESLintConfig <|-- ModuleConfig
    BaseESLintConfig o-- ESLintPlugins

    note for BaseESLintConfig "New flat config format"
    note for ModuleConfig "Per-module configuration"
    note for ESLintPlugins "Updated plugin set"
Loading

File-Level Changes

Change Details Files
Upgrade Nx to 20.3.0
  • Updated Nx dependencies in package.json to 20.3.0
  • Adjusted Nx inputs in nx.json to include eslint.config.js
  • Updated @nx/webpack dependency in libs/secrets/package.json to 20.3.0
package.json
nx.json
libs/secrets/package.json
Upgrade ESLint to 9.8.0 and introduce eslint.config.js
  • Updated ESLint dependency in package.json to 9.8.0
  • Added eslint.config.js to configure ESLint rules and plugins
  • Added eslint.config.js to .gitignore
  • Updated Nx inputs in nx.json to include eslint.config.js
package.json
nx.json
.gitignore
eslint.config.js
Dependency updates and additions
  • Updated various dependencies in package.json
  • Added @eslint/js and jsonc-eslint-parser to libs/optimizer/package.json
  • Added jsonc-eslint-parser to libs/windy-sounding/package.json
package.json
libs/optimizer/package.json
libs/windy-sounding/package.json
Code refactor in libs/windy-sounding/src/redux/forecast-slice.ts
  • Renamed levelProps and sfcProps constants to _levelProps and _sfcProps
libs/windy-sounding/src/redux/forecast-slice.ts
Import cleanup in libs/windy-sounding/vite.config.ts
  • Moved the import of certificatePEM and keyPEM after other imports
libs/windy-sounding/vite.config.ts
Minor bug fixes
  • Fixed incorrect comparison in airspace3d-element.ts and skyways3d-element.ts
apps/fxc-front/src/app/components/3d/airspace3d-element.ts
apps/fxc-front/src/app/components/3d/skyways3d-element.ts
Removal of eslint-disable comments
  • Removed unnecessary eslint-disable comments throughout the codebase
apps/fxc-front/src/app/components/ui/ion-router.ts
apps/fxc-server/src/app/routes/supporters.ts
apps/fxc-tiles/src/app/airspaces/create-geojson.ts
apps/fetcher/jest.config.ts
apps/fetcher/src/app/trackers/flymaster.test.ts
apps/fetcher/src/app/trackers/inreach.test.ts
apps/fetcher/src/app/trackers/proxies.ts
apps/fetcher/src/app/trackers/skylines.test.ts
apps/fetcher/src/app/trackers/spot.test.ts
apps/fetcher/src/app/trackers/xcontest.test.ts
apps/fetcher/src/app/trackers/xcontest.ts
apps/fxc-front/jest.config.ts
apps/fxc-front/src/app/logic/airspaces.ts
apps/fxc-server/jest.config.ts
apps/fxc-server/src/app/waypoints/waypoints.ts
apps/fxc-server/src/main.ts
apps/fxc-tiles/jest.config.ts
apps/misc/jest.config.ts
apps/proxy/jest.config.ts
apps/run/jest-bench.config.ts
apps/run/jest.config.ts
libs/common-node/jest.config.ts
libs/common/jest.config.ts
libs/common/src/lib/fetch-timeout.ts
libs/optimizer/jest.config.ts
libs/vaadin-dom/jest.config.ts
libs/vaadin-dom/src/lib/Field.ts
libs/windy-sounding/generate-manifest.js
libs/windy-sounding/jest.config.ts

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time. You can also use
    this command to specify where the summary should be inserted.

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link

coderabbitai bot commented Dec 29, 2024

Walkthrough

This pull request introduces a comprehensive update to the project's ESLint configuration strategy. The changes involve replacing legacy .eslintrc.json files across multiple applications and libraries with a new eslint.config.js approach. This transition modernizes the project's linting configuration, moving from the traditional ESLint configuration format to the new flat configuration system. The modifications span multiple directories, updating dependency management, removing old configuration files, and standardizing ESLint rules across the project.

Changes

File/Directory Change Summary
.eslintignore Removed entirely
.eslintrc.json Removed from multiple locations (apps, libs)
eslint.config.js New root-level configuration introduced
Multiple apps/*/eslint.config.js New ESLint configurations added for individual applications
Multiple libs/*/eslint.config.js New ESLint configurations added for libraries
package.json Updated ESLint and Nx dependencies
nx.json Updated to accommodate new ESLint configuration approach

Poem

🐰 Linting Leap of Faith 🔍

From .eslintrc to config flat,
Our code now dances with a new chat.
Configurations clean and bright,
Eslint rules now shine just right!
A rabbit's code, now lint-free and light! 🚀

Possibly Related PRs

  • Update deps #338: Changes in ESLint configuration files and dependencies, similar to the current PR's focus on modernizing linting configurations.

Tip

CodeRabbit's docstrings feature is now available as part of our Early Access Program! Simply use the command @coderabbitai generate docstrings to have CodeRabbit automatically generate docstrings for your pull request. We would love to hear your feedback on Discord.


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ 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.
    • Generate unit testing code for this file.
    • 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 generate unit testing code for this file.
    • @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 generate unit testing code.
    • @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.

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. (Beta)
  • @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.

Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey @vicb - I've reviewed your changes and they look great!

Here's what I looked at during the review
  • 🟡 General issues: 1 issue found
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

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

🧹 Nitpick comments (13)
libs/windy-sounding/vite.config.ts (1)

8-9: Consider more secure handling of certificates and private keys.

Storing certificates and private keys in your code repository can introduce security risks if these files are misused or inadvertently exposed in production environments. If these certificates are only for local development usage, documenting them as such and ensuring they are never deployed to production is important. Alternatively, consider referencing environment variables or external secure storage services (e.g., Vault) to manage sensitive data more securely.

Would you like assistance setting up environment-based configuration or referencing a secure secret management solution?

eslint.config.js (3)

13-20: Use Additional Plugin Descriptions.

You're specifying multiple plugins under plugins, but you haven't documented their intent. Including a brief rationale for each plugin can help maintainers understand why they're needed.


54-55: Avoid Duplicate no-extra-semi Declarations.

You set "no-extra-semi": "error" in two places: lines 54 and 69. Consider consolidating them to simplify maintenance.

- 'no-extra-semi': 'error',
...
- 'no-extra-semi': 'error',
+ // Remove one of the duplicate entries

Also applies to: 69-69


72-74: Ensure Ignored Paths List is Comprehensive.

You’re ignoring build-related directories but might also consider ignoring other artifact folders (e.g., dist, coverage) if you have them elsewhere in the repo.

apps/fxc-front/eslint.config.js (1)

3-7: Complement Base Config with Additional Rules if Needed.

You’ve extended the base configuration and added ignores. This is fine. However, if fxc-front has unique complexities (browser-specific code, frameworks, etc.), consider adding any specialized lint rules to preempt framework-specific pitfalls.

libs/secrets/eslint.config.js (1)

10-12: Check JSON Parser Impact on Build or Tooling.

Switching to jsonc-eslint-parser is helpful, especially for comments in JSON. Confirm that other tools that rely on JSON files are unaffected by the extended JSON syntax.

apps/fetcher/eslint.config.js (1)

6-19: Refine Rule Overrides for Different Environments.

You have placeholders for TypeScript and JavaScript rule overrides. Ensure each environment has rules relevant to your actual usage (e.g., Node vs. browser, test vs. production).

libs/optimizer/eslint.config.cjs (1)

9-16: Assess Strictness of import/no-extraneous-dependencies.

Prohibiting all dev/optional/peer dependencies in .ts/.js files can be overly strict for testing. If you have test files in the same directory, consider allowing devDependencies for test files.

'import/no-extraneous-dependencies': [
  'error',
  {
-    devDependencies: false,
+    devDependencies: ['**/*.spec.ts', '**/*.test.ts', '**/*.spec.js', '**/*.test.js'],
    optionalDependencies: false,
    peerDependencies: false
  },
]
libs/windy-sounding/eslint.config.cjs (2)

6-17: Confirm devDependencies usage within test files
You have disabled devDependencies in 'import/no-extraneous-dependencies'. This rule may raise false positives for test files that legitimately rely on testing libraries. If you intend to allow dev dependencies in test code, consider adding a separate override for test files.


34-37: Consider unifying or removing ignore patterns
While ignoring node_modules/ is standard, confirm whether ignoring generate-manifest.js, vite.config.ts, and types/ is necessary. If you intend to lint any of these files, move them to an override block instead of ignoring them completely.

libs/windy-sounding/package.json (1)

23-23: Pinning jsonc-eslint-parser to 2.4.0
Pinning dependencies can limit unwanted updates but may also miss essential bug fixes or security patches. Consider using a caret version range (e.g., ^2.4.0) to allow minor and patch updates, if compatible with your project.

libs/windy-sounding/generate-manifest.js (2)

Line range hint 5-12: Optional: Switch to asynchronous file handling for better performance

While fs.writeFileSync is simpler for small scripts, consider using non-blocking I/O (fs.promises) if you anticipate additional logic or expansions in this script.

- fs.writeFileSync(manifestPath, manifest);
+ await fs.promises.writeFile(manifestPath, manifest);

Line range hint 5-12: Surface more debugging details

When catching errors, you might want to include stack traces or additional metadata to expedite troubleshooting. As an example:

} catch (error) {
-  console.error(`Error generating manifest file: ${error.message}`);
+  console.error(`Error generating manifest file at ${manifestPath}: ${error.stack}`);
  process.exit(1);
}
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between bb97e9d and a65300a.

⛔ Files ignored due to path filters (3)
  • libs/secrets/package-lock.json is excluded by !**/package-lock.json
  • libs/windy-sounding/package-lock.json is excluded by !**/package-lock.json
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (70)
  • .eslintignore (0 hunks)
  • .eslintrc.json (0 hunks)
  • .gitignore (1 hunks)
  • apps/fetcher/.eslintrc.json (0 hunks)
  • apps/fetcher/eslint.config.js (1 hunks)
  • apps/fetcher/jest.config.ts (0 hunks)
  • apps/fetcher/src/app/trackers/flymaster.test.ts (0 hunks)
  • apps/fetcher/src/app/trackers/inreach.test.ts (0 hunks)
  • apps/fetcher/src/app/trackers/proxies.ts (0 hunks)
  • apps/fetcher/src/app/trackers/skylines.test.ts (0 hunks)
  • apps/fetcher/src/app/trackers/spot.test.ts (0 hunks)
  • apps/fetcher/src/app/trackers/xcontest.test.ts (0 hunks)
  • apps/fetcher/src/app/trackers/xcontest.ts (0 hunks)
  • apps/fxc-front/.eslintrc.json (0 hunks)
  • apps/fxc-front/eslint.config.js (1 hunks)
  • apps/fxc-front/jest.config.ts (0 hunks)
  • apps/fxc-front/src/app/components/3d/airspace3d-element.ts (1 hunks)
  • apps/fxc-front/src/app/components/3d/skyways3d-element.ts (1 hunks)
  • apps/fxc-front/src/app/components/ui/ion-router.ts (1 hunks)
  • apps/fxc-front/src/app/logic/airspaces.ts (0 hunks)
  • apps/fxc-server/.eslintrc.json (0 hunks)
  • apps/fxc-server/eslint.config.js (1 hunks)
  • apps/fxc-server/jest.config.ts (0 hunks)
  • apps/fxc-server/src/app/routes/supporters.ts (1 hunks)
  • apps/fxc-server/src/app/waypoints/waypoints.ts (0 hunks)
  • apps/fxc-server/src/main.ts (0 hunks)
  • apps/fxc-tiles/.eslintrc.json (0 hunks)
  • apps/fxc-tiles/eslint.config.js (1 hunks)
  • apps/fxc-tiles/jest.config.ts (0 hunks)
  • apps/fxc-tiles/src/app/airspaces/create-geojson.ts (1 hunks)
  • apps/misc/.eslintrc.json (0 hunks)
  • apps/misc/eslint.config.js (1 hunks)
  • apps/misc/jest.config.ts (0 hunks)
  • apps/proxy/.eslintrc.json (0 hunks)
  • apps/proxy/eslint.config.js (1 hunks)
  • apps/proxy/jest.config.ts (0 hunks)
  • apps/run/.eslintrc.json (0 hunks)
  • apps/run/eslint.config.js (1 hunks)
  • apps/run/jest-bench.config.ts (0 hunks)
  • apps/run/jest.config.ts (0 hunks)
  • eslint.config.js (1 hunks)
  • libs/common-node/.eslintrc.json (0 hunks)
  • libs/common-node/eslint.config.js (1 hunks)
  • libs/common-node/jest.config.ts (0 hunks)
  • libs/common/.eslintrc.json (0 hunks)
  • libs/common/eslint.config.js (1 hunks)
  • libs/common/jest.config.ts (0 hunks)
  • libs/common/src/lib/fetch-timeout.ts (1 hunks)
  • libs/optimizer/.eslintrc.json (0 hunks)
  • libs/optimizer/eslint.config.cjs (1 hunks)
  • libs/optimizer/jest.config.ts (0 hunks)
  • libs/optimizer/package.json (1 hunks)
  • libs/secrets/.eslintrc.json (0 hunks)
  • libs/secrets/eslint.config.js (1 hunks)
  • libs/secrets/package.json (1 hunks)
  • libs/vaadin-dom/.eslintrc.json (0 hunks)
  • libs/vaadin-dom/eslint.config.js (1 hunks)
  • libs/vaadin-dom/jest.config.ts (0 hunks)
  • libs/vaadin-dom/src/lib/Field.ts (0 hunks)
  • libs/vaadin-nodom/.eslintrc.json (0 hunks)
  • libs/vaadin-nodom/eslint.config.js (1 hunks)
  • libs/windy-sounding/.eslintrc.json (0 hunks)
  • libs/windy-sounding/eslint.config.cjs (1 hunks)
  • libs/windy-sounding/generate-manifest.js (1 hunks)
  • libs/windy-sounding/jest.config.ts (0 hunks)
  • libs/windy-sounding/package.json (1 hunks)
  • libs/windy-sounding/src/redux/forecast-slice.ts (1 hunks)
  • libs/windy-sounding/vite.config.ts (1 hunks)
  • nx.json (2 hunks)
  • package.json (4 hunks)
💤 Files with no reviewable changes (40)
  • libs/optimizer/jest.config.ts
  • apps/fxc-tiles/jest.config.ts
  • apps/fxc-front/jest.config.ts
  • libs/vaadin-dom/jest.config.ts
  • libs/common/jest.config.ts
  • apps/proxy/jest.config.ts
  • apps/fetcher/jest.config.ts
  • .eslintignore
  • apps/misc/jest.config.ts
  • apps/fetcher/src/app/trackers/flymaster.test.ts
  • apps/run/jest-bench.config.ts
  • libs/windy-sounding/jest.config.ts
  • apps/fetcher/src/app/trackers/skylines.test.ts
  • apps/fxc-server/src/app/waypoints/waypoints.ts
  • apps/fxc-server/jest.config.ts
  • apps/fetcher/src/app/trackers/inreach.test.ts
  • apps/run/jest.config.ts
  • libs/vaadin-dom/.eslintrc.json
  • libs/vaadin-nodom/.eslintrc.json
  • libs/common/.eslintrc.json
  • apps/fetcher/src/app/trackers/xcontest.test.ts
  • apps/proxy/.eslintrc.json
  • apps/fxc-tiles/.eslintrc.json
  • libs/common-node/.eslintrc.json
  • apps/fetcher/.eslintrc.json
  • libs/secrets/.eslintrc.json
  • apps/fxc-server/src/main.ts
  • apps/fetcher/src/app/trackers/spot.test.ts
  • apps/fetcher/src/app/trackers/proxies.ts
  • libs/common-node/jest.config.ts
  • apps/run/.eslintrc.json
  • .eslintrc.json
  • apps/fxc-server/.eslintrc.json
  • apps/fxc-front/src/app/logic/airspaces.ts
  • apps/misc/.eslintrc.json
  • apps/fetcher/src/app/trackers/xcontest.ts
  • apps/fxc-front/.eslintrc.json
  • libs/windy-sounding/.eslintrc.json
  • libs/optimizer/.eslintrc.json
  • libs/vaadin-dom/src/lib/Field.ts
✅ Files skipped from review due to trivial changes (16)
  • libs/vaadin-nodom/eslint.config.js
  • apps/fxc-tiles/src/app/airspaces/create-geojson.ts
  • apps/proxy/eslint.config.js
  • apps/fxc-server/eslint.config.js
  • apps/run/eslint.config.js
  • libs/secrets/package.json
  • apps/misc/eslint.config.js
  • apps/fxc-tiles/eslint.config.js
  • apps/fxc-server/src/app/routes/supporters.ts
  • libs/common/eslint.config.js
  • libs/vaadin-dom/eslint.config.js
  • libs/common-node/eslint.config.js
  • libs/common/src/lib/fetch-timeout.ts
  • libs/optimizer/package.json
  • apps/fxc-front/src/app/components/ui/ion-router.ts
  • libs/windy-sounding/src/redux/forecast-slice.ts
🔇 Additional comments (18)
apps/fxc-front/src/app/components/3d/skyways3d-element.ts (1)

73-73: Good move to properly assign undefined after removing and destroying the layer.

This ensures there's no lingering reference to the destroyed layer, preventing potential memory leaks or accidental reuse.

apps/fxc-front/src/app/components/3d/airspace3d-element.ts (1)

89-89: Ensuring the layer is explicitly set to undefined helps avoid stale references.

This aligns with best practices for cleaning up child objects, especially after a destroy() call.

eslint.config.js (2)

25-37: Verify Nx Enforce Module Boundaries Configuration.

The @nx/enforce-module-boundaries rule calls out allow: ['@windy']. Ensure that the library or path @windy is indeed valid within your workspace, and confirm that depending on it doesn't violate Nx constraints.


45-53: Confirm the Disabled no-unused-vars Rule.

Disabling the built-in no-unused-vars in favor of @typescript-eslint/no-unused-vars is generally a good practice. However, double-check that there are no edge cases in plain JavaScript files outside TypeScript coverage.

libs/secrets/eslint.config.js (1)

6-9: Validate @nx/dependency-checks for JSON Files.

Enforcing @nx/dependency-checks on JSON files is unusual. Verify that you truly need to lint dependencies within JSON-based configurations (e.g., package.json). If it’s unintentional, consider refining the pattern.

libs/optimizer/eslint.config.cjs (2)

18-18: Confirm Spec Files Are Patched.

You're ignoring **/*.spec.ts. If you have test specs for .js or .jsx files, ensure they are also excluded if that’s your intent.


31-37: Apply Parser Only Where Necessary.

You’re parsing JSON files with jsonc-eslint-parser to highlight issues or allow comments. Ensure that other file types remain unaffected, especially if you rely on standard JSON parsing in certain contexts.

libs/windy-sounding/eslint.config.cjs (4)

1-2: Use consistent extension for the base config import.
Since this new file is a CommonJS module (eslint.config.cjs), ensure that ../../eslint.config.js is compatible with CommonJS imports or rename it to .cjs for consistency.


3-4: Exporting an array is valid in ESLint's flat config
The flat config format supports exporting an array of configuration objects. This approach provides fine-grained control over file pattern matching and rule application.


16-16: Check restricted import
The rule 'no-restricted-imports': ['error', '@windycom'] effectively bans all imports from @windycom. Verify that you don’t need partial or internal sub-path imports.


19-33: Efficient JSON linting using jsonc-eslint-parser
Your configuration for JSON files looks solid, especially ignoring certain dependencies for Nx checks. This approach helps maintain consistent dependency usage. Confirm that ignoring 'preact' or 'react-redux' is intentional.

.gitignore (1)

48-49: Ensure test configuration files are consistently ignored
By ignoring vite.config.*.timestamp* and vitest.config.*.timestamp*, you are covering ephemeral or build-related files. Confirm that no local development or testing workflows rely on these files.

nx.json (2)

23-23: Include new ESLint config
Referencing "{workspaceRoot}/eslint.config.js" ensures Nx picks up the new flat ESLint config. Confirm no references to removed .eslintrc.json files remain.


49-50: Exclude ESLint config in production
Excluding "{projectRoot}/eslint.config.js" from production is common practice, but verify that no production logic depends on this file (e.g., custom build steps).

package.json (3)

97-97: Verify security implications of dependency updates

Notable updates to security-sensitive packages:

  • @google-cloud/compute from ^4.8.0 to ^4.9.0
  • ioredis from ^5.4.1 to ^5.4.2

These packages handle sensitive operations (cloud infrastructure, data storage).

Run this script to check for known vulnerabilities:

Also applies to: 136-136

✅ Verification successful

Dependencies updated to secure versions with no known vulnerabilities

The GitHub Security Advisory Database shows no known vulnerabilities for either @google-cloud/[email protected] or [email protected]. These minor version updates appear to be safe to use.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for known vulnerabilities in updated packages

# Check for security advisories for google-cloud-compute
gh api graphql -f query='
{
  securityVulnerabilities(first: 5, ecosystem: NPM, package: "@google-cloud/compute") {
    nodes {
      advisory {
        summary
        severity
        publishedAt
      }
      vulnerableVersionRange
      firstPatchedVersion {
        identifier
      }
    }
  }
}'

# Check for security advisories for ioredis
gh api graphql -f query='
{
  securityVulnerabilities(first: 5, ecosystem: NPM, package: "ioredis") {
    nodes {
      advisory {
        summary
        severity
        publishedAt
      }
      vulnerableVersionRange
      firstPatchedVersion {
        identifier
      }
    }
  }
}'

Length of output: 694


22-32: Verify Nx framework version compatibility

All Nx packages have been updated from 20.2.2 to 20.3.0. While this is a minor version bump, it's important to verify compatibility with your project configuration.

Run this script to check for potential breaking changes:

Also applies to: 73-73

✅ Verification successful

Nx configuration is compatible with version 20.3.0

Based on the analysis of the project configuration files, the upgrade from Nx 20.2.2 to 20.3.0 is safe as:

  • All projects use standard Nx executors (@nx/webpack, @nx/vite, @nx/js) without custom implementations
  • The project structure follows Nx's recommended patterns with proper schema references
  • No deprecated features or executors are being used
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check Nx configuration compatibility

# Check for Nx workspace configuration
echo "Checking Nx workspace config..."
fd -g 'nx.json|workspace.json'

# Look for custom Nx executors/generators that might need updates
echo "Checking for custom Nx implementations..."
fd -g 'project.json' | xargs cat

Length of output: 21756


18-18: Verify ESLint major version upgrade compatibility

The ESLint-related changes include significant updates:

  • New dependency @eslint/eslintrc@^3.2.0
  • Major version bump of eslint from ~8.57.0 to ^9.8.0
  • New dependency typescript-eslint@^8.13.0

These changes align with modernizing the ESLint configuration, but the major version bump of ESLint requires careful verification.

Run this script to check for potential breaking changes:

Also applies to: 60-60, 82-82

✅ Verification successful

Let me verify the ESLint configuration by checking one of the new config files to ensure it's properly set up for ESLint v9.


ESLint v9 configuration is properly set up with flat config

The verification shows that:

  • All .eslintrc.* files have been removed
  • New eslint.config.js files are present in the root and all apps/libs
  • The configuration uses the new flat config format with @eslint/eslintrc's FlatCompat
  • ESLint directives in source files are using standard rules that are compatible with v9
  • The root config properly extends and configures all necessary plugins
  • App-specific configs correctly extend the root config

The ESLint-related dependency changes are verified to be working correctly with the new flat config system.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for ESLint v9 breaking changes and verify config compatibility

# Search for ESLint configuration files
echo "Searching for ESLint config files..."
fd -e js -e cjs -e mjs -g 'eslint.config.*'

# Search for any remaining .eslintrc files that might conflict
echo "Checking for legacy ESLint config files..."
fd -g '.eslintrc*'

# Look for ESLint directives in source files that might need updates
echo "Checking for ESLint directives in source files..."
rg "eslint-disable|eslint-enable|eslint-env"

Length of output: 3415


Script:

#!/bin/bash
# Check the root eslint.config.js and a sample app config
echo "=== Root ESLint config ==="
cat eslint.config.js

echo -e "\n=== Sample app ESLint config ==="
cat apps/fetcher/eslint.config.js

Length of output: 2950

libs/windy-sounding/generate-manifest.js (1)

3-3: Use caution when importing from the dist folder

Referencing the ../../dist/libs/windy-sounding/config.js bundle can break if the build output moves or changes in name. Consider importing configuration directly from the source if feasible, or confirming the build process consistently outputs the file at this path.

Run this script to confirm there are no references to a config.js in unexpected build directories:

✅ Verification successful

Let me gather more information about the config.js usage in the windy-sounding library.


Let me check for TypeScript config files since the project seems to use TypeScript.


Let me check the build configuration and the actual config.ts content to understand how it's being built.


The import from dist/libs/windy-sounding/config.js is intentional and correct

The import from the dist folder is actually the intended behavior in this case. Looking at the build configuration:

  1. The project has a special build step that generates the config bundle:
    • BUILD_PLUGIN_CONFIG=true npx nx build windy-sounding --configuration production
    • This creates a separate config.js bundle using a specific vite configuration
  2. The generate-manifest.js script is designed to run after the build and specifically needs the built config

This is a deliberate architectural decision where:

  • The config is built separately from the main plugin
  • The manifest generator uses the built config to ensure consistency with the deployed version
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Searching for config.js references outside of dist directory.
rg "config\.js" -A 3

Length of output: 12139


Script:

#!/bin/bash
# Check for config.js in the windy-sounding library
fd "config.js" libs/windy-sounding/

# Check the content of the config file in source
cat libs/windy-sounding/src/config.js || true

# Look for build configuration that handles config.js
rg -l "config\.js" libs/windy-sounding/vite.config.ts libs/windy-sounding/project.json

Length of output: 308


Script:

#!/bin/bash
# Check for TypeScript config files
fd "config.ts" libs/windy-sounding/src/

# Look for imports of config in the codebase
rg -l "from.*config" libs/windy-sounding/src/

Length of output: 280


Script:

#!/bin/bash
# Check the content of config.ts
cat libs/windy-sounding/src/config.ts

# Check build configuration
cat libs/windy-sounding/project.json

# Check vite config
cat libs/windy-sounding/vite.config.ts || true

Length of output: 5644

@vicb vicb merged commit 5c2e908 into master Dec 29, 2024
6 checks passed
@vicb vicb deleted the vb-branch-1 branch December 29, 2024 12:12
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.

1 participant