Skip to content

Conversation

minggangw
Copy link
Member

@minggangw minggangw commented Mar 4, 2025

This patch migrates ESLint configuration, .eslintrc.yml to the new flat config format by creating eslint.config.mjs, meanwhile, re-enables cpplint for Linux platform actions, including:

  1. Config eslint using recommended configs for *.js files ineslint.config.mjs.
  2. Config eslint-plugin-prettier using recommended configs for *.js files in eslint.config.mjs.
  3. Config @typescript-eslint/eslint-plugin using recommended configs for *.d.ts files in eslint.config.mjs.
  4. Re-enable cpplint.py for *.{hpp,cpp} files.
  5. Fix errors/warnings reported by linters above.
  6. Add npm run lint as addition step for actions, .github/workflows/linux-build-and-test-compatibility.yml and .github/workflows/linux-build-and-test.yml.
  7. Remove original .eslintrc.yml.

Fix: #1056

@minggangw minggangw requested a review from Copilot March 5, 2025 06:17
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

PR Overview

This PR re-enables cpplint and eslint on the Linux platform and addresses minor issues in error messages and configuration files as part of #1056. Key changes include adding lint runs to Linux workflows, updating error handling in parameter and node code, and cleaning up deprecated eslint-disable comments.

Reviewed Changes

File Description
eslint.config.mjs Added new ESLint configuration with duplicate ignore pattern
.github/workflows/linux-build-and-test*.yml Added lint commands to Linux build and test workflows
lib/interface_loader.js Removed redundant eslint-disable comments
lib/parameter.js Updated error types and streamlined catch blocks
example/* Removed redundant eslint-disable comments
lib/node.js Revised catch block syntax and error message clarity
lib/action/client.js, lib/qos.js, lib/distro.js Minor improvements and cleanup in core modules
lib/parameter_service.js, lib/clock_type.js Removed unnecessary eslint-disable comments
lib/lifecycle.js Removed redundant eslint-disable comments and variable assignments
lib/time_source.js Removed unused require to node.js

Copilot reviewed 67 out of 67 changed files in this pull request and generated no comments.

Comments suppressed due to low confidence (2)

eslint.config.mjs:19

  • Duplicate ignore pattern '**/generated/' is present in the configuration. Consider removing one of the duplicates to reduce confusion.
"**/generated/",

lib/node.js:1582

  • The error message 'does not readonly' is unclear; consider revising it to 'is not read-only' for improved clarity.
reason: `Parameter ${parameter.name} does not  readonly`,

@minggangw minggangw changed the title Re-enable cpplint & eslint on Actions for Linux platform Re-enable cpplint & eslint for Linux platform actions Mar 5, 2025
@minggangw minggangw merged commit 1d8b40c into RobotWebTools:develop Mar 5, 2025
6 checks passed
minggangw added a commit that referenced this pull request Mar 6, 2025
This patch migrates `ESLint` configuration, `.eslintrc.yml` to [the new flat config format](https://eslint.org/docs/latest/use/configure/migration-guide) by creating `eslint.config.mjs`, meanwhile, re-enables [cpplint](https://github.com/cpplint/cpplint) for Linux platform actions, including:

1. Config `eslint` using recommended configs for `*.js` files in`eslint.config.mjs`.
2. Config `eslint-plugin-prettier` using recommended configs for `*.js` files in `eslint.config.mjs`.
3. Config `@typescript-eslint/eslint-plugin` using recommended configs for `*.d.ts` files in `eslint.config.mjs`.
4. Re-enable [`cpplint.py`](https://github.com/cpplint/cpplint/blob/develop/cpplint.py) for `*.{hpp,cpp}` files.
5. Fix errors/warnings reported by linters above.
6. Add `npm run lint` as addition step for actions, `.github/workflows/linux-build-and-test-compatibility.yml` and `.github/workflows/linux-build-and-test.yml`.
7. Remove original `.eslintrc.yml`.

Fix: #1056
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.

Re-enable cpplint & eslint on Actions for Linux platform

1 participant