style: add eslint configuration and fixed linter issues (#35)
* style: add eslint configuration as per bee-js * chore: add `plugin:react/reocommended` in `.eslintrc` Co-authored-by: nugaon <50576770+nugaon@users.noreply.github.com> * chore: add `consistent` to `array-bracket-newline` as per review * style: after automatic fixes with `npm run lint` * style: fixed all linter errors * refactor: fixed all linter warnings * chore: added missing new line at end of `.prettierrc` file Co-authored-by: nugaon <50576770+nugaon@users.noreply.github.com>
This commit is contained in:
@@ -1,22 +1,20 @@
|
||||
import SyntaxHighlighter from 'react-syntax-highlighter';
|
||||
import type { ReactElement } from 'react'
|
||||
import SyntaxHighlighter from 'react-syntax-highlighter'
|
||||
|
||||
interface IProps {
|
||||
code: string,
|
||||
language: string,
|
||||
showLineNumbers?: boolean,
|
||||
interface Props {
|
||||
code: string
|
||||
language: string
|
||||
showLineNumbers?: boolean
|
||||
}
|
||||
|
||||
const CodeBlock = (props: IProps) => {
|
||||
const CodeBlock = (props: Props): ReactElement => {
|
||||
return (
|
||||
<div style={{textAlign:'left'}}>
|
||||
<SyntaxHighlighter
|
||||
language={props.language}
|
||||
showLineNumbers={props.showLineNumbers}
|
||||
>
|
||||
<div style={{ textAlign: 'left' }}>
|
||||
<SyntaxHighlighter language={props.language} showLineNumbers={props.showLineNumbers}>
|
||||
{props.code}
|
||||
</SyntaxHighlighter>
|
||||
</SyntaxHighlighter>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
)
|
||||
}
|
||||
|
||||
export default CodeBlock;
|
||||
export default CodeBlock
|
||||
|
||||
Reference in New Issue
Block a user