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 54345fd..39d10e3 100644 --- a/package.json +++ b/package.json @@ -39,10 +39,11 @@ "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", + "@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", @@ -52,7 +53,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", diff --git a/src/numberUtil.ts b/src/numberUtil.ts index 64ab1b4..51eb6e5 100644 --- a/src/numberUtil.ts +++ b/src/numberUtil.ts @@ -109,6 +109,7 @@ function expandScientificNotation(parsed: ParsedScientificNotation) { const initialDecimalIndex = integerDigits || -leadingDecimalZeros; const decimalIndex = initialDecimalIndex + exponent; + // eslint-disable-next-line no-useless-assignment let expanded = ''; if (decimalIndex <= 0) { 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'); }); });