Skip to content

Commit

Permalink
chore: appease the eslint warnings, bump warnings to errors (#17758)
Browse files Browse the repository at this point in the history
  • Loading branch information
daibhin authored Oct 4, 2023
1 parent fca26fd commit b3748a2
Show file tree
Hide file tree
Showing 12 changed files with 30 additions and 20 deletions.
24 changes: 12 additions & 12 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,6 @@ module.exports = {
element: 'Divider',
message: 'use <LemonDivider> instead',
},
{
element: 'Typography',
message: 'use utility classes instead',
},
{
element: 'Card',
message: 'use utility classes instead',
Expand All @@ -124,10 +120,6 @@ module.exports = {
element: 'Button',
message: 'use <LemonButton> instead',
},
{
element: 'Input.TextArea',
message: 'use <LemonTextArea> instead',
},
{
element: 'Input',
message: 'use <LemonInput> instead',
Expand All @@ -148,10 +140,6 @@ module.exports = {
element: 'a',
message: 'use <Link> instead',
},
{
element: 'ReactMarkdown',
message: 'use <LemonMarkdown> instead',
},
],
},
],
Expand Down Expand Up @@ -183,6 +171,18 @@ module.exports = {
element: 'MonacoEditor',
message: 'use <CodeEditor> instead',
},
{
element: 'Typography',
message: 'use utility classes instead',
},
{
element: 'Input.TextArea',
message: 'use <LemonTextArea> instead',
},
{
element: 'ReactMarkdown',
message: 'use <LemonMarkdown> instead',
},
],
},
],
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ export const Template: Story = () => {
textTile={makeTextTile('showing handles')}
/>
</div>
{/* eslint-disable-next-line react/forbid-dom-props */}
<div className={'w-full'} style={{ height: '200px' }}>
<h5>Large Card</h5>
<TextCard
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export default meta
export function CompactList_({ loading }: { loading: boolean }): JSX.Element {
return (
<div className="flex">
{/* eslint-disable-next-line react/forbid-dom-props */}
<div style={{ width: 350 }}>
<CompactList
loading={loading}
Expand All @@ -43,6 +44,7 @@ export function CompactList_({ loading }: { loading: boolean }): JSX.Element {
)}
/>
</div>
{/* eslint-disable-next-line react/forbid-dom-props */}
<div style={{ width: 350, marginLeft: 30 }}>
<CompactList
loading={loading}
Expand Down
1 change: 1 addition & 0 deletions frontend/src/lib/components/CopyToClipboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ export function CopyToClipboardInline({
const content = (
<span
className={isValueSensitive ? 'ph-no-capture' : ''}
// eslint-disable-next-line react/forbid-dom-props
style={{
position: 'relative',
overflow: 'hidden',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ export function EditableField({
className
)}
data-attr={dataAttr}
// eslint-disable-next-line react/forbid-dom-props
style={style}
>
<Tooltip
Expand Down
1 change: 1 addition & 0 deletions frontend/src/lib/components/Fade/Fade.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export function Fade({
return shouldRender ? (
<div
className={`fade-component-container${className ? ` ${className}` : ''}`}
// eslint-disable-next-line react/forbid-dom-props
style={{ animation: `${visible ? 'fadeComponentFadeIn' : 'fadeComponentFadeOut'} 0.3s`, ...style }}
onAnimationEnd={onAnimationEnd}
{...props}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export function EmptyDisplay(): JSX.Element {
return <HTMLElementsDisplay elements={[] as ElementType[]} />
}

export const elementsExample = [
export const EXAMPLE_ELEMENTS = [
{
text: 'Insights',
tag_name: 'span',
Expand Down Expand Up @@ -176,15 +176,15 @@ export const elementsExample = [
] as ElementType[]

export function ReadOnlyDisplay(): JSX.Element {
return <HTMLElementsDisplay elements={elementsExample} />
return <HTMLElementsDisplay elements={EXAMPLE_ELEMENTS} />
}

export function WithoutCentralHghlightDisplay(): JSX.Element {
return <HTMLElementsDisplay elements={elementsExample} highlight={false} />
return <HTMLElementsDisplay elements={EXAMPLE_ELEMENTS} highlight={false} />
}

export function EditableDisplay(): JSX.Element {
return <HTMLElementsDisplay elements={elementsExample} highlight={false} editable={true} />
return <HTMLElementsDisplay elements={EXAMPLE_ELEMENTS} highlight={false} editable={true} />
}

export function EditableDisplayWithPreselection(): JSX.Element {
Expand All @@ -195,7 +195,7 @@ export function EditableDisplayWithPreselection(): JSX.Element {
</h4>
<HTMLElementsDisplay
startingSelector={'div div.SideBar .LemonButton__content span.text-default'}
elements={elementsExample}
elements={EXAMPLE_ELEMENTS}
highlight={false}
editable={true}
/>
Expand All @@ -204,5 +204,5 @@ export function EditableDisplayWithPreselection(): JSX.Element {
}

export function WithUniquenessCheck(): JSX.Element {
return <HTMLElementsDisplay elements={elementsExample} highlight={false} editable={true} checkUniqueness={true} />
return <HTMLElementsDisplay elements={EXAMPLE_ELEMENTS} highlight={false} editable={true} checkUniqueness={true} />
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
preselect,
parsedSelectorToSelectorString,
} from 'lib/components/HTMLElementsDisplay/preselectWithCSS'
import { elementsExample } from 'lib/components/HTMLElementsDisplay/HTMLElementsDisplay.stories'
import { EXAMPLE_ELEMENTS } from 'lib/components/HTMLElementsDisplay/HTMLElementsDisplay.stories'
import { elementsChain } from 'lib/components/HTMLElementsDisplay/htmlElementsDisplayLogic'

const elements = [
Expand Down Expand Up @@ -382,7 +382,7 @@ describe('can preselect selectors for editing', () => {
test('fixing the storybook example', () => {
const selector = 'div div.SideBar .LemonButton__content span.text-default'

expect(preselect(elementsChain(elementsExample), selector)).toEqual({
expect(preselect(elementsChain(EXAMPLE_ELEMENTS), selector)).toEqual({
'0': {
tag: 'div',
},
Expand Down
2 changes: 2 additions & 0 deletions frontend/src/lib/components/InsightLabel/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ export function InsightLabel({
{!(hasMultipleSeries && !breakdownValue) && !hideIcon && (
<div
className="color-icon"
// eslint-disable-next-line react/forbid-dom-props
style={{
background: seriesColor,
boxShadow: `0px 0px 0px 1px ${hexToRGBA(seriesColor, 0.5)}`,
Expand Down Expand Up @@ -171,6 +172,7 @@ export function InsightLabel({
{pillValues.map((pill) => (
<Tooltip title={pill} key={pill}>
<Tag className="tag-pill" closable={false}>
{/* eslint-disable-next-line react/forbid-dom-props */}
<span className="truncate" style={{ maxWidth: pillMaxWidth }}>
{pillMidEllipsis ? midEllipsis(String(pill), 50) : pill}
</span>
Expand Down
1 change: 1 addition & 0 deletions frontend/src/lib/components/PageHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export function PageHeader({
}: PageHeaderProps): JSX.Element {
return (
<>
{/* eslint-disable-next-line react/forbid-dom-props */}
<div className="page-title-row flex justify-between" style={style}>
<div className="min-w-0">
{notebookProps ? (
Expand Down
1 change: 1 addition & 0 deletions frontend/src/lib/lemon-ui/LemonMarkdown/LemonMarkdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export interface LemonMarkdownProps {
export function LemonMarkdown({ children, lowKeyHeadings = false, className }: LemonMarkdownProps): JSX.Element {
return (
<div className={clsx('LemonMarkdown', className)}>
{/* eslint-disable-next-line react/forbid-elements */}
<ReactMarkdown
renderers={{
link: ({ href, children }) => (
Expand Down

0 comments on commit b3748a2

Please sign in to comment.