diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b9b0217..eab195c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -46,9 +46,11 @@ jobs: include: - name: 'Test with Eslint v7' cmd: | - npm i eslint@^7 + npm i eslint@^7 \ + typescript-eslint-utils-5@npm:@typescript-eslint/utils@^5.57.0 cat package-lock.json | grep -A 1 \ -e "\"node_modules/eslint\": {" \ + -e "\"node_modules/typescript-eslint-utils-5\": {" \ test: npm run test build: npm run build - name: 'Test with Typescript v4' diff --git a/tests/rules/deprecation.test.ts b/tests/rules/deprecation.test.ts index c772bea..79e794a 100644 --- a/tests/rules/deprecation.test.ts +++ b/tests/rules/deprecation.test.ts @@ -1,5 +1,5 @@ import { TSESLint } from '@typescript-eslint/utils'; -import { RuleTester } from '@typescript-eslint/rule-tester'; +import { RuleTester } from '../utils/get-rule-tester'; import rule, { MessageIds, Options } from '../../src/rules/deprecation'; import * as path from 'path'; diff --git a/tests/utils/get-rule-tester.ts b/tests/utils/get-rule-tester.ts new file mode 100644 index 0000000..2130ac7 --- /dev/null +++ b/tests/utils/get-rule-tester.ts @@ -0,0 +1,9 @@ +let RuleTester: any; +try { + ({ RuleTester } = require('@typescript-eslint/rule-tester')); +} catch { + const { TSESLint } = require('typescript-eslint-utils-5'); + RuleTester = TSESLint.RuleTester; +} + +export { RuleTester };