Skip to content

Commit

Permalink
fix: oxlint no-console rule
Browse files Browse the repository at this point in the history
  • Loading branch information
jlopezcur committed Jul 11, 2024
1 parent 8585936 commit d797c63
Show file tree
Hide file tree
Showing 10 changed files with 24 additions and 6 deletions.
1 change: 1 addition & 0 deletions dot.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ const input = readFileSync('/dev/stdin').toString();
writeFileSync('/dev/stdout', Buffer.from(output));
} catch (error) {
graph = new Viz({ Module, render });
// eslint-disable-next-line no-console
console.error(error);
}
})();
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export const Actions = ({ ...props }: Partial<DiffEditorProps>) => {
console.log('Copied to clipboard:', value);
})
.catch((err) => {
// eslint-disable-next-line no-console
console.error('Failed to copy to clipboard', err);
});
};
Expand All @@ -38,7 +39,10 @@ export const Actions = ({ ...props }: Partial<DiffEditorProps>) => {
const currentEditor = editorRef.current.getModifiedEditor();
currentEditor.setValue(currentEditor.getValue().concat(value));
})
.catch((err) => console.error('Failed to paste from clipboard', err));
.catch((err) => {
// eslint-disable-next-line no-console
console.error('Failed to paste from clipboard', err);
});
};

return (
Expand Down
2 changes: 2 additions & 0 deletions packages/code/src/components/Editor/Editor.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ export const WithActions: Story = {
console.log('Copied to clipboard:', value);
})
.catch((err) => {
// eslint-disable-next-line no-console
console.error('Failed to copy to clipboard', err);
});
};
Expand All @@ -218,6 +219,7 @@ export const WithActions: Story = {
editorRef.current.setValue(currentValue.concat(value));
})
.catch((err) => {
// eslint-disable-next-line no-console
console.error('Failed to paste from clipboard', err);
});
};
Expand Down
7 changes: 6 additions & 1 deletion packages/core/src/components/Banner/Banner.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,12 @@ export const Subtle: Story = {
status: 'success',
content: 'The comment was created successfully.',
actions: (
<Banner.SubtleAction onClick={() => console.info('Clicked!')}>
<Banner.SubtleAction
onClick={() => {
// eslint-disable-next-line no-console
console.info('Clicked!');
}}
>
Undo
</Banner.SubtleAction>
),
Expand Down
1 change: 1 addition & 0 deletions packages/core/src/components/Tabs/Tabs.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ export const Closable: Story = {
]);
useTabsAccessibility({ activeTab, tabsRef });
//useClosableTabs({ activeTab, tabsRef, tabsLength: tabs.length });
// eslint-disable-next-line no-console
console.log(activeTab);
return (
<Tabs aria-label="Demo tabs" contained>
Expand Down
2 changes: 0 additions & 2 deletions packages/core/src/components/Tabs/hooks/useClosableTabs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,9 @@ export const useClosableTabs = ({
}) => {
const itemsRef = React.useRef<NodeListOf<Element>>([]);
React.useEffect(() => {
console.log(itemsRef.current);
const removedItemIndex = Array.from(itemsRef.current).findIndex(
(item) => !document.body.contains(item),
);
console.log(removedItemIndex);
itemsRef.current = tabsRef.current.querySelectorAll('[aria-selected]');
if (activeTab > itemsRef.current.length - 1) {
getEnabledItemByIndex({ items: itemsRef.current, index: 'last' });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,11 @@ export const useTabsAccessibility = ({
'rightarrow',
() => {
const items = tabsRef.current.querySelectorAll('[aria-selected]');
console.log(items);
const nextEnabledTabItem = getEnabledItemByIncrement({
items,
currentItemIndex: activeTab,
inc: 1,
});
console.log(nextEnabledTabItem);
nextEnabledTabItem.focus();
nextEnabledTabItem.click();
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export const Base: Story = {
value={value}
onChange={(ts) => {
setValue(ts);
// eslint-disable-next-line no-console
console.log({ onChange: ts });
}}
/>
Expand All @@ -52,6 +53,7 @@ export const WithoutButtons: Story = {
autoApply={true}
onChange={(ts) => {
setValue(ts);
// eslint-disable-next-line no-console
console.log(`OnChange ${ts}`);
}}
/>
Expand Down Expand Up @@ -86,6 +88,7 @@ export const CustomParser: Story = {
}}
onChange={(ts) => {
setValue(ts);
// eslint-disable-next-line no-console
console.log(`OnChange ${ts}`);
}}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ export const Base: Story = {
value={value}
onChange={(newValue) => {
setValue(newValue);
// eslint-disable-next-line no-console
console.log('Has changed', newValue);
}}
/>
Expand All @@ -53,9 +54,11 @@ export const DefaultPresets: Story = {
value={date}
onApply={onApply(setDate)}
onChange={(range) => {
// eslint-disable-next-line no-console
console.log('something has changed', range);
}}
onRealTimeClick={(event) => {
// eslint-disable-next-line no-console
console.log('RT button clicked', event);
}}
presets={defaultPresets}
Expand Down
3 changes: 3 additions & 0 deletions packages/table/stories/BasicTable.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ export const Base: Story = {
<Menu.Item
label="Option 1"
onClick={() => {
// eslint-disable-next-line no-console
console.log(colDef);
}}
/>
Expand Down Expand Up @@ -163,12 +164,14 @@ export const Base: Story = {
{
Icon: GIEyeViewFilled,
onClick: (rowIndex) => {
// eslint-disable-next-line no-console
console.log(`Action 1 on row ${rowIndex}`);
},
},
{
Icon: GIPencilEdit,
onClick: (rowIndex) => {
// eslint-disable-next-line no-console
console.log(`Action 2 on row ${rowIndex}`);
},
},
Expand Down

0 comments on commit d797c63

Please sign in to comment.