Skip to content

Commit

Permalink
Refine flat config types (#320)
Browse files Browse the repository at this point in the history
* refine flat config types

* Create slow-emus-listen.md
  • Loading branch information
Logicer16 committed Apr 2, 2024
1 parent db5c627 commit 60123cf
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 6 deletions.
5 changes: 5 additions & 0 deletions .changeset/slow-emus-listen.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"eslint-plugin-yml": minor
---

feat: improved compatibility with `@types/eslint` for flat config.
4 changes: 2 additions & 2 deletions src/configs/flat/base.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { ESLint } from "eslint";
import type { ESLint, Linter } from "eslint";
import * as parser from "yaml-eslint-parser";
export default [
{
Expand All @@ -21,4 +21,4 @@ export default [
"spaced-comment": "off",
},
},
];
] satisfies Linter.FlatConfig[];
3 changes: 2 additions & 1 deletion src/configs/flat/prettier.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// IMPORTANT!
// This file has been automatically generated,
// in order to update its content execute "npm run update"
import type { Linter } from "eslint";
import base from "./base";
export default [
...base,
Expand All @@ -21,4 +22,4 @@ export default [
"yml/quotes": "off",
},
},
];
] satisfies Linter.FlatConfig[];
3 changes: 2 additions & 1 deletion src/configs/flat/recommended.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// IMPORTANT!
// This file has been automatically generated,
// in order to update its content execute "npm run update"
import type { Linter } from "eslint";
import base from "./base";
export default [
...base,
Expand All @@ -16,4 +17,4 @@ export default [
"yml/vue-custom-block/no-parsing-error": "error",
},
},
];
] satisfies Linter.FlatConfig[];
3 changes: 2 additions & 1 deletion src/configs/flat/standard.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// IMPORTANT!
// This file has been automatically generated,
// in order to update its content execute "npm run update"
import type { Linter } from "eslint";
import base from "./base";
export default [
...base,
Expand Down Expand Up @@ -29,4 +30,4 @@ export default [
"yml/vue-custom-block/no-parsing-error": "error",
},
},
];
] satisfies Linter.FlatConfig[];
3 changes: 2 additions & 1 deletion tools/update-rulesets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ for (const rec of ["recommended", "standard", "prettier"] as const) {
* This file has been automatically generated,
* in order to update its content execute "npm run update"
*/
import type { Linter } from "eslint";
import base from './base';
export default [
...base,
Expand All @@ -104,7 +105,7 @@ export default [
.join(",\n")}
},
}
]
] satisfies Linter.FlatConfig[]
`;

const filePath = path.resolve(
Expand Down

0 comments on commit 60123cf

Please sign in to comment.