Skip to content

test: update typescript-eslint and fix test cases #2477

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@
"@types/node": "^14.18.63",
"@types/semver": "^7.5.7",
"@types/xml-name-validator": "^4.0.3",
"@typescript-eslint/parser": "^7.0.1",
"@typescript-eslint/types": "^7.0.1",
"@typescript-eslint/parser": "^7.13.1",
"@typescript-eslint/types": "^7.13.1",
"assert": "^2.1.0",
"env-cmd": "^10.1.0",
"esbuild": "^0.20.0",
Expand Down
4 changes: 3 additions & 1 deletion tests/fixtures/script-indent/ts-declare-function-03.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!--{"languageOptions": {"parserOptions": {"parser":"@typescript-eslint/parser"}}}-->
<script lang="ts">
declare async function
declare function
foo
(
arg1: string,
Expand All @@ -9,4 +9,6 @@ declare async function
:
arg1 is
string;
async function
bar() {}
</script>
1 change: 0 additions & 1 deletion tests/fixtures/script-indent/ts-declare-function-04.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<!--{"languageOptions": {"parserOptions": {"parser":"@typescript-eslint/parser"}}}-->
<script lang="ts">
declare function
*
foo
(
arg1: string,
Expand Down
2 changes: 1 addition & 1 deletion tests/lib/rules/comment-directive.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const { ESLint } = require('../../eslint-compat')
const eslint = new ESLint({
overrideConfigFile: true,
overrideConfig: {
files: ['*'],
files: ['*.*'],
languageOptions: {
parser: require('vue-eslint-parser'),
ecmaVersion: 2015
Expand Down
13 changes: 8 additions & 5 deletions tests/lib/rules/no-sparse-arrays.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
*/
'use strict'

const RuleTester = require('../../eslint-compat').RuleTester
const { RuleTester, ESLint } = require('../../eslint-compat')
const semver = require('semver')
const rule = require('../../../lib/rules/no-sparse-arrays')

const tester = new RuleTester({
Expand All @@ -29,9 +30,10 @@ tester.run('no-sparse-arrays', rule, {
{
message: 'Unexpected comma in middle of array.',
line: 3,
column: 22,
endLine: 3,
endColumn: 38
...(semver.gte(ESLint.version, '9.5.0')
? { column: 23, endColumn: 24 }
: { column: 22, endColumn: 38 })
}
]
},
Expand All @@ -44,9 +46,10 @@ tester.run('no-sparse-arrays', rule, {
{
message: 'Unexpected comma in middle of array.',
line: 3,
column: 22,
endLine: 3,
endColumn: 30
...(semver.gte(ESLint.version, '9.5.0')
? { column: 23, endColumn: 24 }
: { column: 22, endColumn: 30 })
}
]
}
Expand Down
Loading