From 01e4abd48958115de8fbadde4c4b6c1862b9e67c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 3 Jul 2026 12:39:26 +0000 Subject: [PATCH 1/5] chore(deps): bump the npm-dependencies group with 3 updates Bumps the npm-dependencies group with 3 updates: [@babel/runtime](https://github.com/babel/babel/tree/HEAD/packages/babel-runtime), [@eslint/js](https://github.com/eslint/eslint/tree/HEAD/packages/js) and [eslint](https://github.com/eslint/eslint). Updates `@babel/runtime` from 7.29.7 to 8.0.0 - [Release notes](https://github.com/babel/babel/releases) - [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md) - [Commits](https://github.com/babel/babel/commits/v8.0.0/packages/babel-runtime) Updates `@eslint/js` from 9.39.4 to 10.0.1 - [Release notes](https://github.com/eslint/eslint/releases) - [Commits](https://github.com/eslint/eslint/commits/v10.0.1/packages/js) Updates `eslint` from 9.39.4 to 10.6.0 - [Release notes](https://github.com/eslint/eslint/releases) - [Commits](https://github.com/eslint/eslint/compare/v9.39.4...v10.6.0) --- updated-dependencies: - dependency-name: "@babel/runtime" dependency-version: 8.0.0 dependency-type: direct:production update-type: version-update:semver-major dependency-group: npm-dependencies - dependency-name: "@eslint/js" dependency-version: 10.0.1 dependency-type: direct:development update-type: version-update:semver-major dependency-group: npm-dependencies - dependency-name: eslint dependency-version: 10.6.0 dependency-type: direct:development update-type: version-update:semver-major dependency-group: npm-dependencies ... Signed-off-by: dependabot[bot] --- package.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 54345fd..dd0aaa2 100644 --- a/package.json +++ b/package.json @@ -39,10 +39,10 @@ "tsc": "npm run lint:tsc" }, "dependencies": { - "@babel/runtime": "^7.29.7" + "@babel/runtime": "^8.0.0" }, "devDependencies": { - "@eslint/js": "^9.39.4", + "@eslint/js": "^10.0.1", "@rc-component/father-plugin": "^2.2.0", "@rc-component/np": "^1.0.4", "@testing-library/jest-dom": "^6.9.1", @@ -52,7 +52,7 @@ "@types/react": "^19.2.17", "@types/react-dom": "^19.2.3", "dumi": "^2.4.38", - "eslint": "^9.39.4", + "eslint": "^10.6.0", "eslint-config-prettier": "^10.1.8", "eslint-plugin-jest": "^29.15.4", "eslint-plugin-react": "^7.37.5", From 04114f66295126ac4f7be69fedc68a977438e864 Mon Sep 17 00:00:00 2001 From: afc163 Date: Sun, 5 Jul 2026 15:38:11 +0800 Subject: [PATCH 2/5] fix: support eslint 10 dependency update --- eslint.config.mjs | 5 +++-- package.json | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/eslint.config.mjs b/eslint.config.mjs index 40f08ec..a298e8e 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -1,4 +1,5 @@ import js from '@eslint/js'; +import { fixupConfigRules } from '@eslint/compat'; import { defineConfig } from 'eslint/config'; import { dirname } from 'node:path'; import { fileURLToPath } from 'node:url'; @@ -40,8 +41,8 @@ export default defineConfig([ files: ['**/*.{js,jsx,ts,tsx}'], extends: [ js.configs.recommended, - react.configs.flat.recommended, - react.configs.flat['jsx-runtime'], + ...fixupConfigRules(react.configs.flat.recommended), + ...fixupConfigRules(react.configs.flat['jsx-runtime']), prettier, ], plugins: { diff --git a/package.json b/package.json index dd0aaa2..39d10e3 100644 --- a/package.json +++ b/package.json @@ -43,6 +43,7 @@ }, "devDependencies": { "@eslint/js": "^10.0.1", + "@eslint/compat": "^2.1.0", "@rc-component/father-plugin": "^2.2.0", "@rc-component/np": "^1.0.4", "@testing-library/jest-dom": "^6.9.1", From cf02825f5e57f0f7545ecb9f4bcc4a3ede5acf4d Mon Sep 17 00:00:00 2001 From: afc163 Date: Mon, 6 Jul 2026 09:33:16 +0800 Subject: [PATCH 3/5] fix: resolve eslint 10 lint errors --- src/numberUtil.ts | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/src/numberUtil.ts b/src/numberUtil.ts index 64ab1b4..9c81127 100644 --- a/src/numberUtil.ts +++ b/src/numberUtil.ts @@ -109,15 +109,12 @@ function expandScientificNotation(parsed: ParsedScientificNotation) { const initialDecimalIndex = integerDigits || -leadingDecimalZeros; const decimalIndex = initialDecimalIndex + exponent; - let expanded = ''; - - if (decimalIndex <= 0) { - expanded = `0.${'0'.repeat(-decimalIndex)}${digits}`; - } else if (decimalIndex >= digits.length) { - expanded = `${digits}${'0'.repeat(decimalIndex - digits.length)}`; - } else { - expanded = `${digits.slice(0, decimalIndex)}.${digits.slice(decimalIndex)}`; - } + const expanded = + decimalIndex <= 0 + ? `0.${'0'.repeat(-decimalIndex)}${digits}` + : decimalIndex >= digits.length + ? `${digits}${'0'.repeat(decimalIndex - digits.length)}` + : `${digits.slice(0, decimalIndex)}.${digits.slice(decimalIndex)}`; return `${negative ? '-' : ''}${expanded}`; } From c6c5dcbadaf65c3bb46eafe6640ac12fcd33a7d8 Mon Sep 17 00:00:00 2001 From: afc163 Date: Mon, 6 Jul 2026 09:49:39 +0800 Subject: [PATCH 4/5] test: cover scientific notation expansion --- tests/util.test.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/util.test.tsx b/tests/util.test.tsx index e07ef9c..4c46e93 100644 --- a/tests/util.test.tsx +++ b/tests/util.test.tsx @@ -152,6 +152,8 @@ describe('InputNumber.Util', () => { expect(num2str(0e5)).toEqual('0'); expect(num2str(1.23e-19)).toEqual(`0.${'0'.repeat(18)}123`); expect(num2str(-1.23e-20)).toEqual(`-0.${'0'.repeat(19)}123`); + expect(num2str(1.23e1)).toEqual('12.3'); + expect(num2str(1.23e5)).toEqual('123000'); }); }); From b8df2cd9d5d9fdc7515ffd3a00f44f902dfd4fef Mon Sep 17 00:00:00 2001 From: afc163 Date: Mon, 6 Jul 2026 09:51:46 +0800 Subject: [PATCH 5/5] fix: keep scientific expansion coverage stable --- src/numberUtil.ts | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/numberUtil.ts b/src/numberUtil.ts index 9c81127..51eb6e5 100644 --- a/src/numberUtil.ts +++ b/src/numberUtil.ts @@ -109,12 +109,16 @@ function expandScientificNotation(parsed: ParsedScientificNotation) { const initialDecimalIndex = integerDigits || -leadingDecimalZeros; const decimalIndex = initialDecimalIndex + exponent; - const expanded = - decimalIndex <= 0 - ? `0.${'0'.repeat(-decimalIndex)}${digits}` - : decimalIndex >= digits.length - ? `${digits}${'0'.repeat(decimalIndex - digits.length)}` - : `${digits.slice(0, decimalIndex)}.${digits.slice(decimalIndex)}`; + // eslint-disable-next-line no-useless-assignment + let expanded = ''; + + if (decimalIndex <= 0) { + expanded = `0.${'0'.repeat(-decimalIndex)}${digits}`; + } else if (decimalIndex >= digits.length) { + expanded = `${digits}${'0'.repeat(decimalIndex - digits.length)}`; + } else { + expanded = `${digits.slice(0, decimalIndex)}.${digits.slice(decimalIndex)}`; + } return `${negative ? '-' : ''}${expanded}`; }