mirror of
https://github.com/BTMuli/TeyvatGuide.git
synced 2026-03-15 03:53:16 +08:00
⬆️ 更新依赖
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user