From ecc39956e53910bdeb622ce7049640c4e3f44b48 Mon Sep 17 00:00:00 2001 From: per1234 Date: Mon, 18 Nov 2024 20:24:20 -0800 Subject: [PATCH 1/2] Correct eslint command in `lint` script The `lint` script of the "arduino-ide-extension" package is intended to use the ESLint linter tool to check for problems in all the package's JavaScript and TypeScript code files. It is used by the continuous integration system to validate contributions. Previously, the command invoked `eslint` without any arguments. With the 8.x version of ESLint used by the project, it is necessary to provide a path argument in order to cause it to lint the contents of files. Because that argument was not provided, the script didn't do anything at all and so would return a 0 exit status even if the code had linting rule violations. This is fixed by adding a `.` path argument to the command invoked by the script. This will cause ESLint to recurse through the `arduino-ide-extension` folder and lint the code in all relevant files. --- arduino-ide-extension/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arduino-ide-extension/package.json b/arduino-ide-extension/package.json index b97808e5f..5ef831049 100644 --- a/arduino-ide-extension/package.json +++ b/arduino-ide-extension/package.json @@ -13,7 +13,7 @@ "download-ls": "node ./scripts/download-ls.js", "download-examples": "node ./scripts/download-examples.js", "generate-protocol": "node ./scripts/generate-protocol.js", - "lint": "eslint", + "lint": "eslint .", "prebuild": "rimraf lib", "build": "tsc", "build:dev": "yarn build", From 257969999b7d1844e51cfe75fdf7a1e0041366dc Mon Sep 17 00:00:00 2001 From: per1234 Date: Mon, 18 Nov 2024 20:47:10 -0800 Subject: [PATCH 2/2] Use appropriate equality operator in changelog script It is considered good practice to use JavaScript's type-safe strict equality operator === instead of the equality operator ==. Compliance with this practice is enforced by the project's ESLint configuration, via the "eqeqeq" rule. The script used to generate the changelog for Arduino IDE's auto-update dialog contained an inappropriate usage of the equality operator. This caused linting runs to fail: arduino-ide-extension/scripts/compose-changelog.js 37:19 error Expected '===' and instead saw '==' eqeqeq --- arduino-ide-extension/scripts/compose-changelog.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arduino-ide-extension/scripts/compose-changelog.js b/arduino-ide-extension/scripts/compose-changelog.js index aba9dae46..f8a4c42ba 100755 --- a/arduino-ide-extension/scripts/compose-changelog.js +++ b/arduino-ide-extension/scripts/compose-changelog.js @@ -34,7 +34,7 @@ }, ''); const args = process.argv.slice(2); - if (args.length == 0) { + if (args.length === 0) { console.error('Missing argument to destination file'); process.exit(1); }