-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
/
flat-config-types.test.ts.snap
107 lines (101 loc) · 3.01 KB
/
flat-config-types.test.ts.snap
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`flat-config-types eslint should work successfully 1`] = `
[
{
"errorCount": 2,
"fatalErrorCount": 0,
"filePath": "<root>/eslint.config.js",
"fixableErrorCount": 0,
"fixableWarningCount": 0,
"messages": [
{
"column": 3,
"endColumn": 22,
"endLine": 48,
"line": 48,
"message": "Include a description after the "@ts-expect-error" directive to explain why the @ts-expect-error is necessary. The description must be 3 characters or longer.",
"messageId": "tsDirectiveCommentRequiresDescription",
"nodeType": "Line",
"ruleId": "@typescript-eslint/ban-ts-comment",
"severity": 2,
},
{
"column": 3,
"endColumn": 22,
"endLine": 53,
"line": 53,
"message": "Include a description after the "@ts-expect-error" directive to explain why the @ts-expect-error is necessary. The description must be 3 characters or longer.",
"messageId": "tsDirectiveCommentRequiresDescription",
"nodeType": "Line",
"ruleId": "@typescript-eslint/ban-ts-comment",
"severity": 2,
},
],
"output": "// @ts-check
import { FlatCompat } from '@eslint/eslintrc'
import eslint from '@eslint/js'
import stylisticPlugin from '@stylistic/eslint-plugin'
import deprecationPlugin from 'eslint-plugin-deprecation'
import jestPlugin from 'eslint-plugin-jest'
import tseslint from 'typescript-eslint'
import __dirname from './dirname.cjs'
const compat = new FlatCompat({
baseDirectory: __dirname,
recommendedConfig: {},
allConfig: {},
})
// this config is run through eslint as part of the integration test
// so it needs to be a correct config
export default tseslint.config(
{
plugins: {
['@typescript-eslint']: tseslint.plugin,
['deprecation']: deprecationPlugin,
['jest']: jestPlugin,
},
},
eslint.configs.recommended,
...tseslint.configs.recommended,
stylisticPlugin.configs['recommended-flat'],
)
// these are just tests for the types and are not seen by eslint so they can be whatever
tseslint.config({
plugins: {
['@stylistic']: stylisticPlugin,
['@typescript-eslint']: tseslint.plugin,
['deprecation']: deprecationPlugin,
['jest']: jestPlugin,
},
})
tseslint.config(
eslint.configs.recommended,
...tseslint.configs.recommended,
stylisticPlugin.configs['recommended-flat'],
)
tseslint.config(
// @ts-expect-error
compat.config(deprecationPlugin.configs.recommended),
...compat.config(jestPlugin.configs.recommended),
)
tseslint.config(
// @ts-expect-error
deprecationPlugin.configs.recommended,
// this should error but doesn't because there are no types exported from the jest plugin
jestPlugin.configs.recommended,
)
",
"suppressedMessages": [],
"usedDeprecatedRules": [
{
"replacedBy": [],
"ruleId": "no-extra-semi",
},
{
"replacedBy": [],
"ruleId": "no-mixed-spaces-and-tabs",
},
],
"warningCount": 0,
},
]
`;