Skip to content

Commit 7324889

Browse files
authored
Chore: Replace the remaining JSON fixtures with YAML. (#210)
1 parent dc60b36 commit 7324889

15 files changed

+78
-103
lines changed

tests/fixtures/rules/html-self-closing/invalid/component-never/component-never-errors.json

-12
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
- message: Disallow self-closing on Svelte custom components.
2+
line: 3
3+
column: 3
4+
suggestions: null
5+
- message: Disallow self-closing on Svelte custom components.
6+
line: 4
7+
column: 3
8+
suggestions: null

tests/fixtures/rules/html-self-closing/invalid/normal-ignore/normal-any-errors.json

-7
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
- message: Require self-closing on HTML void elements.
2+
line: 5
3+
column: 3
4+
suggestions: null

tests/fixtures/rules/html-self-closing/invalid/normal-never/component-never-errors.json

-7
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
- message: Disallow self-closing on HTML elements.
2+
line: 3
3+
column: 3
4+
suggestions: null

tests/fixtures/rules/html-self-closing/invalid/svelte-never/svelte-never-errors.json

-7
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
- message: Disallow self-closing on Svelte special elements.
2+
line: 2
3+
column: 1
4+
suggestions: null

tests/fixtures/rules/html-self-closing/invalid/test01-errors.json

-17
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
- message: Require self-closing on HTML elements.
2+
line: 3
3+
column: 3
4+
suggestions: null
5+
- message: Require self-closing on Svelte custom components.
6+
line: 4
7+
column: 3
8+
suggestions: null
9+
- message: Require self-closing on HTML void elements.
10+
line: 5
11+
column: 3
12+
suggestions: null

tests/fixtures/rules/html-self-closing/invalid/void-never/void-never-errors.json

-7
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
- message: Disallow self-closing on HTML void elements.
2+
line: 3
3+
column: 3
4+
suggestions: null

tests/fixtures/rules/no-reactive-functions/invalid/test01-errors.json

-38
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
- message: Do not create functions inside reactive statements unless absolutely
2+
necessary.
3+
line: 3
4+
column: 5
5+
suggestions:
6+
- desc: Move the function out of the reactive statement
7+
messageId: fixReactiveFns
8+
output: |
9+
<!-- prettier-ignore -->
10+
<script>
11+
const arrow = () => {}
12+
$: fn = function() {}
13+
$:nospace = () => {}
14+
</script>
15+
- message: Do not create functions inside reactive statements unless absolutely
16+
necessary.
17+
line: 4
18+
column: 5
19+
suggestions:
20+
- desc: Move the function out of the reactive statement
21+
messageId: fixReactiveFns
22+
output: |
23+
<!-- prettier-ignore -->
24+
<script>
25+
$: arrow = () => {}
26+
const fn = function() {}
27+
$:nospace = () => {}
28+
</script>
29+
- message: Do not create functions inside reactive statements unless absolutely
30+
necessary.
31+
line: 5
32+
column: 5
33+
suggestions:
34+
- desc: Move the function out of the reactive statement
35+
messageId: fixReactiveFns
36+
output: |
37+
<!-- prettier-ignore -->
38+
<script>
39+
$: arrow = () => {}
40+
$: fn = function() {}
41+
const nospace = () => {}
42+
</script>

tests/utils/utils.ts

-8
Original file line numberDiff line numberDiff line change
@@ -102,14 +102,6 @@ export function loadTestCases(
102102
let errors
103103
if (fs.existsSync(errorFile)) {
104104
errors = fs.readFileSync(errorFile, "utf8")
105-
} else if (
106-
fs.existsSync(inputFile.replace(/input\.[a-z]+$/u, "errors.json"))
107-
) {
108-
// Workaround to not block PRs.
109-
errors = fs.readFileSync(
110-
inputFile.replace(/input\.[a-z]+$/u, "errors.json"),
111-
"utf8",
112-
)
113105
} else {
114106
writeFixtures(ruleName, inputFile)
115107
errors = fs.readFileSync(errorFile, "utf8")

0 commit comments

Comments
 (0)