-
-
Notifications
You must be signed in to change notification settings - Fork 53
migration b4 #861
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
migration b4 #861
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,18 +1,19 @@ | ||
| import { useState } from 'react'; | ||
| import Switch from '../Switch'; | ||
| import { JSX, useState } from 'react'; | ||
| import Switch, { SwitchProps } from '../Switch'; | ||
| import SandboxEditor from '~/components/tools/SandboxEditor/SandboxEditor'; | ||
| import React from 'react'; | ||
|
Comment on lines
+1
to
+4
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Consolidate React imports. Multiple React imports can be consolidated. -import { JSX, useState } from 'react';
import Switch, { SwitchProps } from '../Switch';
import SandboxEditor from '~/components/tools/SandboxEditor/SandboxEditor';
-import React from 'react';
🧰 Tools🪛 ESLint[error] 1-1: '/home/jailuser/git/node_modules/react/index.js' imported multiple times. (import/no-duplicates) [error] 4-4: '/home/jailuser/git/node_modules/react/index.js' imported multiple times. (import/no-duplicates) |
||
|
|
||
| export default { | ||
| title: 'Components/Switch', | ||
| component: Switch, | ||
| render: (args) => <CheckBox {...args}/> | ||
| render: (args: JSX.IntrinsicAttributes & SwitchProps) => <CheckBox {...args}/> | ||
| }; | ||
|
|
||
| const CheckBox = (args) => { | ||
| const CheckBox = (args: SwitchProps) => { | ||
| const variants = ['classic', 'surface', 'solid']; | ||
| const [isChecked, setIsChecked] = useState(true); | ||
|
|
||
| const handleChange = (state) => { | ||
| const handleChange = (state: boolean | ((prevState: boolean) => boolean)) => { | ||
| setIsChecked(state); | ||
| }; | ||
| return <SandboxEditor className="flex flex-col gap-2"> | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,14 +1,15 @@ | ||
| import Table from '../Table'; | ||
| import Heading from '~/components/ui/Heading/Heading'; | ||
| import SandboxEditor from '~/components/tools/SandboxEditor/SandboxEditor'; | ||
| import React from 'react'; | ||
|
|
||
| export default { | ||
| title: 'WIP/Table', | ||
| component: Table | ||
| }; | ||
|
|
||
| // More on writing stories with args: https://storybook.js.org/docs/react/writing-stories/args | ||
| const Template = (args) => { | ||
| const Template = (args: any) => { | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Replace Using -const Template = (args: any) => {
+import { TableProps } from '../Table';
+const Template = (args: TableProps) => {
|
||
| const columns = [ | ||
| { name: 'Name', id: 'name' }, | ||
| { name: 'Age', id: 'age' } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Consolidate and clean up React imports.
There are multiple redundant imports and unused types.
📝 Committable suggestion
🧰 Tools
🪛 ESLint
[error] 1-1: '/home/jailuser/git/node_modules/react/index.js' imported multiple times.
(import/no-duplicates)
[error] 2-2: A space is required after '{'.
(object-curly-spacing)
[error] 2-2: A space is required before '}'.
(object-curly-spacing)
[error] 4-4: '/home/jailuser/git/node_modules/react/index.js' imported multiple times.
(import/no-duplicates)