Skip to content

Commit

Permalink
Solving lint problems
Browse files Browse the repository at this point in the history
Signed-off-by: Montse Ortega <[email protected]>
  • Loading branch information
ammont82 committed Nov 13, 2024
1 parent f227c96 commit 9ed7e18
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/pull-request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ jobs:
echo "skip=${skip}" >> $GITHUB_OUTPUT
echo "skip=${skip}"
lint-and-build:
# Execute lint and build when a PR is ready
needs: preflight-check
if: needs.preflight-check.outputs.skip == 'false'
runs-on: ubuntu-latest
Expand All @@ -60,7 +61,7 @@ jobs:
run: |
corepack enable
corepack prepare [email protected] --activate
- run: yarn install --immutable
- run: yarn all:lint
- run: yarn all:build
Expand Down
3 changes: 2 additions & 1 deletion apps/demo/src/common/version.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import buildManifest from 'demo/package.json';
* The function returns the build-time generated version.
* It can be overriden via the MIGRATION_PLANNER_UI_VERSION environment variable.
*/
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
export const getMigrationPlannerUiVersion = () => {
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access,@typescript-eslint/no-unsafe-return
return process.env.MIGRATION_PLANNER_UI_VERSION || buildManifest.version;
};
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import * as Yup from 'yup';
const SSH_PUBLIC_KEY_REGEX =
/^(ssh-rsa AAAAB3NzaC1yc2|ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNT|ecdsa-sha2-nistp384 AAAAE2VjZHNhLXNoYTItbmlzdHAzODQAAAAIbmlzdHAzOD|ecdsa-sha2-nistp521 AAAAE2VjZHNhLXNoYTItbmlzdHA1MjEAAAAIbmlzdHA1Mj|ssh-ed25519 AAAAC3NzaC1lZDI1NTE5|ssh-dss AAAAB3NzaC1kc3)[0-9A-Za-z+/]+[=]{0,3}( .*)?$/;

// eslint-disable-next-line react-refresh/only-export-components, @typescript-eslint/explicit-function-return-type
export const trimSshPublicKey = (key: string) =>
key
.split('\n')
Expand All @@ -28,6 +29,7 @@ export const trimSshPublicKey = (key: string) =>
.join('\n');

// Define your validation schema
// eslint-disable-next-line react-refresh/only-export-components
export const sshPublicKeyValidationSchema = Yup.string().test(
'ssh-public-key',
'SSH public key must consist of "[TYPE] key [[EMAIL]]", supported types are: ssh-rsa, ssh-ed25519, ecdsa-[VARIANT]. A single key can be provided only.',
Expand Down Expand Up @@ -56,6 +58,7 @@ export const DiscoverySourceSetupModal: React.FC<DiscoverySourceSetupModalProps>
const [sshKeyErrorMessage, setSshKeyErrorMessage] = useState("");

// Validate SSH key when it changes
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
const handleSshKeyChange = async (event: React.ChangeEvent<HTMLTextAreaElement>) => {
const value = event.target.value;
setSshKey(value);
Expand Down

0 comments on commit 9ed7e18

Please sign in to comment.