From 060f779e0d7469d06c987b976190e70f1b348cf6 Mon Sep 17 00:00:00 2001 From: 2nofa11 Date: Fri, 11 Jul 2025 21:13:00 +0900 Subject: [PATCH 1/3] chore:use codemod Mocha/Vitest/Recipe --- package.json | 16 ++++++++-------- tests/fixtures/typescript/tsconfig.json | 2 +- tests/integrations/eslint-plugin-import.js | 1 + .../eslint-plugin-import/package.json | 2 +- tests/integrations/flat-config.js | 1 + tests/integrations/flat-config/package.json | 2 +- tests/lib/autofix.js | 1 + tests/lib/configs/eslintrc.js | 1 + tests/lib/configs/flat.js | 1 + tests/lib/meta.js | 1 + tests/lib/rules-without-vue-eslint-parser.js | 1 + tests/lib/rules-without-vue-sfc.js | 1 + tests/lib/rules/block-order.js | 1 + tests/lib/rules/comment-directive.js | 1 + tests/lib/rules/jsx-uses-vars.js | 1 + tests/lib/rules/no-unused-properties.js | 1 + tests/lib/script-setup-vars.js | 1 + tests/lib/utils/casing.js | 1 + tests/lib/utils/comments.js | 1 + tests/lib/utils/html-comments.js | 1 + tests/lib/utils/index.js | 1 + tests/lib/utils/ref-object-references.js | 1 + tests/lib/utils/regexp.js | 1 + tests/lib/utils/selector.js | 1 + .../utils/ts-utils/index/get-component-emits.js | 1 + .../utils/ts-utils/index/get-component-props.js | 1 + .../utils/ts-utils/index/get-component-slots.js | 1 + tsconfig.json | 10 +++++++--- vitest.config.ts | 10 ++++++++++ 29 files changed, 51 insertions(+), 14 deletions(-) create mode 100644 vitest.config.ts diff --git a/package.json b/package.json index a473deb46..4a4dc32b9 100644 --- a/package.json +++ b/package.json @@ -7,10 +7,7 @@ "scripts": { "new": "node tools/new-rule.js", "start": "npm run test:base -- --watch --growl", - "test:base": "mocha \"tests/lib/**/*.js\" --reporter dot", - "test": "nyc npm run test:base -- \"tests/integrations/*.js\" --timeout 60000", - "test:integrations": "mocha \"tests/integrations/*.js\" --timeout 60000", - "debug": "mocha --inspect \"tests/lib/**/*.js\" --reporter dot --timeout 60000", + "test": "vitest run", "cover": "npm run cover:test && npm run cover:report", "cover:test": "nyc npm run test:base -- --timeout 60000", "cover:report": "nyc report --reporter=html", @@ -27,7 +24,9 @@ "docs:build": "vitepress build docs", "generate:version": "env-cmd -e version npm run update && npm run lint -- --fix", "changeset:version": "changeset version && npm run generate:version && git add --all", - "changeset:publish": "npm run typegen && changeset publish" + "changeset:publish": "npm run typegen && changeset publish", + "test:watch": "vitest watch", + "coverage": "vitest run --coverage" }, "files": [ "lib" @@ -106,13 +105,14 @@ "globals": "^15.14.0", "jsdom": "^22.0.0", "markdownlint-cli": "^0.42.0", - "mocha": "^10.7.3", "nyc": "^17.1.0", "pathe": "^1.1.2", "prettier": "^3.3.3", "typescript": "^5.7.2", "vite-plugin-eslint4b": "^0.5.1", "vitepress": "^1.4.1", - "vue-eslint-parser": "^10.0.0" + "vue-eslint-parser": "^10.0.0", + "vitest": "^1.0.1", + "@vitest/coverage-v8": "^1.0.1" } -} +} \ No newline at end of file diff --git a/tests/fixtures/typescript/tsconfig.json b/tests/fixtures/typescript/tsconfig.json index c13ef64e3..ab538ca69 100644 --- a/tests/fixtures/typescript/tsconfig.json +++ b/tests/fixtures/typescript/tsconfig.json @@ -3,4 +3,4 @@ "strict": true, "skipLibCheck": true } -} +} \ No newline at end of file diff --git a/tests/integrations/eslint-plugin-import.js b/tests/integrations/eslint-plugin-import.js index 4e26508ce..506706ba0 100644 --- a/tests/integrations/eslint-plugin-import.js +++ b/tests/integrations/eslint-plugin-import.js @@ -1,3 +1,4 @@ +import { describe, it } from "vitest"; /** * @author Toru Nagashima * @copyright 2017 Toru Nagashima. All rights reserved. diff --git a/tests/integrations/eslint-plugin-import/package.json b/tests/integrations/eslint-plugin-import/package.json index 6de5b12e5..9ff64e397 100644 --- a/tests/integrations/eslint-plugin-import/package.json +++ b/tests/integrations/eslint-plugin-import/package.json @@ -12,4 +12,4 @@ "eslint-plugin-import": "~2.23.4", "eslint-plugin-vue": "file:../../.." } -} +} \ No newline at end of file diff --git a/tests/integrations/flat-config.js b/tests/integrations/flat-config.js index df5190021..1a25cf960 100644 --- a/tests/integrations/flat-config.js +++ b/tests/integrations/flat-config.js @@ -1,3 +1,4 @@ +import { describe, it } from "vitest"; 'use strict' const { strict: assert } = require('assert') diff --git a/tests/integrations/flat-config/package.json b/tests/integrations/flat-config/package.json index e46b5e1b6..1092d5c64 100644 --- a/tests/integrations/flat-config/package.json +++ b/tests/integrations/flat-config/package.json @@ -10,4 +10,4 @@ "eslint": "^9.0.0-0", "eslint-plugin-vue": "file:../../.." } -} +} \ No newline at end of file diff --git a/tests/lib/autofix.js b/tests/lib/autofix.js index 0711b931c..ed0475b99 100644 --- a/tests/lib/autofix.js +++ b/tests/lib/autofix.js @@ -1,3 +1,4 @@ +import { describe, it } from "vitest"; /** * @author Yosuke Ota * See LICENSE file in root directory for full license. diff --git a/tests/lib/configs/eslintrc.js b/tests/lib/configs/eslintrc.js index a9febaeeb..e8b058fb2 100644 --- a/tests/lib/configs/eslintrc.js +++ b/tests/lib/configs/eslintrc.js @@ -1,3 +1,4 @@ +import { describe, it } from "vitest"; 'use strict' const { ESLint } = require('../../eslint-compat') diff --git a/tests/lib/configs/flat.js b/tests/lib/configs/flat.js index 51449953a..3c5b61aae 100644 --- a/tests/lib/configs/flat.js +++ b/tests/lib/configs/flat.js @@ -1,3 +1,4 @@ +import { describe, it } from "vitest"; /** * @fileoverview flat configs test * @author 唯然 diff --git a/tests/lib/meta.js b/tests/lib/meta.js index f9012ce03..469ef836f 100644 --- a/tests/lib/meta.js +++ b/tests/lib/meta.js @@ -1,3 +1,4 @@ +import { describe, it } from "vitest"; 'use strict' const assert = require('assert') diff --git a/tests/lib/rules-without-vue-eslint-parser.js b/tests/lib/rules-without-vue-eslint-parser.js index e5977f1e2..c72b7793e 100644 --- a/tests/lib/rules-without-vue-eslint-parser.js +++ b/tests/lib/rules-without-vue-eslint-parser.js @@ -1,3 +1,4 @@ +import { describe, it } from "vitest"; /** * @author Toru Nagashima * See LICENSE file in root directory for full license. diff --git a/tests/lib/rules-without-vue-sfc.js b/tests/lib/rules-without-vue-sfc.js index 7a8b668a9..82c5a4afe 100644 --- a/tests/lib/rules-without-vue-sfc.js +++ b/tests/lib/rules-without-vue-sfc.js @@ -1,3 +1,4 @@ +import { describe, it } from "vitest"; /** * @author Yosuke Ota * See LICENSE file in root directory for full license. diff --git a/tests/lib/rules/block-order.js b/tests/lib/rules/block-order.js index 8da11c5ac..7d322afc6 100644 --- a/tests/lib/rules/block-order.js +++ b/tests/lib/rules/block-order.js @@ -1,3 +1,4 @@ +import { describe, it } from "vitest"; /** * @author Yosuke Ota */ diff --git a/tests/lib/rules/comment-directive.js b/tests/lib/rules/comment-directive.js index b9acb1092..41c6674c5 100644 --- a/tests/lib/rules/comment-directive.js +++ b/tests/lib/rules/comment-directive.js @@ -1,3 +1,4 @@ +import { describe, it } from "vitest"; /** * @fileoverview Tests for comment-directive rule. * @author Toru Nagashima diff --git a/tests/lib/rules/jsx-uses-vars.js b/tests/lib/rules/jsx-uses-vars.js index 81d907dae..32ee917da 100644 --- a/tests/lib/rules/jsx-uses-vars.js +++ b/tests/lib/rules/jsx-uses-vars.js @@ -1,3 +1,4 @@ +import { describe } from "vitest"; /** * @fileoverview Prevent variables used in JSX to be marked as unused * @author Michał Sajnóg diff --git a/tests/lib/rules/no-unused-properties.js b/tests/lib/rules/no-unused-properties.js index b89ea01f0..b4bd2ded9 100644 --- a/tests/lib/rules/no-unused-properties.js +++ b/tests/lib/rules/no-unused-properties.js @@ -1,3 +1,4 @@ +import { describe, it } from "vitest"; /** * @fileoverview Disallow unused properties, data and computed properties. * @author Learning Equality diff --git a/tests/lib/script-setup-vars.js b/tests/lib/script-setup-vars.js index 6e4438e6a..30b7687b8 100644 --- a/tests/lib/script-setup-vars.js +++ b/tests/lib/script-setup-vars.js @@ -1,3 +1,4 @@ +import { describe } from "vitest"; 'use strict' const semver = require('semver') diff --git a/tests/lib/utils/casing.js b/tests/lib/utils/casing.js index dfcc70e0b..28e6b7e61 100644 --- a/tests/lib/utils/casing.js +++ b/tests/lib/utils/casing.js @@ -1,3 +1,4 @@ +import { describe, it } from "vitest"; 'use strict' const casing = require('../../../lib/utils/casing') diff --git a/tests/lib/utils/comments.js b/tests/lib/utils/comments.js index 9e567f6b1..a31bf8157 100644 --- a/tests/lib/utils/comments.js +++ b/tests/lib/utils/comments.js @@ -1,3 +1,4 @@ +import { describe, it } from "vitest"; 'use strict' const assert = require('assert') diff --git a/tests/lib/utils/html-comments.js b/tests/lib/utils/html-comments.js index 69992b09d..6280f5087 100644 --- a/tests/lib/utils/html-comments.js +++ b/tests/lib/utils/html-comments.js @@ -1,3 +1,4 @@ +import { describe, it } from "vitest"; 'use strict' const fs = require('fs') diff --git a/tests/lib/utils/index.js b/tests/lib/utils/index.js index 6afecaeaa..8dda85831 100644 --- a/tests/lib/utils/index.js +++ b/tests/lib/utils/index.js @@ -1,3 +1,4 @@ +import { describe, it } from "vitest"; 'use strict' const espree = require('espree') diff --git a/tests/lib/utils/ref-object-references.js b/tests/lib/utils/ref-object-references.js index 68c526b36..ce3e91ef7 100644 --- a/tests/lib/utils/ref-object-references.js +++ b/tests/lib/utils/ref-object-references.js @@ -1,3 +1,4 @@ +import { describe, it } from "vitest"; 'use strict' const fs = require('fs') diff --git a/tests/lib/utils/regexp.js b/tests/lib/utils/regexp.js index e27a0596f..ee127a345 100644 --- a/tests/lib/utils/regexp.js +++ b/tests/lib/utils/regexp.js @@ -1,3 +1,4 @@ +import { describe, it } from "vitest"; 'use strict' const { diff --git a/tests/lib/utils/selector.js b/tests/lib/utils/selector.js index b5b0ee986..da488cffd 100644 --- a/tests/lib/utils/selector.js +++ b/tests/lib/utils/selector.js @@ -1,3 +1,4 @@ +import { describe, it } from "vitest"; 'use strict' const fs = require('fs') diff --git a/tests/lib/utils/ts-utils/index/get-component-emits.js b/tests/lib/utils/ts-utils/index/get-component-emits.js index 8c9d5d34c..2bf01ba8d 100644 --- a/tests/lib/utils/ts-utils/index/get-component-emits.js +++ b/tests/lib/utils/ts-utils/index/get-component-emits.js @@ -1,3 +1,4 @@ +import { describe, it } from "vitest"; /** * Test for getComponentEmitsFromTypeDefineTypes */ diff --git a/tests/lib/utils/ts-utils/index/get-component-props.js b/tests/lib/utils/ts-utils/index/get-component-props.js index 100d0a18c..319a94f2f 100644 --- a/tests/lib/utils/ts-utils/index/get-component-props.js +++ b/tests/lib/utils/ts-utils/index/get-component-props.js @@ -1,3 +1,4 @@ +import { describe, it } from "vitest"; /** * Test for getComponentPropsFromTypeDefineTypes */ diff --git a/tests/lib/utils/ts-utils/index/get-component-slots.js b/tests/lib/utils/ts-utils/index/get-component-slots.js index 410021b93..312a4a6cd 100644 --- a/tests/lib/utils/ts-utils/index/get-component-slots.js +++ b/tests/lib/utils/ts-utils/index/get-component-slots.js @@ -1,3 +1,4 @@ +import { describe, it } from "vitest"; /** * Test for getComponentSlotsFromTypeDefineTypes */ diff --git a/tsconfig.json b/tsconfig.json index b488a6b93..db90de1d2 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -3,7 +3,9 @@ "target": "ES2019", "module": "node16", "moduleResolution": "Node16", - "lib": ["es2020"], + "lib": [ + "es2020" + ], "allowJs": true, "checkJs": true, "noEmit": true, @@ -19,7 +21,9 @@ "resolveJsonModule": true, "baseUrl": ".", "paths": { - "*": ["typings/*"] + "*": [ + "typings/*" + ] }, "skipLibCheck": true }, @@ -29,4 +33,4 @@ "docs/.vitepress/**/*.ts", "docs/.vitepress/**/*.mts" ] -} +} \ No newline at end of file diff --git a/vitest.config.ts b/vitest.config.ts new file mode 100644 index 000000000..f67ef4052 --- /dev/null +++ b/vitest.config.ts @@ -0,0 +1,10 @@ + +import { configDefaults, defineConfig } from 'vitest/config'; +export default defineConfig({ + test: { + include: [...configDefaults.include, '**/test/*.ts'], + passWithNoTests: true, + testTimeout: 10_000, + }, +}); + \ No newline at end of file From ca238e072eb562f70fe1c4da54da7a6ab127372d Mon Sep 17 00:00:00 2001 From: 2nofa11 Date: Fri, 11 Jul 2025 21:51:28 +0900 Subject: [PATCH 2/3] chore: migrate to vitest (manual support part) --- package.json | 18 ++++++++--------- tests/fixtures/typescript/tsconfig.json | 2 +- tests/integrations/eslint-plugin-import.js | 16 +++++---------- .../eslint-plugin-import/package.json | 2 +- tests/integrations/flat-config.js | 15 +++++--------- tests/integrations/flat-config/package.json | 2 +- tsconfig.json | 10 +++------- vitest.config.ts | 20 ++++++++++++++++--- 8 files changed, 42 insertions(+), 43 deletions(-) diff --git a/package.json b/package.json index 4a4dc32b9..4e6ef5cc0 100644 --- a/package.json +++ b/package.json @@ -7,10 +7,13 @@ "scripts": { "new": "node tools/new-rule.js", "start": "npm run test:base -- --watch --growl", + "test:base": "vitest run --reporter=dot tests/lib", "test": "vitest run", + "test:integrations": "vitest run tests/integrations", + "debug": "vitest run --inspect --no-file-parallelism --reporter=dot tests/lib", "cover": "npm run cover:test && npm run cover:report", - "cover:test": "nyc npm run test:base -- --timeout 60000", - "cover:report": "nyc report --reporter=html", + "cover:test": "vitest run --coverage --reporter=dot tests/lib", + "cover:report": "echo 'HTML coverage report available at ./coverage/index.html'", "lint": "eslint . && markdownlint \"**/*.md\"", "lint:fix": "eslint . --fix && markdownlint \"**/*.md\" --fix", "tsc": "tsc", @@ -24,9 +27,7 @@ "docs:build": "vitepress build docs", "generate:version": "env-cmd -e version npm run update && npm run lint -- --fix", "changeset:version": "changeset version && npm run generate:version && git add --all", - "changeset:publish": "npm run typegen && changeset publish", - "test:watch": "vitest watch", - "coverage": "vitest run --coverage" + "changeset:publish": "npm run typegen && changeset publish" }, "files": [ "lib" @@ -105,14 +106,13 @@ "globals": "^15.14.0", "jsdom": "^22.0.0", "markdownlint-cli": "^0.42.0", - "nyc": "^17.1.0", "pathe": "^1.1.2", "prettier": "^3.3.3", "typescript": "^5.7.2", "vite-plugin-eslint4b": "^0.5.1", "vitepress": "^1.4.1", "vue-eslint-parser": "^10.0.0", - "vitest": "^1.0.1", - "@vitest/coverage-v8": "^1.0.1" + "vitest": "^3.2.4", + "@vitest/coverage-v8": "^3.2.4" } -} \ No newline at end of file +} diff --git a/tests/fixtures/typescript/tsconfig.json b/tests/fixtures/typescript/tsconfig.json index ab538ca69..c13ef64e3 100644 --- a/tests/fixtures/typescript/tsconfig.json +++ b/tests/fixtures/typescript/tsconfig.json @@ -3,4 +3,4 @@ "strict": true, "skipLibCheck": true } -} \ No newline at end of file +} diff --git a/tests/integrations/eslint-plugin-import.js b/tests/integrations/eslint-plugin-import.js index 506706ba0..9539a533c 100644 --- a/tests/integrations/eslint-plugin-import.js +++ b/tests/integrations/eslint-plugin-import.js @@ -1,4 +1,4 @@ -import { describe, it } from "vitest"; +import { beforeAll, describe, it } from "vitest"; /** * @author Toru Nagashima * @copyright 2017 Toru Nagashima. All rights reserved. @@ -10,18 +10,12 @@ const cp = require('child_process') const path = require('path') const semver = require('semver') +const PLUGIN_DIR = path.join(__dirname, 'eslint-plugin-import') const ESLINT = `.${path.sep}node_modules${path.sep}.bin${path.sep}eslint` describe('Integration with eslint-plugin-import', () => { - let originalCwd - - before(() => { - originalCwd = process.cwd() - process.chdir(path.join(__dirname, 'eslint-plugin-import')) - cp.execSync('npm i', { stdio: 'inherit' }) - }) - after(() => { - process.chdir(originalCwd) + beforeAll(() => { + cp.execSync('npm i', { cwd: PLUGIN_DIR, stdio: 'inherit' }) }) // https://github.com/vuejs/eslint-plugin-vue/issues/21#issuecomment-308957697 @@ -42,6 +36,6 @@ describe('Integration with eslint-plugin-import', () => { return } - cp.execSync(`${ESLINT} a.vue`, { stdio: 'inherit' }) + cp.execSync(`${ESLINT} a.vue`, { cwd: PLUGIN_DIR, stdio: 'inherit' }) }) }) diff --git a/tests/integrations/eslint-plugin-import/package.json b/tests/integrations/eslint-plugin-import/package.json index 9ff64e397..6de5b12e5 100644 --- a/tests/integrations/eslint-plugin-import/package.json +++ b/tests/integrations/eslint-plugin-import/package.json @@ -12,4 +12,4 @@ "eslint-plugin-import": "~2.23.4", "eslint-plugin-vue": "file:../../.." } -} \ No newline at end of file +} diff --git a/tests/integrations/flat-config.js b/tests/integrations/flat-config.js index 1a25cf960..9d49dda7e 100644 --- a/tests/integrations/flat-config.js +++ b/tests/integrations/flat-config.js @@ -1,4 +1,4 @@ -import { describe, it } from "vitest"; +import { beforeAll, describe, it } from "vitest"; 'use strict' const { strict: assert } = require('assert') @@ -6,18 +6,12 @@ const cp = require('child_process') const path = require('path') const semver = require('semver') +const TARGET_DIR = path.join(__dirname, 'flat-config') const ESLINT = `.${path.sep}node_modules${path.sep}.bin${path.sep}eslint` describe('Integration with flat config', () => { - let originalCwd - - before(() => { - originalCwd = process.cwd() - process.chdir(path.join(__dirname, 'flat-config')) - cp.execSync('npm i -f', { stdio: 'inherit' }) - }) - after(() => { - process.chdir(originalCwd) + beforeAll(() => { + cp.execSync('npm i -f', { cwd: TARGET_DIR, stdio: 'inherit' }) }) it('should lint without errors', () => { @@ -34,6 +28,7 @@ describe('Integration with flat config', () => { const result = JSON.parse( cp.execSync(`${ESLINT} a.vue --format=json`, { + cwd: TARGET_DIR, encoding: 'utf8' }) ) diff --git a/tests/integrations/flat-config/package.json b/tests/integrations/flat-config/package.json index 1092d5c64..e46b5e1b6 100644 --- a/tests/integrations/flat-config/package.json +++ b/tests/integrations/flat-config/package.json @@ -10,4 +10,4 @@ "eslint": "^9.0.0-0", "eslint-plugin-vue": "file:../../.." } -} \ No newline at end of file +} diff --git a/tsconfig.json b/tsconfig.json index db90de1d2..b488a6b93 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -3,9 +3,7 @@ "target": "ES2019", "module": "node16", "moduleResolution": "Node16", - "lib": [ - "es2020" - ], + "lib": ["es2020"], "allowJs": true, "checkJs": true, "noEmit": true, @@ -21,9 +19,7 @@ "resolveJsonModule": true, "baseUrl": ".", "paths": { - "*": [ - "typings/*" - ] + "*": ["typings/*"] }, "skipLibCheck": true }, @@ -33,4 +29,4 @@ "docs/.vitepress/**/*.ts", "docs/.vitepress/**/*.mts" ] -} \ No newline at end of file +} diff --git a/vitest.config.ts b/vitest.config.ts index f67ef4052..74bea927a 100644 --- a/vitest.config.ts +++ b/vitest.config.ts @@ -2,9 +2,23 @@ import { configDefaults, defineConfig } from 'vitest/config'; export default defineConfig({ test: { - include: [...configDefaults.include, '**/test/*.ts'], + include: [...configDefaults.include, 'tests/lib/**/*.js', 'tests/integrations/**/*.js'], + exclude: [...configDefaults.exclude, 'tests/fixtures/**'], passWithNoTests: true, - testTimeout: 10_000, + testTimeout: 60_000, + globals: true, + coverage: { + provider: 'v8', + include: ['lib/**/*.js'], + exclude: [ + 'tests/**', + 'dist/**', + 'tools/**', + 'node_modules/**' + ], + reporter: ['text', 'lcov', 'json-summary', 'html'], + all: true, + reportsDirectory: './coverage' + }, }, }); - \ No newline at end of file From 97312e7df46fb21bb159d718c97b9b654ca365a5 Mon Sep 17 00:00:00 2001 From: 2nofa11 Date: Sat, 12 Jul 2025 16:39:29 +0900 Subject: [PATCH 3/3] chore: use vitest globals instead of imports in tests --- eslint.config.mjs | 2 +- tests/integrations/eslint-plugin-import.js | 1 - tests/integrations/flat-config.js | 1 - tests/lib/autofix.js | 1 - tests/lib/configs/eslintrc.js | 1 - tests/lib/configs/flat.js | 1 - tests/lib/meta.js | 1 - tests/lib/rules-without-vue-eslint-parser.js | 1 - tests/lib/rules-without-vue-sfc.js | 1 - tests/lib/rules/block-order.js | 1 - tests/lib/rules/comment-directive.js | 1 - tests/lib/rules/jsx-uses-vars.js | 1 - tests/lib/rules/no-unused-properties.js | 1 - tests/lib/script-setup-vars.js | 1 - tests/lib/utils/casing.js | 1 - tests/lib/utils/comments.js | 1 - tests/lib/utils/html-comments.js | 1 - tests/lib/utils/index.js | 1 - tests/lib/utils/ref-object-references.js | 1 - tests/lib/utils/regexp.js | 1 - tests/lib/utils/selector.js | 1 - tests/lib/utils/ts-utils/index/get-component-emits.js | 1 - tests/lib/utils/ts-utils/index/get-component-props.js | 1 - tests/lib/utils/ts-utils/index/get-component-slots.js | 1 - 24 files changed, 1 insertion(+), 24 deletions(-) diff --git a/eslint.config.mjs b/eslint.config.mjs index 9cd54f623..1de2500f4 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -77,7 +77,7 @@ export default typegen([ globals: { ...globals.es6, ...globals.node, - ...globals.mocha + ...globals.vitest } }, linterOptions: { diff --git a/tests/integrations/eslint-plugin-import.js b/tests/integrations/eslint-plugin-import.js index 9539a533c..6f4be7acf 100644 --- a/tests/integrations/eslint-plugin-import.js +++ b/tests/integrations/eslint-plugin-import.js @@ -1,4 +1,3 @@ -import { beforeAll, describe, it } from "vitest"; /** * @author Toru Nagashima * @copyright 2017 Toru Nagashima. All rights reserved. diff --git a/tests/integrations/flat-config.js b/tests/integrations/flat-config.js index 9d49dda7e..9dd2f2ad8 100644 --- a/tests/integrations/flat-config.js +++ b/tests/integrations/flat-config.js @@ -1,4 +1,3 @@ -import { beforeAll, describe, it } from "vitest"; 'use strict' const { strict: assert } = require('assert') diff --git a/tests/lib/autofix.js b/tests/lib/autofix.js index ed0475b99..0711b931c 100644 --- a/tests/lib/autofix.js +++ b/tests/lib/autofix.js @@ -1,4 +1,3 @@ -import { describe, it } from "vitest"; /** * @author Yosuke Ota * See LICENSE file in root directory for full license. diff --git a/tests/lib/configs/eslintrc.js b/tests/lib/configs/eslintrc.js index e8b058fb2..a9febaeeb 100644 --- a/tests/lib/configs/eslintrc.js +++ b/tests/lib/configs/eslintrc.js @@ -1,4 +1,3 @@ -import { describe, it } from "vitest"; 'use strict' const { ESLint } = require('../../eslint-compat') diff --git a/tests/lib/configs/flat.js b/tests/lib/configs/flat.js index 3c5b61aae..51449953a 100644 --- a/tests/lib/configs/flat.js +++ b/tests/lib/configs/flat.js @@ -1,4 +1,3 @@ -import { describe, it } from "vitest"; /** * @fileoverview flat configs test * @author 唯然 diff --git a/tests/lib/meta.js b/tests/lib/meta.js index 469ef836f..f9012ce03 100644 --- a/tests/lib/meta.js +++ b/tests/lib/meta.js @@ -1,4 +1,3 @@ -import { describe, it } from "vitest"; 'use strict' const assert = require('assert') diff --git a/tests/lib/rules-without-vue-eslint-parser.js b/tests/lib/rules-without-vue-eslint-parser.js index c72b7793e..e5977f1e2 100644 --- a/tests/lib/rules-without-vue-eslint-parser.js +++ b/tests/lib/rules-without-vue-eslint-parser.js @@ -1,4 +1,3 @@ -import { describe, it } from "vitest"; /** * @author Toru Nagashima * See LICENSE file in root directory for full license. diff --git a/tests/lib/rules-without-vue-sfc.js b/tests/lib/rules-without-vue-sfc.js index 82c5a4afe..7a8b668a9 100644 --- a/tests/lib/rules-without-vue-sfc.js +++ b/tests/lib/rules-without-vue-sfc.js @@ -1,4 +1,3 @@ -import { describe, it } from "vitest"; /** * @author Yosuke Ota * See LICENSE file in root directory for full license. diff --git a/tests/lib/rules/block-order.js b/tests/lib/rules/block-order.js index 7d322afc6..8da11c5ac 100644 --- a/tests/lib/rules/block-order.js +++ b/tests/lib/rules/block-order.js @@ -1,4 +1,3 @@ -import { describe, it } from "vitest"; /** * @author Yosuke Ota */ diff --git a/tests/lib/rules/comment-directive.js b/tests/lib/rules/comment-directive.js index 41c6674c5..b9acb1092 100644 --- a/tests/lib/rules/comment-directive.js +++ b/tests/lib/rules/comment-directive.js @@ -1,4 +1,3 @@ -import { describe, it } from "vitest"; /** * @fileoverview Tests for comment-directive rule. * @author Toru Nagashima diff --git a/tests/lib/rules/jsx-uses-vars.js b/tests/lib/rules/jsx-uses-vars.js index 32ee917da..81d907dae 100644 --- a/tests/lib/rules/jsx-uses-vars.js +++ b/tests/lib/rules/jsx-uses-vars.js @@ -1,4 +1,3 @@ -import { describe } from "vitest"; /** * @fileoverview Prevent variables used in JSX to be marked as unused * @author Michał Sajnóg diff --git a/tests/lib/rules/no-unused-properties.js b/tests/lib/rules/no-unused-properties.js index b4bd2ded9..b89ea01f0 100644 --- a/tests/lib/rules/no-unused-properties.js +++ b/tests/lib/rules/no-unused-properties.js @@ -1,4 +1,3 @@ -import { describe, it } from "vitest"; /** * @fileoverview Disallow unused properties, data and computed properties. * @author Learning Equality diff --git a/tests/lib/script-setup-vars.js b/tests/lib/script-setup-vars.js index 30b7687b8..6e4438e6a 100644 --- a/tests/lib/script-setup-vars.js +++ b/tests/lib/script-setup-vars.js @@ -1,4 +1,3 @@ -import { describe } from "vitest"; 'use strict' const semver = require('semver') diff --git a/tests/lib/utils/casing.js b/tests/lib/utils/casing.js index 28e6b7e61..dfcc70e0b 100644 --- a/tests/lib/utils/casing.js +++ b/tests/lib/utils/casing.js @@ -1,4 +1,3 @@ -import { describe, it } from "vitest"; 'use strict' const casing = require('../../../lib/utils/casing') diff --git a/tests/lib/utils/comments.js b/tests/lib/utils/comments.js index a31bf8157..9e567f6b1 100644 --- a/tests/lib/utils/comments.js +++ b/tests/lib/utils/comments.js @@ -1,4 +1,3 @@ -import { describe, it } from "vitest"; 'use strict' const assert = require('assert') diff --git a/tests/lib/utils/html-comments.js b/tests/lib/utils/html-comments.js index 6280f5087..69992b09d 100644 --- a/tests/lib/utils/html-comments.js +++ b/tests/lib/utils/html-comments.js @@ -1,4 +1,3 @@ -import { describe, it } from "vitest"; 'use strict' const fs = require('fs') diff --git a/tests/lib/utils/index.js b/tests/lib/utils/index.js index 8dda85831..6afecaeaa 100644 --- a/tests/lib/utils/index.js +++ b/tests/lib/utils/index.js @@ -1,4 +1,3 @@ -import { describe, it } from "vitest"; 'use strict' const espree = require('espree') diff --git a/tests/lib/utils/ref-object-references.js b/tests/lib/utils/ref-object-references.js index ce3e91ef7..68c526b36 100644 --- a/tests/lib/utils/ref-object-references.js +++ b/tests/lib/utils/ref-object-references.js @@ -1,4 +1,3 @@ -import { describe, it } from "vitest"; 'use strict' const fs = require('fs') diff --git a/tests/lib/utils/regexp.js b/tests/lib/utils/regexp.js index ee127a345..e27a0596f 100644 --- a/tests/lib/utils/regexp.js +++ b/tests/lib/utils/regexp.js @@ -1,4 +1,3 @@ -import { describe, it } from "vitest"; 'use strict' const { diff --git a/tests/lib/utils/selector.js b/tests/lib/utils/selector.js index da488cffd..b5b0ee986 100644 --- a/tests/lib/utils/selector.js +++ b/tests/lib/utils/selector.js @@ -1,4 +1,3 @@ -import { describe, it } from "vitest"; 'use strict' const fs = require('fs') diff --git a/tests/lib/utils/ts-utils/index/get-component-emits.js b/tests/lib/utils/ts-utils/index/get-component-emits.js index 2bf01ba8d..8c9d5d34c 100644 --- a/tests/lib/utils/ts-utils/index/get-component-emits.js +++ b/tests/lib/utils/ts-utils/index/get-component-emits.js @@ -1,4 +1,3 @@ -import { describe, it } from "vitest"; /** * Test for getComponentEmitsFromTypeDefineTypes */ diff --git a/tests/lib/utils/ts-utils/index/get-component-props.js b/tests/lib/utils/ts-utils/index/get-component-props.js index 319a94f2f..100d0a18c 100644 --- a/tests/lib/utils/ts-utils/index/get-component-props.js +++ b/tests/lib/utils/ts-utils/index/get-component-props.js @@ -1,4 +1,3 @@ -import { describe, it } from "vitest"; /** * Test for getComponentPropsFromTypeDefineTypes */ diff --git a/tests/lib/utils/ts-utils/index/get-component-slots.js b/tests/lib/utils/ts-utils/index/get-component-slots.js index 312a4a6cd..410021b93 100644 --- a/tests/lib/utils/ts-utils/index/get-component-slots.js +++ b/tests/lib/utils/ts-utils/index/get-component-slots.js @@ -1,4 +1,3 @@ -import { describe, it } from "vitest"; /** * Test for getComponentSlotsFromTypeDefineTypes */