Lint code.
This commit is contained in:
parent
44c17988e8
commit
4a3ac4f335
|
@ -15,13 +15,13 @@ export type KVEditProps = {
|
||||||
|
|
||||||
type KVEditState =
|
type KVEditState =
|
||||||
| {
|
| {
|
||||||
dataLoaded: false;
|
dataLoaded: false;
|
||||||
}
|
}
|
||||||
| {
|
| {
|
||||||
dataLoaded: true;
|
dataLoaded: true;
|
||||||
kvData: Record<string, unknown>;
|
kvData: Record<string, unknown>;
|
||||||
code: string;
|
code: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
export class KVEditor extends Component<KVEditProps, KVEditState> {
|
export class KVEditor extends Component<KVEditProps, KVEditState> {
|
||||||
constructor() {
|
constructor() {
|
||||||
|
@ -79,11 +79,7 @@ export class KVEditor extends Component<KVEditProps, KVEditState> {
|
||||||
}
|
}
|
||||||
|
|
||||||
getStringKVData(data: Record<string, unknown>): string {
|
getStringKVData(data: Record<string, unknown>): string {
|
||||||
return JSON.stringify(
|
return JSON.stringify(Object.fromEntries(sortedObjectMap(data)), null, 4);
|
||||||
Object.fromEntries(sortedObjectMap(data)),
|
|
||||||
null,
|
|
||||||
4,
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
render(): JSX.Element {
|
render(): JSX.Element {
|
||||||
|
@ -95,7 +91,7 @@ export class KVEditor extends Component<KVEditProps, KVEditState> {
|
||||||
<div>
|
<div>
|
||||||
<p class="uk-text-danger" id="errorText" />
|
<p class="uk-text-danger" id="errorText" />
|
||||||
<CodeJarEditor
|
<CodeJarEditor
|
||||||
highlight={() => { }}
|
highlight={() => {}}
|
||||||
code={this.getStringKVData(this.state.kvData)}
|
code={this.getStringKVData(this.state.kvData)}
|
||||||
onUpdate={(code) => this.onCodeUpdate(code)}
|
onUpdate={(code) => this.onCodeUpdate(code)}
|
||||||
options={{ tab: " ".repeat(4) }}
|
options={{ tab: " ".repeat(4) }}
|
||||||
|
|
Loading…
Reference in a new issue