1
- /* eslint eslint-comments/require-description: 0, @typescript-eslint/explicit-module-boundary-types: 0 */
2
1
import type { Linter } from "eslint" ;
3
2
import { generateParserOptions } from "../../../src/parser/test-utils" ;
4
3
import { rules } from "@typescript-eslint/eslint-plugin" ;
5
- export function setupLinter ( linter : Linter ) {
6
- linter . defineRule (
7
- "@typescript-eslint/no-unsafe-argument" ,
8
- rules [ "no-unsafe-argument" ] as never ,
9
- ) ;
10
- linter . defineRule (
11
- "@typescript-eslint/no-unsafe-assignment" ,
12
- rules [ "no-unsafe-assignment" ] as never ,
13
- ) ;
14
- linter . defineRule (
15
- "@typescript-eslint/no-unsafe-call" ,
16
- rules [ "no-unsafe-call" ] as never ,
17
- ) ;
18
- linter . defineRule (
19
- "@typescript-eslint/no-unsafe-member-access" ,
20
- rules [ "no-unsafe-member-access" ] as never ,
21
- ) ;
22
- linter . defineRule (
23
- "@typescript-eslint/no-unsafe-return" ,
24
- rules [ "no-unsafe-return" ] as never ,
25
- ) ;
26
- }
4
+ import * as parser from "../../../../src" ;
5
+ import globals from "globals" ;
27
6
28
- export function getConfig ( ) {
7
+ export function getConfig ( ) : Linter . Config {
29
8
return {
30
- parser : "svelte-eslint-parser" ,
31
- parserOptions : {
32
- ...generateParserOptions ( ) ,
33
- svelteFeatures : { runes : true } ,
9
+ plugins : {
10
+ "@typescript-eslint" : {
11
+ rules : rules as any ,
12
+ } ,
13
+ } ,
14
+ languageOptions : {
15
+ parser,
16
+ parserOptions : {
17
+ ...generateParserOptions ( ) ,
18
+ svelteFeatures : { runes : true } ,
19
+ } ,
20
+ globals : {
21
+ ...globals . browser ,
22
+ ...globals . es2021 ,
23
+ } ,
34
24
} ,
35
25
rules : {
36
26
"@typescript-eslint/no-unsafe-argument" : "error" ,
@@ -39,9 +29,5 @@ export function getConfig() {
39
29
"@typescript-eslint/no-unsafe-member-access" : "error" ,
40
30
"@typescript-eslint/no-unsafe-return" : "error" ,
41
31
} ,
42
- env : {
43
- browser : true ,
44
- es2021 : true ,
45
- } ,
46
32
} ;
47
33
}
0 commit comments