Skip to content

Commit

Permalink
add semicolons
Browse files Browse the repository at this point in the history
  • Loading branch information
Richard87 committed Sep 5, 2024
1 parent 5779c47 commit 8a1d768
Show file tree
Hide file tree
Showing 281 changed files with 4,740 additions and 4,709 deletions.
2 changes: 1 addition & 1 deletion biome.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"bracketSpacing": true,
"quoteStyle": "single",
"quoteProperties": "asNeeded",
"semicolons": "asNeeded",
"semicolons": "always",
"trailingCommas": "es5"
}
},
Expand Down
16 changes: 8 additions & 8 deletions scripts/deps-license-check.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// A list of licenses permitted as dependencies
import licenseChecker from 'license-checker'
import licenseChecker from 'license-checker';

const permittedLicenses = [
'Apache',
Expand All @@ -13,7 +13,7 @@ const permittedLicenses = [
'Python-2.0',
'Unlicense',
'WTFPL',
]
];

// Provide a justification for excluding packages from checks!

Expand All @@ -23,23 +23,23 @@ const excludeChecksOnPackages = [
// name: 'example@1.2.3',
// reason: 'Some reason as to why this should not be checked',
// },
]
];

// -----------------------------------------------------------------------------

if (excludeChecksOnPackages.length) {
console.log('Not checking these dependencies for license compliance:')
console.log('Not checking these dependencies for license compliance:');
excludeChecksOnPackages.forEach((p) =>
console.log(`- ${p.name} (${p.reason})`)
)
console.log('')
);
console.log('');
}

const options = {
excludePackages: excludeChecksOnPackages.map((p) => p.name).join(';'),
onlyAllow: permittedLicenses.join(';'),
}
};

licenseChecker.init({ start: `${import.meta.dirname}/..`, ...options }, () =>
console.log('No license issues found')
)
);
26 changes: 13 additions & 13 deletions scripts/deps-stale-check.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Provide a reason for ignoring packages from checks!
import depcheck from 'depcheck'
import depcheck from 'depcheck';

const excludeChecksOnPackages = [
{
Expand All @@ -10,36 +10,36 @@ const excludeChecksOnPackages = [
name: 'ts-node',
reason: 'dependency of @rtk-query/codegen-openapi cli',
},
]
];

// -----------------------------------------------------------------------------

const options = { ignoreMatches: [] }
const options = { ignoreMatches: [] };

if (excludeChecksOnPackages.length) {
console.log('Not checking these dependencies for staleness:')
console.log('Not checking these dependencies for staleness:');

excludeChecksOnPackages.forEach((p) => {
console.log(`- ${p.name} (${p.reason})`)
options.ignoreMatches.push(p.name)
})
console.log(`- ${p.name} (${p.reason})`);
options.ignoreMatches.push(p.name);
});

console.log('')
console.log('');
}

// eslint-disable-next-line @typescript-eslint/no-var-requires
depcheck(`${import.meta.dirname}/..`, options, (unused) => {
if (unused.dependencies.length || unused.devDependencies.length) {
if (unused.dependencies.length) {
console.error('Found unused dependencies', unused.dependencies)
console.error('Found unused dependencies', unused.dependencies);
}

if (unused.devDependencies.length) {
console.error('Found unused devDependencies', unused.devDependencies)
console.error('Found unused devDependencies', unused.devDependencies);
}

process.exit(1)
process.exit(1);
} else {
console.log('No stale dependencies found')
console.log('No stale dependencies found');
}
})
});
2 changes: 1 addition & 1 deletion src/clusterBases.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ export const clusterBases = {
playgroundWebConsole: 'playground.radix.equinor.com',
radixPlatformWebConsole: 'radix.equinor.com',
radixPlatform2WebConsole: 'c2.radix.equinor.com',
} as const
} as const;
14 changes: 7 additions & 7 deletions src/components/alert/dev.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { Button, Icon, Typography } from '@equinor/eds-core-react'
import { error_outlined } from '@equinor/eds-icons'
import type { ComponentType } from 'react'
import { Button, Icon, Typography } from '@equinor/eds-core-react';
import { error_outlined } from '@equinor/eds-icons';
import type { ComponentType } from 'react';

import { Alert } from '.'
import { Alert } from '.';

import { externalUrls } from '../../externalUrls'
import { externalUrls } from '../../externalUrls';

const testData: Array<ComponentType> = [
() => <Alert>A simple alert</Alert>,
Expand Down Expand Up @@ -144,7 +144,7 @@ const testData: Array<ComponentType> = [
</div>
</Alert>
),
]
];

export default (
<div
Expand All @@ -164,4 +164,4 @@ export default (
))}
</div>
</div>
)
);
20 changes: 10 additions & 10 deletions src/components/alert/index.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import { clsx } from 'clsx'
import * as PropTypes from 'prop-types'
import type { FunctionComponent, PropsWithChildren, ReactNode } from 'react'
import { clsx } from 'clsx';
import * as PropTypes from 'prop-types';
import type { FunctionComponent, PropsWithChildren, ReactNode } from 'react';

import './style.css'
import './style.css';

export type AlertType = 'info' | 'success' | 'warning' | 'danger'
export type AlertType = 'info' | 'success' | 'warning' | 'danger';

export interface AlertProps {
actions?: ReactNode
className?: string
type?: AlertType
actions?: ReactNode;
className?: string;
type?: AlertType;
}

export const Alert: FunctionComponent<PropsWithChildren<AlertProps>> = ({
Expand All @@ -35,11 +35,11 @@ export const Alert: FunctionComponent<PropsWithChildren<AlertProps>> = ({
children
)}
</div>
)
);

Alert.propTypes = {
children: PropTypes.node,
actions: PropTypes.node,
className: PropTypes.string,
type: PropTypes.oneOf<AlertType>(['info', 'success', 'warning', 'danger']),
}
};
32 changes: 16 additions & 16 deletions src/components/alerting/alerting-actions.tsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
import { Button } from '@equinor/eds-core-react'
import * as PropTypes from 'prop-types'
import { Button } from '@equinor/eds-core-react';
import * as PropTypes from 'prop-types';

import './style.css'
import type { AlertingConfig } from '../../store/radix-api'
import './style.css';
import type { AlertingConfig } from '../../store/radix-api';

type Props = {
config: AlertingConfig
isSaving: boolean
isEdit: boolean
onEdit: () => void
onSave: () => void
onCancel: () => void
onEnable: () => void
onDisable: () => void
}
config: AlertingConfig;
isSaving: boolean;
isEdit: boolean;
onEdit: () => void;
onSave: () => void;
onCancel: () => void;
onEnable: () => void;
onDisable: () => void;
};

export const AlertingActions = ({
isEdit,
Expand Down Expand Up @@ -64,8 +64,8 @@ export const AlertingActions = ({
)}
</div>
</div>
)
}
);
};

AlertingActions.propTypes = {
isSaving: PropTypes.bool.isRequired,
Expand All @@ -77,4 +77,4 @@ AlertingActions.propTypes = {
onEdit: PropTypes.func.isRequired,
onEnable: PropTypes.func.isRequired,
onDisable: PropTypes.func.isRequired,
}
};
20 changes: 10 additions & 10 deletions src/components/alerting/alerting-overview.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { Icon, Typography } from '@equinor/eds-core-react'
import { check_circle_outlined, warning_outlined } from '@equinor/eds-icons'
import * as PropTypes from 'prop-types'
import { Fragment, type FunctionComponent } from 'react'
import type { AlertingConfig } from '../../store/radix-api'
import { Icon, Typography } from '@equinor/eds-core-react';
import { check_circle_outlined, warning_outlined } from '@equinor/eds-icons';
import * as PropTypes from 'prop-types';
import { Fragment, type FunctionComponent } from 'react';
import type { AlertingConfig } from '../../store/radix-api';

export const AlertingConfigStatus: FunctionComponent<{
config: AlertingConfig
config: AlertingConfig;
}> = ({ config }) => {
if (!config.enabled || !config.ready) {
return null
return null;
}

return (
Expand All @@ -32,9 +32,9 @@ export const AlertingConfigStatus: FunctionComponent<{
</Fragment>
))}
</>
)
}
);
};

AlertingConfigStatus.propTypes = {
config: PropTypes.object.isRequired as PropTypes.Validator<AlertingConfig>,
}
};
20 changes: 10 additions & 10 deletions src/components/alerting/buildEditConfig.ts
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
import { cloneDeep } from 'lodash'
import { cloneDeep } from 'lodash';
import type {
AlertingConfig,
ReceiverConfigMap,
UpdateAlertingConfig,
} from '../../store/radix-api'
} from '../../store/radix-api';

const buildReceiverSecrets = (receviers: ReceiverConfigMap) => {
const secretsConfig = {}
const secretsConfig = {};
if (!receviers) {
return secretsConfig
return secretsConfig;
}

for (const [receiverName, receiver] of Object.entries(receviers)) {
secretsConfig[receiverName] = {}
secretsConfig[receiverName] = {};
if (receiver.slackConfig) {
secretsConfig[receiverName].slackConfig = { webhookUrl: undefined }
secretsConfig[receiverName].slackConfig = { webhookUrl: undefined };
}
}

return secretsConfig
}
return secretsConfig;
};

export const buildEditConfig = (
config: AlertingConfig
Expand All @@ -28,5 +28,5 @@ export const buildEditConfig = (
alerts: cloneDeep(config.alerts),
receivers: cloneDeep(config.receivers),
receiverSecrets: buildReceiverSecrets(config.receivers),
}
}
};
};
12 changes: 6 additions & 6 deletions src/components/alerting/dev.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { type ComponentProps, Fragment } from 'react'
import { type ComponentProps, Fragment } from 'react';

import { Alerting } from '.'
import { Alerting } from '.';

const noopFunc = async () => {}
type AlertingProps = ComponentProps<typeof Alerting>
const noopFunc = async () => {};
type AlertingProps = ComponentProps<typeof Alerting>;
const testData: Array<AlertingProps> = [
{
isSaving: false,
Expand Down Expand Up @@ -65,7 +65,7 @@ const testData: Array<AlertingProps> = [
enableAlerting: noopFunc,
updateAlerting: noopFunc,
},
]
];

export default (
<div style={{ maxWidth: '1000px', margin: '20px' }}>
Expand All @@ -76,4 +76,4 @@ export default (
</Fragment>
))}
</div>
)
);
20 changes: 10 additions & 10 deletions src/components/alerting/edit-alerting.tsx
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
import { TextField } from '@equinor/eds-core-react'
import * as PropTypes from 'prop-types'
import { TextField } from '@equinor/eds-core-react';
import * as PropTypes from 'prop-types';
import type {
ChangeEvent,
Dispatch,
FunctionComponent,
SetStateAction,
} from 'react'
} from 'react';

import type { AlertingConfig } from '../../store/radix-api'
import type { AlertingConfig } from '../../store/radix-api';

export type ChangedReceivers = Record<string, string>
export type ChangedReceivers = Record<string, string>;

export const UpdateSlackReceivers: FunctionComponent<{
alertingConfig: AlertingConfig
changedReceivers: ChangedReceivers
setChangedReceivers: Dispatch<SetStateAction<ChangedReceivers>>
alertingConfig: AlertingConfig;
changedReceivers: ChangedReceivers;
setChangedReceivers: Dispatch<SetStateAction<ChangedReceivers>>;
}> = ({ alertingConfig, changedReceivers, setChangedReceivers }) => (
<>
{Object.entries(alertingConfig.receivers ?? {})
Expand All @@ -36,12 +36,12 @@ export const UpdateSlackReceivers: FunctionComponent<{
/>
))}
</>
)
);

UpdateSlackReceivers.propTypes = {
alertingConfig: PropTypes.object
.isRequired as PropTypes.Validator<AlertingConfig>,
changedReceivers: PropTypes.object
.isRequired as PropTypes.Validator<ChangedReceivers>,
setChangedReceivers: PropTypes.func.isRequired,
}
};
Loading

0 comments on commit 8a1d768

Please sign in to comment.