Skip to content

Commit

Permalink
Merge pull request #21 from 8845musign/fix/DSGNPB-201-fix-import-paths
Browse files Browse the repository at this point in the history
Fix paths and Enable import lint checking
  • Loading branch information
takanorip authored Oct 26, 2023
2 parents c30947e + c09b5c9 commit cbea52f
Show file tree
Hide file tree
Showing 62 changed files with 178 additions and 117 deletions.
3 changes: 2 additions & 1 deletion .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ module.exports = {
alwaysTryTypes: true,
project: './tsconfig.json',
},
"import/resolver": 'typescript'
},
rules: {
'import/order': [
Expand All @@ -51,7 +52,7 @@ module.exports = {
},
],
'unused-imports/no-unused-imports': 'error',
'import/no-unresolved': 'off',
'import/no-unresolved': 2,
},
overrides: [
{
Expand Down
2 changes: 1 addition & 1 deletion .scaffdog/example.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export default {{ inputs.exampleName | pascal }};

```typescript
---
import ExampleLayout from '@layouts/exampleLayout.astro';
import ExampleLayout from '@layouts/ExampleLayout.astro';
import {{ inputs.exampleName | pascal }} from '@components/react/examples/{{ inputs.exampleKey }}/{{ inputs.exampleName | pascal }}';
---

Expand Down
69 changes: 69 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
"@ubie/prettier-config": "^0.1.0",
"eslint": "^8.51.0",
"eslint-config-prettier": "^9.0.0",
"eslint-import-resolver-typescript": "^3.6.1",
"eslint-plugin-astro": "^0.29.1",
"eslint-plugin-import": "^2.28.1",
"eslint-plugin-jsx-a11y": "^6.7.1",
Expand Down
4 changes: 2 additions & 2 deletions src/components/astro/PropsTable.astro
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
type Prop = {
name: string;
type: string;
defaultValue: string;
type: string | string[];
defaultValue: string | number | null;
required: boolean;
description: string;
};
Expand Down
20 changes: 5 additions & 15 deletions src/components/react/ButtonIcon.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { clsx } from "clsx";
import styles from "./ButtonIcon.module.css";
import type { FC, ReactNode } from "react";
import { clsx } from 'clsx';
import styles from './ButtonIcon.module.css';
import type { FC, ReactNode } from 'react';

interface Props {
children: ReactNode;
Expand All @@ -9,18 +9,8 @@ interface Props {
className?: string;
}

const ButtonIcon: FC<Props> = ({
children,
label,
onClick,
className = "",
}) => (
<button
onClick={onClick}
aria-label={label}
className={clsx(styles.button, className)}
title={label}
>
const ButtonIcon: FC<Props> = ({ children, label, onClick, className = '' }) => (
<button onClick={onClick} aria-label={label} className={clsx(styles.button, className)} title={label}>
{children}
</button>
);
Expand Down
2 changes: 1 addition & 1 deletion src/components/react/CopyButton.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { copyToClipboard } from '@utils/client';
import { clsx } from 'clsx';
import { useState } from 'react';
import { copyToClipboard } from '@utils/client';
import styles from './CopyButton.module.css';
import type { FC } from 'react';

Expand Down
2 changes: 1 addition & 1 deletion src/components/react/GlobalNavigation.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useStore } from '@nanostores/react';
import { $isMobileGlobalNavigationOpen } from '@store/navigation';
import clsx from 'clsx';
import FocusTrap from 'focus-trap-react';
import { $isMobileGlobalNavigationOpen } from '@store/navigation';
import styles from './GlobalNavigation.module.css';
import type { PostData } from '@types';
import type { FC } from 'react';
Expand Down
2 changes: 1 addition & 1 deletion src/components/react/TableOfContents/TableOfContents.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { extractHeadingsFromMain, pickHeadingIds } from '@utils/client';
import { useEffect, useState } from 'react';
import { extractHeadingsFromMain, pickHeadingIds } from '@utils/client';
import LinkToHeading from './LinkToHeading';
import styles from './TableOfContents.module.css';
import type { Heading } from '@utils/client';
Expand Down
2 changes: 1 addition & 1 deletion src/components/react/WithGlobalNavigation.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useStore } from '@nanostores/react';
import { $isMobileGlobalNavigationOpen } from '@store/navigation';
import clsx from 'clsx';
import { $isMobileGlobalNavigationOpen } from '@store/navigation';
import GlobalNavigation from './GlobalNavigation';
import styles from './WithGlobalNavigation.module.css';
import type { PostData } from '@types';
Expand Down
2 changes: 1 addition & 1 deletion src/components/react/figures/color/ColorChip.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import ButtonCopy from '@components/react/CopyButton';
import DesignToken from '@ubie/design-tokens';
import ButtonCopy from '@components/react/CopyButton';
import { validateContrast, convertHexWithPercentage, convertDisplayName, deleteAlpha } from '@utils/client';
import styles from './ColorChip.module.css';
import ColorChipValidationIndicator from './ColorChipValidationIndicator';
Expand Down
2 changes: 1 addition & 1 deletion src/components/react/figures/radius/TokenList.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import DesignToken from '@ubie/design-tokens';
import CopyButton from '@components/react/CopyButton';
import Table, { Row, TBody, THead, Cell, HeadCell, HeadRow } from '@components/react/Table';
import DesignToken from '@ubie/design-tokens';
import { pascalCaseToCSSVariables } from '@utils/client/css';
import { getKeys } from '@utils/client/object';
import type { FC } from 'react';
Expand Down
2 changes: 1 addition & 1 deletion src/components/react/figures/spacing/TokenList.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import DesignToken from '@ubie/design-tokens';
import CopyButton from '@components/react/CopyButton';
import Table, { Row, TBody, THead, Cell, HeadCell, HeadRow } from '@components/react/Table';
import DesignToken from '@ubie/design-tokens';
import { pascalCaseToCSSVariables } from '@utils/client/css';
import { getKeys } from '@utils/client/object';
import type { FC } from 'react';
Expand Down
2 changes: 1 addition & 1 deletion src/components/react/figures/typography/ExampleText.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import CopyButton from '@components/react/CopyButton';
import DesignTokens from '@ubie/design-tokens';
import CopyButton from '@components/react/CopyButton';
import { convertToTypographyCSS, convertToTypographyReact } from './scripts';
import type { FC } from 'react';

Expand Down
2 changes: 1 addition & 1 deletion src/layouts/BaseLayout.astro
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ import '@unocss/reset/sanitize/assets.css';
import '@ubie/design-tokens/dist/tokens.css';
import '../styles/libs/prism-a11y-dark.css';
import '@styles/global.css';
import type { PostData } from '@types';
import GlobalHeader from '@components/astro/GlobalHeader.astro';
import WithGlobalNavigation from '@components/react/WithGlobalNavigation';
import type { PostData } from '@types';
const currentPath = new URL(Astro.request.url).pathname;
const allComponentMdx = await Astro.glob('../pages/components/*.mdx');
Expand Down
2 changes: 1 addition & 1 deletion src/layouts/ComponentLayout.astro
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const examples = getAllExample(exampleKey);
<h2 id="Props">
Props<a class="linkHeading" href="#Props"><span class="linkHeadingIcon">#</span></a>
</h2>
<PropsTable propsArray={propsArray as any} />
<PropsTable propsArray={propsArray} />
</section>
<slot />
</section>
Expand Down
2 changes: 1 addition & 1 deletion src/layouts/PostLayout.astro
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
import Markdown from '@components/astro/Markdown.astro';
import BaseLayout from './BaseLayout.astro';
import WithTableOfContentsLayout from './WithTableOfContentsLayout.astro';
import Markdown from '@components/astro/Markdown.astro';
const { title, description } = Astro.props.frontmatter;
---
Expand Down
4 changes: 2 additions & 2 deletions src/pages/components/examples/accordion/small.astro
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
import ExampleLayout from '@layouts/exampleLayout.astro';
import ExampleLayout from '@layouts/ExampleLayout.astro';
import Small from '@components/react/examples/accordion/Small';
---

<ExampleLayout title="Small Example | Accordion">
<Small client:only="react" />
</ExampleLayout>
</ExampleLayout>
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
import ExampleLayout from '@layouts/exampleLayout.astro';
import ExampleLayout from '@layouts/ExampleLayout.astro';
import Customized from '@components/react/examples/action-half-modal/Customized';
---

<ExampleLayout title="Customized Example | ActionHalfModal">
<Customized client:only="react" />
</ExampleLayout>
</ExampleLayout>
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
import ExampleLayout from '@layouts/exampleLayout.astro';
import ExampleLayout from '@layouts/ExampleLayout.astro';
import Fullscreen from '@components/react/examples/action-half-modal/Fullscreen';
---

<ExampleLayout title="Fullscreen Example | ActionHalfModal">
<Fullscreen client:only="react" />
</ExampleLayout>
</ExampleLayout>
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
import ExampleLayout from '@layouts/exampleLayout.astro';
import ExampleLayout from '@layouts/ExampleLayout.astro';
import NoCloseButton from '@components/react/examples/action-half-modal/NoCloseButton';
---

<ExampleLayout title="NoCloseButton Example | ActionHalfModal">
<NoCloseButton client:only="react" />
</ExampleLayout>
</ExampleLayout>
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
import ExampleLayout from '@layouts/exampleLayout.astro';
import ExampleLayout from '@layouts/ExampleLayout.astro';
import Secondary from '@components/react/examples/action-half-modal/Secondary';
---

<ExampleLayout title="Secondary Example | ActionHalfModal">
<Secondary client:only="react" />
</ExampleLayout>
</ExampleLayout>
4 changes: 2 additions & 2 deletions src/pages/components/examples/action-modal/customized.astro
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
import ExampleLayout from '@layouts/exampleLayout.astro';
import ExampleLayout from '@layouts/ExampleLayout.astro';
import Customized from '@components/react/examples/action-modal/Customized';
---

<ExampleLayout title="Customized Example | ActionModal">
<Customized client:only="react" />
</ExampleLayout>
</ExampleLayout>
4 changes: 2 additions & 2 deletions src/pages/components/examples/action-modal/fixed-height.astro
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
import ExampleLayout from '@layouts/exampleLayout.astro';
import ExampleLayout from '@layouts/ExampleLayout.astro';
import FixedHeight from '@components/react/examples/action-modal/FixedHeight';
---

<ExampleLayout title="FixedHeight Example | ActionModal">
<FixedHeight client:only="react" />
</ExampleLayout>
</ExampleLayout>
4 changes: 2 additions & 2 deletions src/pages/components/examples/action-modal/secondary.astro
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
import ExampleLayout from '@layouts/exampleLayout.astro';
import ExampleLayout from '@layouts/ExampleLayout.astro';
import Secondary from '@components/react/examples/action-modal/Secondary';
---

<ExampleLayout title="Secondary Example | ActionModal">
<Secondary client:only="react" />
</ExampleLayout>
</ExampleLayout>
4 changes: 2 additions & 2 deletions src/pages/components/examples/button/block.astro
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
import ExampleLayout from '@layouts/exampleLayout.astro';
import ExampleLayout from '@layouts/ExampleLayout.astro';
import Block from '@components/react/examples/button/Block';
---

<ExampleLayout title="Block Example | Button">
<Block client:only="react" />
</ExampleLayout>
</ExampleLayout>
4 changes: 2 additions & 2 deletions src/pages/components/examples/button/disabled.astro
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
import ExampleLayout from '@layouts/exampleLayout.astro';
import ExampleLayout from '@layouts/ExampleLayout.astro';
import Disabled from '@components/react/examples/button/Disabled';
---

<ExampleLayout title="Disabled Example | Button">
<Disabled client:only="react" />
</ExampleLayout>
</ExampleLayout>
Loading

0 comments on commit cbea52f

Please sign in to comment.