Skip to content

Commit 35b86c8

Browse files
feat: use eslint-plugin-yml's 'standard' config (#2210)
## PR Checklist - [x] Addresses an existing open issue: fixes #2209 - [x] That issue was marked as [`status: accepting prs`](https://github.com/JoshuaKGoldberg/create-typescript-app/issues?q=is%3Aopen+is%3Aissue+label%3A%22status%3A+accepting+prs%22) - [x] Steps in [CONTRIBUTING.md](https://github.com/JoshuaKGoldberg/create-typescript-app/blob/main/.github/CONTRIBUTING.md) were taken ## Overview Swaps over as described by the issue. 🎁
1 parent 930835b commit 35b86c8

File tree

3 files changed

+70
-2
lines changed

3 files changed

+70
-2
lines changed

Diff for: eslint.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ export default tseslint.config(
8888
rules: { "@typescript-eslint/no-unsafe-assignment": "off" },
8989
},
9090
{
91-
extends: [yml.configs["flat/recommended"], yml.configs["flat/prettier"]],
91+
extends: [yml.configs["flat/standard"], yml.configs["flat/prettier"]],
9292
files: ["**/*.{yml,yaml}"],
9393
rules: {
9494
"yml/file-extension": ["error", { extension: "yml" }],

Diff for: src/blocks/blockESLintYML.test.ts

+68
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
import { testBlock } from "bingo-stratum-testers";
2+
import { describe, expect, test } from "vitest";
3+
4+
import { blockESLintYML } from "./blockESLintYML.js";
5+
import { optionsBase } from "./options.fakes.js";
6+
7+
describe("blockESLintYML", () => {
8+
test("production", () => {
9+
const creation = testBlock(blockESLintYML, {
10+
options: optionsBase,
11+
});
12+
13+
expect(creation).toMatchInlineSnapshot(`
14+
{
15+
"addons": [
16+
{
17+
"addons": {
18+
"extensions": [
19+
{
20+
"extends": [
21+
"yml.configs["flat/standard"]",
22+
"yml.configs["flat/prettier"]",
23+
],
24+
"files": [
25+
"**/*.{yml,yaml}",
26+
],
27+
"rules": {
28+
"yml/file-extension": [
29+
"error",
30+
{
31+
"extension": "yml",
32+
},
33+
],
34+
"yml/sort-keys": [
35+
"error",
36+
{
37+
"order": {
38+
"type": "asc",
39+
},
40+
"pathPattern": "^.*$",
41+
},
42+
],
43+
"yml/sort-sequence-values": [
44+
"error",
45+
{
46+
"order": {
47+
"type": "asc",
48+
},
49+
"pathPattern": "^.*$",
50+
},
51+
],
52+
},
53+
},
54+
],
55+
"imports": [
56+
{
57+
"source": "eslint-plugin-yml",
58+
"specifier": "yml",
59+
},
60+
],
61+
},
62+
"block": [Function],
63+
},
64+
],
65+
}
66+
`);
67+
});
68+
});

Diff for: src/blocks/blockESLintYML.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export const blockESLintYML = base.createBlock({
1212
extensions: [
1313
{
1414
extends: [
15-
'yml.configs["flat/recommended"]',
15+
'yml.configs["flat/standard"]',
1616
'yml.configs["flat/prettier"]',
1717
],
1818
files: ["**/*.{yml,yaml}"],

0 commit comments

Comments
 (0)