Skip to content

Commit

Permalink
Fix linting in the CD (#42)
Browse files Browse the repository at this point in the history
  • Loading branch information
alan-cooney authored Dec 30, 2022
1 parent a76d4d0 commit 5f3b5a9
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 9 deletions.
2 changes: 1 addition & 1 deletion react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
},
"scripts": {
"test": "jest",
"lint": "eslint",
"lint": "eslint src",
"buildBrowser": "node ./esbuild.js",
"buildNode": "tsc --project tsconfig.build.json",
"build": "yarn buildBrowser && yarn buildNode",
Expand Down
2 changes: 1 addition & 1 deletion react/src/attention/AttentionHeads.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export default {
component: AttentionHeads,
argTypes: {
negativeColor: { control: "color" },
positiveColor: { control: "color" },
positiveColor: { control: "color" }
}
} as ComponentMeta<typeof AttentionHeads>;

Expand Down
8 changes: 4 additions & 4 deletions react/src/attention/AttentionHeads.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,10 @@ export function AttentionHeadsSelector({
borderColor: attentionHeadColor(idx, attention.length),
boxShadow: isFocused
? `0px 0px 4px 3px ${attentionHeadColor(
idx,
attention.length,
"60%"
)}`
idx,
attention.length,
"60%"
)}`
: undefined
}}
>
Expand Down
1 change: 1 addition & 0 deletions react/src/attention/mocks/attention.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable @typescript-eslint/no-loss-of-precision */
export const mockTokens: string[] = [
"<|endoftext|>",
"Help",
Expand Down
11 changes: 8 additions & 3 deletions react/src/shared/NumberSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@ export function NumberSelector({
(i) => i + smallestNumber
);
// If no labels are provided or the length of labels is not equal to the length of options, use the numbers as the labels.
const resolvedLabels = (labels && labels.length === options.length) ? labels : options.map((i) => i.toString());
const resolvedLabels =
labels && labels.length === options.length
? labels
: options.map((i) => i.toString());
return (
<select
value={currentValue}
Expand All @@ -41,8 +44,10 @@ export function NumberSelector({
>
{/* If no labels are provided, use the numbers as the labels. */}
{options.map((value, index) => (
<option key={value} value={value}>{resolvedLabels[index]}</option>
<option key={value} value={value}>
{resolvedLabels[index]}
</option>
))}
</select>
);
}
}

0 comments on commit 5f3b5a9

Please sign in to comment.