-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Re-enable cpplint & eslint for Linux platform actions (#1057)
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
- Loading branch information
Showing
67 changed files
with
152 additions
and
242 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,4 +35,5 @@ jobs: | |
run: | | ||
source /opt/ros/${{ matrix.ros_distribution }}/setup.bash | ||
npm i | ||
npm run lint | ||
npm test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
import typescriptEslint from "@typescript-eslint/eslint-plugin"; | ||
import prettier from "eslint-plugin-prettier"; | ||
import globals from "globals"; | ||
import tsParser from "@typescript-eslint/parser"; | ||
import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended'; | ||
import js from "@eslint/js"; | ||
|
||
export default [ | ||
{ | ||
ignores: [ | ||
"eslint.config.mjs", | ||
"types/interfaces.d.ts", | ||
"test/types/index.test-d.ts", | ||
"**/generated/", | ||
"**/scripts/", | ||
"**/benchmark/", | ||
"**/docs/", | ||
"**/electron_demo/", | ||
], | ||
}, | ||
{ | ||
...js.configs.recommended, | ||
files: ["lib/**/*.js", "index.js"], | ||
}, | ||
{ | ||
rules: { | ||
'no-dupe-class-members': 'off', | ||
}, | ||
}, | ||
{ | ||
plugins: { | ||
"@typescript-eslint": typescriptEslint, | ||
}, | ||
languageOptions: { | ||
globals: { | ||
...globals.node, | ||
}, | ||
parser: tsParser, | ||
ecmaVersion: "latest", | ||
sourceType: "module", | ||
}, | ||
files: ['types/*.d.ts'], | ||
rules: { | ||
...typescriptEslint.configs.recommended.rules, | ||
"@typescript-eslint/no-explicit-any": "off", | ||
}, | ||
}, | ||
{ | ||
plugins: { | ||
prettier, | ||
}, | ||
languageOptions: { | ||
globals: { | ||
...globals.node, | ||
}, | ||
ecmaVersion: "latest", | ||
sourceType: "commonjs", | ||
}, | ||
files: ["lib/**/*.js", "rosidl_parser/**/*.js", "rosidl_gen/**/*.js", | ||
"rostsd_gen/**/*.js", "test/**/*.js", "example/**/*.js", "index.js"], | ||
rules: { | ||
...eslintPluginPrettierRecommended.rules, | ||
}, | ||
} | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,8 +14,6 @@ | |
|
||
'use strict'; | ||
|
||
/* eslint-disable camelcase */ | ||
|
||
const rclnodejs = require('../index.js'); | ||
|
||
rclnodejs | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,8 +14,6 @@ | |
|
||
'use strict'; | ||
|
||
/* eslint-disable camelcase */ | ||
|
||
const rclnodejs = require('../index.js'); | ||
|
||
rclnodejs | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,8 +14,6 @@ | |
|
||
'use strict'; | ||
|
||
/* eslint-disable camelcase */ | ||
|
||
const rclnodejs = require('../index.js'); | ||
|
||
rclnodejs | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,8 +14,6 @@ | |
|
||
'use strict'; | ||
|
||
/* eslint-disable camelcase */ | ||
|
||
/** | ||
* Enum for ClockType | ||
* @readonly | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,8 +14,6 @@ | |
|
||
'use strict'; | ||
|
||
/* eslint-disable */ | ||
|
||
/** | ||
* Enum for HistoryPolicy | ||
* @readonly | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,7 +12,6 @@ | |
|
||
'use strict'; | ||
|
||
/* eslint-disable camelcase */ | ||
const GOAL_ID_FIELD = { | ||
name: 'goal_id', | ||
type: { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.