diff --git a/.gitignore b/.gitignore index ee23a3dc..cc2a3ca8 100644 --- a/.gitignore +++ b/.gitignore @@ -6,4 +6,5 @@ output.txt test-results/ playwright-report/ dist -*.log \ No newline at end of file +*.log +.claude diff --git a/CHANGELOG.md b/CHANGELOG.md index 080779ed..b86ba2ed 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,11 @@ All notable changes to this project will be documented here. -## [Unreleased] +## [0.31.1] - Oct 22nd, 2026 +#### Changed +- Simplified ternary syntax into nullish coalescing in several locations +- Added `@eslint/config-helpers` so ESLint can load `.gitignore` +- Update CHANGELOG capitalization in PR template ## [0.31.0] - Oct 21st, 2026 #### Added diff --git a/eslint.config.mjs b/eslint.config.mjs index 5ee3af48..ce24ac7d 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -2,8 +2,11 @@ import globals from "globals"; import eslint from "@eslint/js"; import stylistic from "@stylistic/eslint-plugin"; import tseslint from "typescript-eslint"; +import { includeIgnoreFile } from "@eslint/config-helpers"; +import { fileURLToPath } from "node:url"; export default [ + includeIgnoreFile(fileURLToPath(new URL(".gitignore", import.meta.url)), "Imported .gitignore patterns"), { // Global ignores // https://eslint.org/docs/latest/use/configure/configuration-files#configuration-objects diff --git a/package-lock.json b/package-lock.json index 6234e231..cbc50981 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,6 +9,7 @@ "version": "0.31.0", "license": "MIT", "devDependencies": { + "@eslint/config-helpers": "^0.7.0", "@eslint/config-inspector": "^1.3.0", "@eslint/js": "^9.11.1", "@playwright/test": "^1.56.0", @@ -1036,16 +1037,29 @@ } }, "node_modules/@eslint/config-helpers": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/@eslint/config-helpers/-/config-helpers-0.4.0.tgz", - "integrity": "sha512-WUFvV4WoIwW8Bv0KeKCIIEgdSiFOsulyN0xrMu+7z43q/hkOLXjvb5u7UC9jDxvRzcrbEmuZBX5yJZz1741jog==", + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/@eslint/config-helpers/-/config-helpers-0.7.0.tgz", + "integrity": "sha512-DObd/KKUsU+FaFv4PLxSRenpXfQWmPXXP3pPZ6/K1PCrMu2vQpMDMuQe/BqYeoLcz8ro0bVDF1RxOJgfVEdhUw==", "dev": true, "license": "Apache-2.0", "dependencies": { - "@eslint/core": "^0.16.0" + "@eslint/core": "^1.2.1" }, "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + "node": "^20.19.0 || ^22.13.0 || >=24" + } + }, + "node_modules/@eslint/config-helpers/node_modules/@eslint/core": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@eslint/core/-/core-1.2.1.tgz", + "integrity": "sha512-MwcE1P+AZ4C6DWlpin/OmOA54mmIZ/+xZuJiQd4SyB29oAJjN30UW9wkKNptW2ctp4cEsvhlLY/CsQ1uoHDloQ==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@types/json-schema": "^7.0.15" + }, + "engines": { + "node": "^20.19.0 || ^22.13.0 || >=24" } }, "node_modules/@eslint/config-inspector": { @@ -6153,6 +6167,32 @@ "node": "^18.18.0 || ^20.9.0 || >=21.1.0" } }, + "node_modules/eslint/node_modules/@eslint/config-helpers": { + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/@eslint/config-helpers/-/config-helpers-0.4.2.tgz", + "integrity": "sha512-gBrxN88gOIf3R7ja5K9slwNayVcZgK6SOUORm2uBzTeIEfeVaIhOpCtTox3P6R7o2jLFwLFTLnC7kU/RGcYEgw==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@eslint/core": "^0.17.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/eslint/node_modules/@eslint/config-helpers/node_modules/@eslint/core": { + "version": "0.17.0", + "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.17.0.tgz", + "integrity": "sha512-yL/sLrpmtDaFEiUj1osRP4TI2MDz1AddJL+jZ7KSqvBuliN4xqYY54IfdN8qD8Toa6g1iloph1fxQNkjOxrrpQ==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@types/json-schema": "^7.0.15" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, "node_modules/eslint/node_modules/eslint-scope": { "version": "8.4.0", "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-8.4.0.tgz", diff --git a/package.json b/package.json index a9a47ba6..fb99a90f 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "ulabel", "description": "An image annotation tool.", - "version": "0.31.0", + "version": "0.31.1", "main": "dist/ulabel.min.js", "module": "dist/ulabel.min.js", "types": "dist/index.d.ts", @@ -60,6 +60,7 @@ "homepage": "https://github.com/SenteraLLC/ulabel", "unpkg": "dist/ulabel.min.js", "devDependencies": { + "@eslint/config-helpers": "^0.7.0", "@eslint/config-inspector": "^1.3.0", "@eslint/js": "^9.11.1", "@playwright/test": "^1.56.0", diff --git a/pull_request_template.md b/pull_request_template.md index 0d4554a4..d465a529 100644 --- a/pull_request_template.md +++ b/pull_request_template.md @@ -10,7 +10,7 @@ - [ ] Version number in `package.json` has been bumped since last release - [ ] Version numbers match between package `package.json` and `src/version.js` - [ ] Updated documentation if necessary (currently just in `api_spec.md`) -- [ ] Added changes to `changelog.md` +- [ ] Added changes to `CHANGELOG.md` ## Breaking API Changes diff --git a/src/annotation.ts b/src/annotation.ts index bbc2cb5c..1f736e97 100644 --- a/src/annotation.ts +++ b/src/annotation.ts @@ -286,9 +286,9 @@ export class ULabelAnnotation { // Return the data, initializing the arrays if they are undefined const ret: PolygonSpatialData = { spatial_payload: annotation.spatial_payload, - containing_box: annotation.containing_box ? annotation.containing_box : null, - spatial_payload_holes: annotation.spatial_payload_holes ? annotation.spatial_payload_holes : [false], - spatial_payload_child_indices: annotation.spatial_payload_child_indices ? annotation.spatial_payload_child_indices : [[]], + containing_box: annotation.containing_box ?? null, + spatial_payload_holes: annotation.spatial_payload_holes ?? [false], + spatial_payload_child_indices: annotation.spatial_payload_child_indices ?? [[]], }; if (deep_copy) { return JSON.parse(JSON.stringify(ret)); diff --git a/src/html_builder.ts b/src/html_builder.ts index c987b2b6..b65b42bc 100644 --- a/src/html_builder.ts +++ b/src/html_builder.ts @@ -726,7 +726,7 @@ export class SliderHandler { value="${this.default_value}" />
` : ""; keybinds_html += ` @@ -829,7 +829,7 @@ export class KeybindsToolboxItem extends ToolboxItem { const is_customized = this.is_class_keybind_customized(keybind.class_id!); const collision_class = has_collision ? " collision" : ""; const customized_class = is_customized ? " customized" : ""; - const display_key = keybind.key != null ? keybind.key : "none"; + const display_key = keybind.key ?? "none"; const reset_button = is_customized ? `` : ""; keybinds_html += ` @@ -860,7 +860,7 @@ export class KeybindsToolboxItem extends ToolboxItem { for (const keybind of other) { const has_collision = this.has_collision(keybind.key, all_keybinds); const collision_class = has_collision ? " collision" : ""; - const display_key = keybind.key !== null && keybind.key !== undefined ? keybind.key : "none"; + const display_key = keybind.key ?? "none"; keybinds_html += `
${keybind.label} diff --git a/src/toolbox_items/submit_buttons.ts b/src/toolbox_items/submit_buttons.ts index fee29fca..2152b3c7 100644 --- a/src/toolbox_items/submit_buttons.ts +++ b/src/toolbox_items/submit_buttons.ts @@ -205,7 +205,7 @@ export class SubmitButtons extends ToolboxItem { const submit_buttons_by_row: ULabelSubmitButton[][] = []; // First, get all the unique row numbers. // If a button doesn't have a row number, it will be placed in row 0. - const row_numbers: Set = new Set(this.submit_buttons.map((button) => button.row_number ? button.row_number : 0)); + const row_numbers: Set = new Set(this.submit_buttons.map((button) => button.row_number ?? 0)); // Sort the row numbers const sorted_row_numbers: number[] = Array.from(row_numbers).sort((a, b) => a - b); // Group the buttons by row number in ascending order diff --git a/src/version.js b/src/version.js index 8754155b..4a332776 100644 --- a/src/version.js +++ b/src/version.js @@ -1 +1 @@ -export const ULABEL_VERSION = "0.31.0"; +export const ULABEL_VERSION = "0.31.1";