mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
workspace: update eslint rule (#1027)
This commit is contained in:
1 parent
05c3b8f2bd
commit
cee3c00ddb
150 files changed
+1069
-1043
No files matched your search
@@ -91,7 +91,7 @@ function MonacoContainer({
|
||||
if (!editor) return;
|
||||
const current = editor.getValue({ lineEnding: '\n', preserveBOM: false });
|
||||
const diff = diffLines(current, config);
|
||||
const ops: { range: any; text: string }[] = [];
|
||||
const ops: { range: any, text: string }[] = [];
|
||||
let cursor = 1;
|
||||
for (const line of diff) {
|
||||
if (line.added) {
|
||||
@@ -109,11 +109,7 @@ function MonacoContainer({
|
||||
}
|
||||
model.pushEditOperations([], ops, undefined);
|
||||
}, [editor, config]);
|
||||
return (
|
||||
<div ref={initializeEditor} style={{
|
||||
width: '100%', height: '500px',
|
||||
}} />
|
||||
);
|
||||
return <div ref={initializeEditor} style={{ width: '100%', height: '500px' }} />;
|
||||
}
|
||||
|
||||
export default function ConfigEditor({
|
||||
@@ -166,8 +162,12 @@ export default function ConfigEditor({
|
||||
<Allotment onChange={setSize}>
|
||||
<Allotment.Pane>
|
||||
<MonacoContainer
|
||||
editorCallback={registerAction} schema={schema} monaco={monaco}
|
||||
config={stringConfig} setValue={updateFromMonaco} setError={setInfo}
|
||||
editorCallback={registerAction}
|
||||
schema={schema}
|
||||
monaco={monaco}
|
||||
config={stringConfig}
|
||||
setValue={updateFromMonaco}
|
||||
setError={setInfo}
|
||||
size={size[0]}
|
||||
dark={document.documentElement.className.includes('theme--dark')}
|
||||
/>
|
||||
|
||||
@@ -79,7 +79,7 @@ function DraggableSelection({
|
||||
const AutoComplete = forwardRef(function Impl<T>(props: AutoCompleteProps<T>, ref: React.Ref<AutoCompleteHandle<T>>) {
|
||||
const {
|
||||
multi = false, width = '100%', height = 'auto',
|
||||
freeSolo = false, allowEmptyQuery = false, listStyle = {}, // eslint-disable-line @eslint-react/no-unstable-default-props
|
||||
freeSolo = false, allowEmptyQuery = false, listStyle = {},
|
||||
disabled = false, disabledHint = '', draggable = multi,
|
||||
} = props;
|
||||
const queryItems = props.queryItems ?? (() => []);
|
||||
@@ -87,7 +87,7 @@ const AutoComplete = forwardRef(function Impl<T>(props: AutoCompleteProps<T>, re
|
||||
const itemText = props.itemText ?? ((item) => item.toString());
|
||||
const itemKey = props.itemKey ?? itemText;
|
||||
const onChange = props.onChange ?? (() => { });
|
||||
const freeSoloConverter = freeSolo ? props.freeSoloConverter ?? ((i) => i) : ((i) => i);
|
||||
const freeSoloConverter = freeSolo ? props.freeSoloConverter ?? ((i) => i) : (i) => i;
|
||||
|
||||
const [focused, setFocused] = useState(false); // is focused
|
||||
const [selectedKeys, setSelectedKeys] = useState(props.selectedKeys || []); // keys of selected items
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
export { default as ComponentsProvider } from './provider';
|
||||
export { default as AutoComplete, type AutoCompleteHandle, type AutoCompleteProps } from './autocomplete/AutoComplete';
|
||||
export { default as CustomSelectAutoComplete } from './autocomplete/CustomSelectAutoComplete';
|
||||
export { default as ConfigEditor } from './ConfigEditor';
|
||||
export { default as Icon } from './Icon';
|
||||
export { default as Notification } from './Notification';
|
||||
export { default as AutoComplete, type AutoCompleteHandle, type AutoCompleteProps } from './autocomplete/AutoComplete';
|
||||
export { default as CustomSelectAutoComplete } from './autocomplete/CustomSelectAutoComplete';
|
||||
export { default as ComponentsProvider } from './provider';
|
||||
@@ -21,7 +21,7 @@
|
||||
"@types/diff": "^8.0.0",
|
||||
"@types/js-yaml": "^4.0.9",
|
||||
"@types/lodash": "^4.17.20",
|
||||
"sass": "^1.89.2"
|
||||
"sass": "^1.90.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"react": "*",
|
||||
|
||||
Reference in new issue
Block a user