⬆️ 更新依赖

This commit is contained in:
BTMuli
2026-01-18 22:19:52 +08:00
parent cc930912dc
commit 0159ee38f3
5 changed files with 149 additions and 118 deletions

View File

@@ -1,24 +1,26 @@
/**
* @file eslint/ymlEslint.js
* @description YAML相关的ESLint配置
* @since Beta v0.7.7
* YAML 文件的 ESLint 配置
* @since Beta v0.9.3
*/
import pluginYml from "eslint-plugin-yml";
import parserYml from "yaml-eslint-parser";
import * as ymlParser from "yaml-eslint-parser";
const eslintConfigYml = {
files: ["**/*.yml", "**/*.yaml"],
plugins: { yml: pluginYml },
languageOptions: {
parser: parserYml,
parserOptions: { defaultYAMLVersion: "1.2", extraFileExtensions: [".yaml", ".yml"] },
const eslintConfigYml = [
...pluginYml.configs.recommended,
{
files: ["**/*.yml", "**/*.yaml"],
plugins: { yml: pluginYml },
languageOptions: {
parser: ymlParser,
parserOptions: { defaultYAMLVersion: "1.2", extraFileExtensions: [".yaml", ".yml"] },
},
rules: {
"yml/indent": ["error", 2],
"yml/key-spacing": ["error"],
"yml/quotes": ["error", { prefer: "double", avoidEscape: true }],
"yml/sort-keys": ["error", "asc"],
},
},
rules: {
"yml/indent": ["error", 2],
"yml/key-spacing": ["error"],
"yml/quotes": ["error", { prefer: "double", avoidEscape: true }],
"yml/sort-keys": ["error", "asc"],
},
};
];
export default eslintConfigYml;