Skip to content

Commit

Permalink
unicorn lint -> scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
arietrouw committed Feb 17, 2024
1 parent bd516b5 commit 9a02b43
Show file tree
Hide file tree
Showing 57 changed files with 1,330 additions and 1,195 deletions.
15 changes: 1 addition & 14 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const finalConfig = {
"extends": ["@xylabs/react", 'plugin:unicorn/recommended'],
"extends": ["@xylabs/react"],
parser: '@typescript-eslint/parser',
parserOptions: { ecmaVersion: 'latest', project: null, tsconfigRootDir: __dirname, extraFileExtensions: ['json'] },
"root": true,
Expand All @@ -17,19 +17,6 @@ const finalConfig = {
".*"
],
"rules": {
"unicorn/no-useless-undefined": ["off"],
"unicorn/filename-case": ["off"],
"unicorn/no-nested-ternary": ["off"],
"unicorn/no-array-callback-reference": ["off"],
"unicorn/prevent-abbreviations": ["off"],
"unicorn/no-null": ["off"],
"unicorn/number-literal-case": ["off"],
"unicorn/no-await-expression-member": ["off"],
"unicorn/new-for-builtins": ["off"],
"unicorn/catch-error-name": ["off"],
"unicorn/prefer-top-level-await": ["off"],
"unicorn/consistent-function-scoping": ["off"],
"unicorn/prefer-module": ["off"],
"@typescript-eslint/explicit-member-accessibility": ["warn", { "accessibility": "no-public" }],
"no-restricted-imports": [
"warn",
Expand Down
48 changes: 24 additions & 24 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,35 +39,35 @@
},
"description": "Common React library for all XY Labs projects that use React",
"devDependencies": {
"@babel/core": "^7.23.7",
"@babel/preset-env": "^7.23.8",
"@babel/core": "^7.23.9",
"@babel/preset-env": "^7.23.9",
"@babel/preset-react": "^7.23.3",
"@babel/preset-typescript": "^7.23.3",
"@emotion/react": "^11.11.3",
"@emotion/styled": "^11.11.0",
"@mui/material": "^5.15.5",
"@storybook/addon-actions": "^7.6.10",
"@storybook/addon-docs": "^7.6.10",
"@storybook/addon-essentials": "^7.6.10",
"@storybook/addon-interactions": "^7.6.10",
"@storybook/addon-links": "^7.6.10",
"@storybook/addon-mdx-gfm": "^7.6.10",
"@storybook/addons": "^7.6.10",
"@storybook/api": "^7.6.10",
"@storybook/components": "^7.6.10",
"@storybook/core-events": "^7.6.10",
"@mui/material": "^5.15.10",
"@storybook/addon-actions": "^7.6.16",
"@storybook/addon-docs": "^7.6.16",
"@storybook/addon-essentials": "^7.6.16",
"@storybook/addon-interactions": "^7.6.16",
"@storybook/addon-links": "^7.6.16",
"@storybook/addon-mdx-gfm": "^7.6.16",
"@storybook/addons": "^7.6.16",
"@storybook/api": "^7.6.16",
"@storybook/components": "^7.6.16",
"@storybook/core-events": "^7.6.16",
"@storybook/mdx1-csf": "^1.0.0",
"@storybook/react": "^7.6.10",
"@storybook/react-webpack5": "^7.6.10",
"@storybook/react": "^7.6.16",
"@storybook/react-webpack5": "^7.6.16",
"@storybook/testing-library": "^0.2.2",
"@storybook/theming": "^7.6.10",
"@typescript-eslint/eslint-plugin": "^6.19.0",
"@typescript-eslint/parser": "^6.19.0",
"@xylabs/eslint-config-react": "^3.2.41",
"@storybook/theming": "^7.6.16",
"@typescript-eslint/eslint-plugin": "^6.21.0",
"@typescript-eslint/parser": "^6.21.0",
"@xylabs/eslint-config-react": "^3.3.2",
"@xylabs/pixel": "^1.4.14",
"@xylabs/ts-scripts-yarn3": "^3.2.41",
"@xylabs/tsconfig-react": "^3.2.41",
"axios": "^1.6.5",
"@xylabs/ts-scripts-yarn3": "^3.3.2",
"@xylabs/tsconfig-react": "^3.3.2",
"axios": "^1.6.7",
"eslint": "^8.56.0",
"eslint-import-resolver-typescript": "^3.6.1",
"eslint-plugin-deprecation": "^2.0.0",
Expand All @@ -78,10 +78,10 @@
"react-dom": "^18.2.0",
"remark-gfm": "^4.0.0",
"rimraf": "^5.0.5",
"storybook": "^7.6.10",
"storybook": "^7.6.16",
"storybook-dark-mode": "^3.0.3",
"typescript": "^5.3.3",
"webpack": "^5.89.0"
"webpack": "^5.90.2"
},
"peerDependencies": {
"@mui/icons-material": "^5",
Expand Down
10 changes: 5 additions & 5 deletions packages/accordion/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@
},
"description": "Common React library for all XY Labs projects that use React",
"devDependencies": {
"@mui/icons-material": "^5.15.5",
"@mui/material": "^5.15.5",
"@storybook/react": "^7.6.10",
"@mui/icons-material": "^5.15.10",
"@mui/material": "^5.15.10",
"@storybook/react": "^7.6.16",
"@xylabs/react-flexbox": "workspace:~",
"@xylabs/ts-scripts-yarn3": "^3.2.41",
"@xylabs/tsconfig-react": "^3.2.41",
"@xylabs/ts-scripts-yarn3": "^3.3.2",
"@xylabs/tsconfig-react": "^3.3.2",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"typescript": "^5.3.3"
Expand Down
4 changes: 2 additions & 2 deletions packages/animation/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
},
"description": "Common React library for all XY Labs projects that use React",
"devDependencies": {
"@xylabs/ts-scripts-yarn3": "^3.2.41",
"@xylabs/tsconfig-react": "^3.2.41",
"@xylabs/ts-scripts-yarn3": "^3.3.2",
"@xylabs/tsconfig-react": "^3.3.2",
"typescript": "^5.3.3"
},
"peerDependencies": {
Expand Down
10 changes: 5 additions & 5 deletions packages/appbar/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
},
"description": "Common React library for all XY Labs projects that use React",
"devDependencies": {
"@mui/icons-material": "^5.15.5",
"@mui/material": "^5.15.5",
"@storybook/react": "^7.6.10",
"@xylabs/ts-scripts-yarn3": "^3.2.41",
"@xylabs/tsconfig-react": "^3.2.41",
"@mui/icons-material": "^5.15.10",
"@mui/material": "^5.15.10",
"@storybook/react": "^7.6.16",
"@xylabs/ts-scripts-yarn3": "^3.3.2",
"@xylabs/tsconfig-react": "^3.3.2",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"typescript": "^5.3.3"
Expand Down
10 changes: 5 additions & 5 deletions packages/appbar/src/AppBarEx.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,21 @@ const AppBarExInner: React.FC<AppBarExProps> = ({ children, menu, contextToolbar
{systemToolbar ?? <Toolbar />}
{menu}
</FlexRow>
{belowSm && children && responsive ? <Toolbar>{children}</Toolbar> : null}
{belowSm && children && responsive ?
<Toolbar>{children}</Toolbar>
: null}
</>
)
}

export const AppBarEx: React.FC<AppBarExProps> = ({ container, children, menu, contextToolbar, systemToolbar, responsive, ...props }) => {
return (
<AppBar position="static" {...props}>
{container ? (
{container ?
<Container maxWidth={container}>
<AppBarExInner {...{ children, contextToolbar, menu, responsive, systemToolbar }} />
</Container>
) : (
<AppBarExInner {...{ children, contextToolbar, menu, responsive, systemToolbar }} />
)}
: <AppBarExInner {...{ children, contextToolbar, menu, responsive, systemToolbar }} />}
</AppBar>
)
}
8 changes: 4 additions & 4 deletions packages/async-effect/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
"@xylabs/react-promise": "workspace:~"
},
"devDependencies": {
"@mui/material": "^5.15.5",
"@storybook/react": "^7.6.10",
"@xylabs/ts-scripts-yarn3": "^3.2.41",
"@xylabs/tsconfig-react": "^3.2.41",
"@mui/material": "^5.15.10",
"@storybook/react": "^7.6.16",
"@xylabs/ts-scripts-yarn3": "^3.3.2",
"@xylabs/tsconfig-react": "^3.3.2",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"typescript": "^5.3.3"
Expand Down
12 changes: 6 additions & 6 deletions packages/base-page/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,16 @@
},
"description": "Common React library for all XY Labs projects that use React",
"devDependencies": {
"@mui/icons-material": "^5.15.5",
"@mui/material": "^5.15.5",
"@storybook/react": "^7.6.10",
"@mui/icons-material": "^5.15.10",
"@mui/material": "^5.15.10",
"@storybook/react": "^7.6.16",
"@types/react-helmet": "^6.1.11",
"@xylabs/ts-scripts-yarn3": "^3.2.41",
"@xylabs/tsconfig-react": "^3.2.41",
"@xylabs/ts-scripts-yarn3": "^3.3.2",
"@xylabs/tsconfig-react": "^3.3.2",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-helmet": "^6.1.0",
"react-router-dom": "^6.21.3",
"react-router-dom": "^6.22.1",
"typescript": "^5.3.3"
},
"peerDependencies": {
Expand Down
24 changes: 14 additions & 10 deletions packages/base-page/src/components/BasePage/BasePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,25 +37,29 @@ const BasePage: React.FC<BasePageProps> = ({
{...props}
>
<ScrollToTop />
<Helmet title={title}>{noindex ? <meta content="noindex" name="robots" /> : null}</Helmet>
{scrollToTopButton ? <div id={scrollToTopAnchorId} /> : null}
<Helmet title={title}>
{noindex ?
<meta content="noindex" name="robots" />
: null}
</Helmet>
{scrollToTopButton ?
<div id={scrollToTopAnchorId} />
: null}
{hideAppBar ? null : appBar}
{beta ? (
{beta ?
<FlexRow margin={1} position="absolute" top={0} left={0} bgcolor="#cccccc88" paddingX={1} style={{ opacity: 0.5 }}>
<Typography variant="body2">Important: This page is a Beta page. It is possible that some information may not be correct.</Typography>
</FlexRow>
) : null}
{container ? (
: null}
{container ?
<Container
style={{ alignItems: 'stretch', display: 'flex', flexDirection: 'column', flexGrow: 1 }}
maxWidth={container}
disableGutters={disableGutters}
>
{children}
</Container>
) : (
children
)}
: children}
{hideFooter ? null : <footer>{appFooter}</footer>}
{cookieConsent ?? (
<ScopedCssBaseline>
Expand All @@ -64,13 +68,13 @@ const BasePage: React.FC<BasePageProps> = ({
</InvertibleThemeProvider>
</ScopedCssBaseline>
)}
{scrollToTopButton ? (
{scrollToTopButton ?
<ScrollToTopButton anchorId={scrollToTopAnchorId}>
<Fab aria-label="scroll to top" color="secondary" size="small">
<KeyboardArrowUpIcon />
</Fab>
</ScrollToTopButton>
) : null}
: null}
</FlexCol>
)
}
Expand Down
10 changes: 5 additions & 5 deletions packages/button/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@
],
"dependencies": {
"@xylabs/react-shared": "workspace:~",
"react-router-dom": "^6.21.3"
"react-router-dom": "^6.22.1"
},
"description": "Common React library for all XY Labs projects that use React",
"devDependencies": {
"@mui/material": "^5.15.5",
"@storybook/react": "^7.6.10",
"@mui/material": "^5.15.10",
"@storybook/react": "^7.6.16",
"@xylabs/react-flexbox": "workspace:~",
"@xylabs/ts-scripts-yarn3": "^3.2.41",
"@xylabs/tsconfig-react": "^3.2.41",
"@xylabs/ts-scripts-yarn3": "^3.3.2",
"@xylabs/tsconfig-react": "^3.3.2",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"typescript": "^5.3.3"
Expand Down
8 changes: 6 additions & 2 deletions packages/button/src/components/ButtonExBase.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,12 @@ const ButtonExBase = forwardRef<HTMLButtonElement, ButtonExProps>((props, ref) =

return (
<Button ref={ref} onClick={localOnClick} {...rootProps}>
{busy && busyVariant === 'linear' ? <BusyLinearProgress rounded opacity={busyOpacity ?? 0} /> : null}
{busy && busyVariant === 'circular' ? <BusyCircularProgress rounded size={24} opacity={busyOpacity ?? 0.5} /> : null}
{busy && busyVariant === 'linear' ?
<BusyLinearProgress rounded opacity={busyOpacity ?? 0} />
: null}
{busy && busyVariant === 'circular' ?
<BusyCircularProgress rounded size={24} opacity={busyOpacity ?? 0.5} />
: null}
{children}
</Button>
)
Expand Down
16 changes: 8 additions & 8 deletions packages/common/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,22 @@
"packages/*"
],
"dependencies": {
"@xylabs/assert": "^2.13.23",
"@xylabs/lodash": "^2.13.23",
"@xylabs/assert": "^2.14.3",
"@xylabs/lodash": "^2.14.3",
"@xylabs/react-base-page": "workspace:~",
"@xylabs/react-error": "workspace:~",
"@xylabs/react-flexbox": "workspace:~",
"@xylabs/react-portal": "workspace:~",
"@xylabs/react-select": "workspace:~",
"react-router-dom": "^6.21.3"
"react-router-dom": "^6.22.1"
},
"description": "Common React library for all XY Labs projects that use React",
"devDependencies": {
"@mui/icons-material": "^5.15.5",
"@mui/material": "^5.15.5",
"@storybook/react": "^7.6.10",
"@xylabs/ts-scripts-yarn3": "^3.2.41",
"@xylabs/tsconfig-react": "^3.2.41",
"@mui/icons-material": "^5.15.10",
"@mui/material": "^5.15.10",
"@storybook/react": "^7.6.16",
"@xylabs/ts-scripts-yarn3": "^3.3.2",
"@xylabs/tsconfig-react": "^3.3.2",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"typescript": "^5.3.3"
Expand Down
9 changes: 8 additions & 1 deletion packages/common/src/components/Breadcrumbs/BreadcrumbsEx.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,14 @@ export const BreadcrumbsEx: React.FC<BreadcrumbsExProps> = ({
component={RouteLink}
to={path}
>
{index > 0 ? titles?.[index - 1] : <FlexRow>{typeof logo === 'string' ? <img src={logo} /> : logo}</FlexRow>}
{index > 0 ?
titles?.[index - 1]
: <FlexRow>
{typeof logo === 'string' ?
<img src={logo} />
: logo}
</FlexRow>
}
</Link>
)
})}
Expand Down
4 changes: 3 additions & 1 deletion packages/common/src/components/CoverProgress.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ export const CoverProgress: React.FC<CoverProgressProps> = (props) => {
left={0}
bgcolor={paper ? theme.palette.background.paper : theme.palette.background.default}
>
{(errors?.length ?? 0) === 0 ? <CircularProgress style={{ opacity }} /> : <ErrorsViewer margin={1} errors={errors} onRetry={onRetry} />}
{(errors?.length ?? 0) === 0 ?
<CircularProgress style={{ opacity }} />
: <ErrorsViewer margin={1} errors={errors} onRetry={onRetry} />}
</FlexGrowRow>
)
}
Expand Down
8 changes: 4 additions & 4 deletions packages/cookie-consent/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@
},
"description": "Common React library for all XY Labs projects that use React",
"devDependencies": {
"@mui/material": "^5.15.5",
"@storybook/react": "^7.6.10",
"@xylabs/ts-scripts-yarn3": "^3.2.41",
"@xylabs/tsconfig-react": "^3.2.41",
"@mui/material": "^5.15.10",
"@storybook/react": "^7.6.16",
"@xylabs/ts-scripts-yarn3": "^3.3.2",
"@xylabs/tsconfig-react": "^3.3.2",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"typescript": "^5.3.3"
Expand Down
Loading

0 comments on commit 9a02b43

Please sign in to comment.