Skip to content

Commit

Permalink
test: update typescript-eslint and fix test cases (#2477)
Browse files Browse the repository at this point in the history
  • Loading branch information
ota-meshi committed Jun 19, 2024
1 parent 516253d commit e95b7bb
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 10 deletions.
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

0 comments on commit e95b7bb

Please sign in to comment.