diff --git a/eslint.config.js b/eslint.config.js index 6edf43f002..870d60a458 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -613,9 +613,11 @@ export default defineConfig([ rules: { '@typescript-eslint/no-floating-promises': 1, - // https://github.com/vitest-dev/eslint-plugin-vitest?tab=readme-ov-file#rules + // https://github.com/vitest-dev/eslint-plugin-vitest#rules + 'vitest/consistent-each-for': 1, 'vitest/consistent-test-filename': 0, 'vitest/consistent-test-it': 1, + 'vitest/consistent-vitest-vi': 1, 'vitest/expect-expect': 0, 'vitest/hoisted-apis-on-top': 1, 'vitest/max-expects': 0, @@ -626,7 +628,7 @@ export default defineConfig([ 'vitest/no-conditional-in-test': 0, 'vitest/no-conditional-tests': 1, 'vitest/no-disabled-tests': 0, - 'vitest/no-done-callback': 0, + 'vitest/no-done-callback': 1, 'vitest/no-duplicate-hooks': 1, 'vitest/no-focused-tests': 1, 'vitest/no-hooks': 1, @@ -639,8 +641,9 @@ export default defineConfig([ 'vitest/no-restricted-matchers': 0, 'vitest/no-restricted-vi-methods': 0, 'vitest/no-standalone-expect': 1, - 'vitest/no-test-prefixes': 0, - 'vitest/no-test-return-statement': 0, + 'vitest/no-test-prefixes': 1, + 'vitest/no-test-return-statement': 1, + 'vitest/no-unneeded-async-expect-function': 1, 'vitest/padding-around-after-all-blocks': 0, 'vitest/padding-around-after-each-blocks': 0, 'vitest/padding-around-all': 0, @@ -649,19 +652,24 @@ export default defineConfig([ 'vitest/padding-around-describe-blocks': 0, 'vitest/padding-around-expect-groups': 0, 'vitest/padding-around-test-blocks': 0, + 'vitest/prefer-called-exactly-once-with': 1, 'vitest/prefer-called-once': 1, 'vitest/prefer-called-times': 0, 'vitest/prefer-called-with': 0, 'vitest/prefer-comparison-matcher': 1, + 'vitest/prefer-describe-function-title': 0, 'vitest/prefer-each': 1, 'vitest/prefer-equality-matcher': 1, 'vitest/prefer-expect-assertions': 0, 'vitest/prefer-expect-resolves': 1, + 'vitest/prefer-expect-type-of': 1, 'vitest/prefer-hooks-in-order': 1, 'vitest/prefer-hooks-on-top': 1, + 'vitest/prefer-import-in-mock': 1, 'vitest/prefer-importing-vitest-globals': 0, 'vitest/prefer-lowercase-title': 0, 'vitest/prefer-mock-promise-shorthand': 1, + 'vitest/prefer-mock-return-shorthand': 1, 'vitest/prefer-snapshot-hint': 0, 'vitest/prefer-spy-on': 1, 'vitest/prefer-strict-boolean-matchers': 1, @@ -671,19 +679,19 @@ export default defineConfig([ 'vitest/prefer-to-be-object': 0, 'vitest/prefer-to-be-truthy': 0, 'vitest/prefer-to-contain': 1, + 'vitest/prefer-to-have-been-called-times': 1, 'vitest/prefer-to-have-length': 1, 'vitest/prefer-todo': 1, 'vitest/prefer-vi-mocked': 1, 'vitest/require-awaited-expect-poll': 1, 'vitest/require-hook': 0, - 'vitest/require-import-vi-mock': 1, 'vitest/require-local-test-context-for-concurrent-snapshots': 0, 'vitest/require-mock-type-parameters': 0, 'vitest/require-to-throw-message': 0, 'vitest/require-top-level-describe': 0, 'vitest/valid-describe-callback': 1, - 'vitest/valid-expect-in-promise': 1, 'vitest/valid-expect': [1, { alwaysAwait: true }], + 'vitest/valid-expect-in-promise': 1, 'vitest/valid-title': 1, 'vitest/warn-todo': 1, diff --git a/package.json b/package.json index 897d4dee87..671097d9d3 100644 --- a/package.json +++ b/package.json @@ -63,9 +63,9 @@ "@typescript-eslint/eslint-plugin": "^8.48.1", "@typescript-eslint/parser": "^8.48.1", "@vitejs/plugin-react": "^5.1.1", - "@vitest/browser-playwright": "^4.0.15", - "@vitest/coverage-istanbul": "^4.0.15", - "@vitest/eslint-plugin": "^1.5.1", + "@vitest/browser-playwright": "^4.0.16", + "@vitest/coverage-istanbul": "^4.0.16", + "@vitest/eslint-plugin": "^1.6.4", "clsx": "^2.1.1", "ecij": "^0.3.0", "eslint": "^9.39.1", @@ -84,8 +84,8 @@ "rolldown": "^1.0.0-beta.51", "rolldown-plugin-dts": "^0.18.0", "typescript": "~5.9.2", - "vite": "npm:rolldown-vite@^7.2.5", - "vitest": "^4.0.15", + "vite": "^8.0.0-beta.5", + "vitest": "^4.0.16", "vitest-browser-react": "^2.0.2" }, "peerDependencies": { diff --git a/test/browser/column/key.test.ts b/test/browser/column/key.test.ts index 48817be9bb..105e6a1ce3 100644 --- a/test/browser/column/key.test.ts +++ b/test/browser/column/key.test.ts @@ -1,7 +1,7 @@ import type { Column } from '../../../src'; import { setup } from '../utils'; -test('key is escaped in query selectors', () => { +test('key is escaped in query selectors', async () => { const columns: readonly Column[] = [ { key: '!@#%$#%$#()%$#&\n123234\n', @@ -9,7 +9,5 @@ test('key is escaped in query selectors', () => { } ]; - expect(async () => { - await setup({ columns, rows: [] }); - }).not.toThrowError(); + await expect(setup({ columns, rows: [] })).resolves.not.toThrowError(); });