diff --git a/.eslintrc.js b/.eslintrc.js index fd211bf936672..3d136069d31cb 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -112,10 +112,6 @@ module.exports = { element: 'Divider', message: 'use instead', }, - { - element: 'Typography', - message: 'use utility classes instead', - }, { element: 'Card', message: 'use utility classes instead', @@ -124,10 +120,6 @@ module.exports = { element: 'Button', message: 'use instead', }, - { - element: 'Input.TextArea', - message: 'use instead', - }, { element: 'Input', message: 'use instead', @@ -148,10 +140,6 @@ module.exports = { element: 'a', message: 'use instead', }, - { - element: 'ReactMarkdown', - message: 'use instead', - }, ], }, ], @@ -183,6 +171,18 @@ module.exports = { element: 'MonacoEditor', message: 'use instead', }, + { + element: 'Typography', + message: 'use utility classes instead', + }, + { + element: 'Input.TextArea', + message: 'use instead', + }, + { + element: 'ReactMarkdown', + message: 'use instead', + }, ], }, ], diff --git a/frontend/__snapshots__/components-html-elements-display--example-elements.png b/frontend/__snapshots__/components-html-elements-display--example-elements.png new file mode 100644 index 0000000000000..1d9e85138f5bc Binary files /dev/null and b/frontend/__snapshots__/components-html-elements-display--example-elements.png differ diff --git a/frontend/src/lib/components/Cards/TextCard/TextCard.stories.tsx b/frontend/src/lib/components/Cards/TextCard/TextCard.stories.tsx index 75c1afc9de71f..e6790f8446a6b 100644 --- a/frontend/src/lib/components/Cards/TextCard/TextCard.stories.tsx +++ b/frontend/src/lib/components/Cards/TextCard/TextCard.stories.tsx @@ -70,6 +70,7 @@ export const Template: Story = () => { textTile={makeTextTile('showing handles')} /> + {/* eslint-disable-next-line react/forbid-dom-props */}
Large Card
+ {/* eslint-disable-next-line react/forbid-dom-props */}
+ {/* eslint-disable-next-line react/forbid-dom-props */}
} -export const elementsExample = [ +export const EXAMPLE_ELEMENTS = [ { text: 'Insights', tag_name: 'span', @@ -176,15 +176,15 @@ export const elementsExample = [ ] as ElementType[] export function ReadOnlyDisplay(): JSX.Element { - return + return } export function WithoutCentralHghlightDisplay(): JSX.Element { - return + return } export function EditableDisplay(): JSX.Element { - return + return } export function EditableDisplayWithPreselection(): JSX.Element { @@ -195,7 +195,7 @@ export function EditableDisplayWithPreselection(): JSX.Element { @@ -204,5 +204,5 @@ export function EditableDisplayWithPreselection(): JSX.Element { } export function WithUniquenessCheck(): JSX.Element { - return + return } diff --git a/frontend/src/lib/components/HTMLElementsDisplay/preselectWithCSS.test.ts b/frontend/src/lib/components/HTMLElementsDisplay/preselectWithCSS.test.ts index 43afcd8b49d7c..5d65b1587a0d1 100644 --- a/frontend/src/lib/components/HTMLElementsDisplay/preselectWithCSS.test.ts +++ b/frontend/src/lib/components/HTMLElementsDisplay/preselectWithCSS.test.ts @@ -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 = [ @@ -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', }, diff --git a/frontend/src/lib/components/InsightLabel/index.tsx b/frontend/src/lib/components/InsightLabel/index.tsx index ad705b1926573..2392f77a423c6 100644 --- a/frontend/src/lib/components/InsightLabel/index.tsx +++ b/frontend/src/lib/components/InsightLabel/index.tsx @@ -121,6 +121,7 @@ export function InsightLabel({ {!(hasMultipleSeries && !breakdownValue) && !hideIcon && (
( + {/* eslint-disable-next-line react/forbid-dom-props */} {pillMidEllipsis ? midEllipsis(String(pill), 50) : pill} diff --git a/frontend/src/lib/components/PageHeader.tsx b/frontend/src/lib/components/PageHeader.tsx index 01f281b18e0d3..ac309adc8d1e5 100644 --- a/frontend/src/lib/components/PageHeader.tsx +++ b/frontend/src/lib/components/PageHeader.tsx @@ -25,6 +25,7 @@ export function PageHeader({ }: PageHeaderProps): JSX.Element { return ( <> + {/* eslint-disable-next-line react/forbid-dom-props */}
{notebookProps ? ( diff --git a/frontend/src/lib/lemon-ui/LemonMarkdown/LemonMarkdown.tsx b/frontend/src/lib/lemon-ui/LemonMarkdown/LemonMarkdown.tsx index df3215e2831b4..90d8258c1cf30 100644 --- a/frontend/src/lib/lemon-ui/LemonMarkdown/LemonMarkdown.tsx +++ b/frontend/src/lib/lemon-ui/LemonMarkdown/LemonMarkdown.tsx @@ -15,6 +15,7 @@ export interface LemonMarkdownProps { export function LemonMarkdown({ children, lowKeyHeadings = false, className }: LemonMarkdownProps): JSX.Element { return (
+ {/* eslint-disable-next-line react/forbid-elements */} (