11/**
22 * @author Yosuke Ota <https://github.com/ota-meshi>
33 */
4- "use strict"
54
65//------------------------------------------------------------------------------
76// Requirements
87//------------------------------------------------------------------------------
98
10- const assert = require ( "assert" )
11- const path = require ( "path" )
12- const eslint = require ( "eslint" )
13- const parser = require ( "../src/index.ts" )
14-
15- //------------------------------------------------------------------------------
16- // Helpers
17- //------------------------------------------------------------------------------
18-
19- const Linter = eslint . Linter
9+ import type { ESLint } from "eslint"
10+ import { Linter } from "eslint"
11+ import { assert , describe , it } from "vitest"
12+ import * as parser from "../src/index"
13+ import type { CallExpression , Identifier } from "estree"
2014
2115//------------------------------------------------------------------------------
2216// Tests
@@ -44,12 +38,12 @@ describe("parserServices.defineDocumentVisitor tests", () => {
4438
4539 const linter = new Linter ( { configType : "flat" } )
4640
47- const rules = {
41+ const rules : ESLint . Plugin [ "rules" ] = {
4842 "test-no-forbidden" : {
49- create ( context ) {
43+ create ( context : any ) {
5044 return context . sourceCode . parserServices . defineDocumentVisitor (
5145 {
52- 'Identifier[name="forbidden"]' ( node ) {
46+ 'Identifier[name="forbidden"]' ( node : Identifier ) {
5347 context . report ( {
5448 node,
5549 message : 'no "forbidden"' ,
@@ -60,10 +54,10 @@ describe("parserServices.defineDocumentVisitor tests", () => {
6054 } ,
6155 } ,
6256 "test-no-call" : {
63- create ( context ) {
57+ create ( context : any ) {
6458 return context . sourceCode . parserServices . defineDocumentVisitor (
6559 {
66- CallExpression ( node ) {
60+ CallExpression ( node : CallExpression ) {
6761 context . report ( {
6862 node,
6963 message : "no call" ,
0 commit comments