Skip to content

Commit 395ed22

Browse files
committed
Re-enable cpplint & eslint on Actions for Linux platform
Fix: #1056
1 parent 120fcd0 commit 395ed22

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+102
-183
lines changed

.eslintrc.yml

Lines changed: 0 additions & 25 deletions
This file was deleted.

.github/workflows/linux-build-and-test.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,4 +50,5 @@ jobs:
5050
run: |
5151
source /opt/ros/${{ needs.identify-ros-distro.outputs.distro }}/setup.bash
5252
npm i
53+
npm run lint
5354
npm test

eslint.config.mjs

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
import prettier from "eslint-plugin-prettier";
2+
import globals from "globals";
3+
import typescriptEslint from "@typescript-eslint/eslint-plugin";
4+
import tsParser from "@typescript-eslint/parser";
5+
import path from "node:path";
6+
import { fileURLToPath } from "node:url";
7+
import js from "@eslint/js";
8+
import { FlatCompat } from "@eslint/eslintrc";
9+
10+
const __filename = fileURLToPath(import.meta.url);
11+
const __dirname = path.dirname(__filename);
12+
const compat = new FlatCompat({
13+
baseDirectory: __dirname,
14+
recommendedConfig: js.configs.recommended,
15+
allConfig: js.configs.all
16+
});
17+
18+
export default [{
19+
ignores: ["generated/", "eslint.config.mjs", "lib/", "types/", "scripts/", "benchmark/", "docs/", "electron_demo/"],
20+
}, ...compat.extends("prettier"), {
21+
plugins: {
22+
prettier,
23+
},
24+
25+
languageOptions: {
26+
globals: {
27+
...globals.node,
28+
every: true,
29+
after: true,
30+
constantly: true,
31+
},
32+
33+
ecmaVersion: "latest",
34+
sourceType: "commonjs",
35+
},
36+
37+
rules: {
38+
"prettier/prettier": "error",
39+
},
40+
}, {
41+
files: ["types/*.d.ts"],
42+
43+
plugins: {
44+
"@typescript-eslint": typescriptEslint,
45+
},
46+
47+
languageOptions: {
48+
parser: tsParser,
49+
sourceType: "module",
50+
},
51+
52+
rules: {
53+
strict: [0, "global"],
54+
},
55+
}];

example/publisher-content-filter-example.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@
1414

1515
'use strict';
1616

17-
/* eslint-disable camelcase */
18-
1917
const rclnodejs = require('../index.js');
2018

2119
async function main() {

example/publisher-message-example.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@
1414

1515
'use strict';
1616

17-
/* eslint-disable camelcase */
18-
1917
const rclnodejs = require('../index.js');
2018

2119
rclnodejs

example/publisher-multiarray-example.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@
1414

1515
'use strict';
1616

17-
/* eslint-disable camelcase */
18-
1917
const rclnodejs = require('../index.js');
2018

2119
rclnodejs

example/publisher-raw-message.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@
1414

1515
'use strict';
1616

17-
/* eslint-disable camelcase */
18-
1917
const rclnodejs = require('../index.js');
2018

2119
rclnodejs

example/subscription-multiarray-example.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ rclnodejs
3636
const weightStride = dim[1].stride;
3737
const channel = dim[2].size;
3838
const channelStride = dim[2].stride;
39-
// eslint-disable-next-line
39+
4040
const offset = multiArray.layout.data_offset;
4141

4242
for (let i = 0; i < height; i++) {

example/subscription-raw-message.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@
1414

1515
'use strict';
1616

17-
/* eslint-disable camelcase */
18-
1917
const rclnodejs = require('../index.js');
2018

2119
rclnodejs.init().then(() => {

lib/action/client.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ class ActionClient extends Entity {
172172
goalHandle.status = status;
173173

174174
// Remove done handles from the list
175-
// eslint-disable-next-line max-depth
175+
176176
if (
177177
status === ActionInterfaces.GoalStatus.STATUS_SUCCEEDED ||
178178
status === ActionInterfaces.GoalStatus.STATUS_CANCELED ||

0 commit comments

Comments
 (0)