core: fix js-yaml options

This commit is contained in:
undefined committed 2026-07-25 11:25:38 +00:00
1 parent 2f99407669
commit 591dbd31c0
9 files changed
+25 -29

No files matched your search

@@ -98,7 +98,7 @@ export default connect(mapStateToProps, mapDispatchToProps)(class MonacoEditor e
async componentDidMount() {
const { monaco } = await load(['yaml']);
const uri = monaco.Uri.parse('hydro://problem/file/config.yaml');
this.model = monaco.editor.createModel(yaml.dump(configYamlFormat(this.props.config), { noArrayIndent: true }), 'yaml', uri);
this.model = monaco.editor.createModel(yaml.dump(configYamlFormat(this.props.config), { seqNoIndent: true }), 'yaml', uri);
this.vjEditor = Editor.getOrConstruct($(this.containerElement), {
language: 'yaml',
model: this.model,
@@ -114,7 +114,7 @@ export default connect(mapStateToProps, mapDispatchToProps)(class MonacoEditor e
componentDidUpdate(prevProps) {
if (this.__preventUpdate || !this.model || !this.props.config.__valid) return;
if (yaml.dump(prevProps.config, { noArrayIndent: true }) === yaml.dump(this.props.config, { noArrayIndent: true })) return;
if (yaml.dump(prevProps.config, { seqNoIndent: true }) === yaml.dump(this.props.config, { seqNoIndent: true })) return;
const curValue = this.model.getValue();
const pending = configYamlFormat(this.props.config);
try {
@@ -122,7 +122,7 @@ export default connect(mapStateToProps, mapDispatchToProps)(class MonacoEditor e
if (isEqual(curConfig, pending)) return;
} catch { }
this.__preventFormat = true;
const diff = diffLines(curValue, yaml.dump(pending, { noArrayIndent: true }));
const diff = diffLines(curValue, yaml.dump(pending, { seqNoIndent: true }));
const ops = [];
let cursor = 1;
for (const line of diff) {
+6 -6
View File
@@ -23,7 +23,7 @@
"@mantine/core": "^9.4.2",
"@mantine/hooks": "^9.4.2",
"@mantine/notifications": "^9.4.2",
"@sentry/browser": "^10.67.0",
"@sentry/browser": "^10.68.0",
"@sentry/webpack-plugin": "^5.4.0",
"@simplewebauthn/browser": "13.2.2",
"@svgr/webpack": "^8.1.0",
@@ -60,7 +60,7 @@
"echarts": "^6.1.0",
"emojis-keywords": "2.0.0",
"emojis-list": "2.1.0",
"esbuild-loader": "^4.4.3",
"esbuild-loader": "^4.5.0",
"flatpickr": "^4.6.13",
"idb": "^8.0.3",
"jquery": "^3.7.1",
@@ -99,7 +99,7 @@
"redux-promise-middleware": "^6.2.0",
"redux-thunk": "^3.1.0",
"rupture": "^0.7.1",
"sass": "^1.101.4",
"sass": "^1.101.7",
"sass-loader": "^16.0.8",
"schemastery": "^3.18.0",
"shorty.js": "^1.0.1",
@@ -114,7 +114,7 @@
"timeago.js": "^4.0.2",
"ts-loader": "^9.6.2",
"web-streams-polyfill": "^4.3.0",
"webpack": "^5.108.4",
"webpack": "^5.109.0",
"webpack-bundle-analyzer": "^5.3.1",
"webpack-dev-server": "^6.0.0",
"webpack-manifest-plugin": "^6.0.1",
@@ -125,9 +125,9 @@
"ansi_up": "^6.0.6",
"cssfilter": "^0.0.11",
"esbuild": "0.25.2",
"fs-extra": "^11.3.6",
"fs-extra": "^11.4.0",
"html-to-text": "^10.0.0",
"js-yaml": "^5.2.1",
"js-yaml": "^5.2.2",
"jsesc": "^3.1.0",
"katex": "^0.18.1",
"lodash": "^4.18.1",