Skip to content

Commit

Permalink
Fix frontend lint
Browse files Browse the repository at this point in the history
  • Loading branch information
Etheryte committed Aug 27, 2024
1 parent eee57d4 commit f5e9eb4
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 24 deletions.
4 changes: 2 additions & 2 deletions web/html/src/build/plugins/generate-stories-plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ module.exports = class GenerateStoriesPlugin {
};

const storyTemplate = (filePath, safeName, groupName) =>
`
`
import ${safeName}_component from "${filePath}";
import ${safeName}_raw from "${filePath}?raw";
Expand All @@ -87,7 +87,7 @@ export const ${safeName} = {
`;

const fileTemplate = (content) =>
`
`
/**
* NB! This is a generated file!
* Any changes you make here will be lost.
Expand Down
33 changes: 17 additions & 16 deletions web/html/src/manager/storybook/storybook.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,22 +89,23 @@ export const Storybook = () => {

{stories.map((group) => (
<div key={`${group.title}`}>
{normalize(group.title) === activeTabHash && group.stories?.map((item) => (
<Fragment key={`${group.title}-${item.title}`}>
<p>
<code>{item.title}</code>
</p>
<div className={styles.story}>
<div>{item.component ? <item.component /> : null}</div>
{showCode ? (
<pre>
<code>{item.raw}</code>
</pre>
) : null}
</div>
<hr />
</Fragment>
))}
{normalize(group.title) === activeTabHash &&
group.stories?.map((item) => (
<Fragment key={`${group.title}-${item.title}`}>
<p>
<code>{item.title}</code>
</p>
<div className={styles.story}>
<div>{item.component ? <item.component /> : null}</div>
{showCode ? (
<pre>
<code>{item.raw}</code>
</pre>
) : null}
</div>
<hr />
</Fragment>
))}
</div>
))}
</>
Expand Down
9 changes: 3 additions & 6 deletions web/html/src/object.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ interface ObjectConstructor {
* @param keySelector A callback which will be invoked for each item in items.
*/
groupBy<K extends PropertyKey, T>(
items: Iterable<T>,
keySelector: (item: T, index: number) => K,
items: Iterable<T>,
keySelector: (item: T, index: number) => K
): Partial<Record<K, T[]>>;
}

Expand All @@ -17,8 +17,5 @@ interface MapConstructor {
* @param items An iterable.
* @param keySelector A callback which will be invoked for each item in items.
*/
groupBy<K, T>(
items: Iterable<T>,
keySelector: (item: T, index: number) => K,
): Map<K, T[]>;
groupBy<K, T>(items: Iterable<T>, keySelector: (item: T, index: number) => K): Map<K, T[]>;
}

0 comments on commit f5e9eb4

Please sign in to comment.