Skip to content
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

Jsx to tsx #2517

Closed
wants to merge 3 commits into from
Closed

Jsx to tsx #2517

wants to merge 3 commits into from

Conversation

omsaggau
Copy link
Contributor

No description provided.

Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
7.3% Duplication on New Code (required ≤ 3%)
C Reliability Rating on New Code (required ≥ A)

See analysis details on SonarCloud

idea Catch issues before they fail your Quality Gate with our IDE extension SonarLint SonarLint

@annesiri
Copy link
Contributor

Når jeg søker på .jsx i repo får jeg fortsatt en del treff i diverse config (bl.a. eslintrc.json, .gitattributes og client-assets). Usikker på hvor det skal være tsx og hvor det skal være jsx men det bør i alle fall dobbeltsjekkes

internalBaseUrl: PropTypes.string,
internalStatbankUrl: PropTypes.string,
toggleDebugging: PropTypes.boolean,
interface DashboardRouterProps {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Kan vi bruke samme proptype som på linje 23 her? Ser ut som det kun er èn parameter forskjell...

interface AccordionProps {
accordions?: {
id?: string;
open: string;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Er dette egentlig en boolean?

contentTypes?: unknown[];
mainSubjects?: unknown[];
mainSubjectsEnglish?: unknown[];
renderSearchWord?(...args: unknown[]): unknown;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Litt usikker på om denne blir riktig? Er det ikke en mer opplagt måte å definere det som en funksjon? (gjelder linje 16-17)

import { Modal } from 'react-bootstrap'

function BestBetModal(props) {
interface BestBetModalProps {
show?: unknown;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Linje 5 og 6 skal være booleans

onSubmit?(...args: unknown[]): unknown;
owner?: string;
sources?: {
tableId?: unknown;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

number eller string

code?: string;
urlOrId?: string;
selectDisplay?: string;
statbankApiData?: Record<string, unknown>;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Er Record riktig her?

function StatbankFrame(props) {
interface StatbankFrameProps {
title?: string;
breadcrumb?: unknown[];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

object[]

function StatbankSubjectTree(props) {
interface StatbankSubjectTreeProps {
statbankBaseUrl?: string;
mainSubjects?: unknown[];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typen på arrayet var definert før, så her kan vi definere typen

inFactPage?: boolean;
language?: string;
tableData?: {
table?: unknown;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Denne var definert før så vi vet hvordan denne typen er

modifiedTime?: string;
type?: string;
mainSubject?: string;
variants?: unknown;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Denne kan defineres basert på typen fra tidligere

@annesiri
Copy link
Contributor

For ganske mange av de nye prop-typene er de allerede definert i ts-filene (og der har vi oftere hele strukturen "riktig"). Vi skulle ikke gått gjennom og hentet de derfra i stedet for å definere de på nytt?

@omsaggau omsaggau closed this Mar 25, 2024
@omsaggau omsaggau deleted the jsx-to-tsx branch March 25, 2024 09:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants