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

[CI] Add lint workflow #179

Merged
merged 7 commits into from
Nov 17, 2023
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Linting and formatting

on:
push:
branches:
- "*"
pull_request:
branches:
- "*"

jobs:
lint:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2
sudhanshutech marked this conversation as resolved.
Show resolved Hide resolved

- name: Set up Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
sudhanshutech marked this conversation as resolved.
Show resolved Hide resolved
with:
node-version: ${{ matrix.node-version }}

- name: Install dependencies
run: yarn install

- name: Run Lint
run: yarn lint && yarn format:check && yarn lint-staged
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,11 @@ format-fix:
yarn run format:write
```

> [!NOTE]
> Avoid using `type any` in your code. Always specify explicit types to ensure type safety and maintainability.

<br/>

## Join the Layer5 community!

<a name="contributing"></a><a name="community"></a>
Expand Down
16 changes: 11 additions & 5 deletions packages/components/src/custom/ErrorBoundary.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,11 @@ export const ErrorBoundary: FC<ErrorBoundaryProps> = ({ children, ...props }) =>
);
};
//
export const withErrorBoundary = (
Component: FC<any>,
export const withErrorBoundary = <P extends object>(
Component: React.ComponentType<P>,
errorHandlingProps: ErrorBoundaryProps | null
) => {
const WrappedWithErrorBoundary = (props: any) => (
const WrappedWithErrorBoundary: React.FC<P> = (props: P) => (
<ErrorBoundary {...(errorHandlingProps ? errorHandlingProps : {})}>
<Component {...props} />
</ErrorBoundary>
Expand All @@ -67,8 +67,14 @@ export const withErrorBoundary = (
return WrappedWithErrorBoundary;
};

export const withSuppressedErrorBoundary = (Component: React.ComponentType<any>) => {
const WrappedWithErrorBoundary = (props: any) => (
interface Props {
children: React.ReactNode;
}

export const withSuppressedErrorBoundary = <P extends object>(
Component: React.ComponentType<P>
) => {
const WrappedWithErrorBoundary: React.FC<P & Props> = (props: P & Props) => (
<ErrorBoundary FallbackComponent={() => null}>
<Component {...props} />
</ErrorBoundary>
Expand Down
4 changes: 1 addition & 3 deletions system/foundations/responsive.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,7 @@ Providing support at these smaller sizes enable people with low vision to use La

To understand how to break down a page to work on smaller viewports, check out [Responsive foundations](/foundations/layout) and [Responsive behavior](/foundations/layout) sections in the [Layout](/foundations/layout) page.


TODO: Capture SVG requirements and practices from Meshery.


- **Minimum viewport width**: 375px
- **Minimum viewport height**: 300px
- **Minimum viewport height**: 300px
Loading