Skip to content

Commit d295982

Browse files
committed
More ESLint fixes
1 parent 5164ec4 commit d295982

20 files changed

+41
-47
lines changed

.eslintrc.json

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,10 @@
2121
"react-hooks"
2222
],
2323
"rules": {
24+
"@typescript-eslint/no-explicit-any": "off",
25+
"@typescript-eslint/no-unused-vars": "off",
2426
"@typescript-eslint/ban-ts-comment": "warn",
2527
"@typescript-eslint/no-empty-function": "warn",
26-
"@typescript-eslint/padding-line-between-statements": [
27-
"error",
28-
{
29-
"blankLine": "always",
30-
"prev": "*",
31-
"next": ["class", "export", "function", "interface", "type"]
32-
}
33-
],
3428
"no-empty": "warn",
3529
"no-console": ["error", { "allow": ["warn", "error"] }],
3630
"react/jsx-sort-props": [2, { "reservedFirst": true, "callbacksLast": true }],

src/Circular/Annotations.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ export class Annotations extends React.PureComponent<AnnotationsProps> {
7575
lineHeight={lineHeight}
7676
seqLength={this.props.seqLength}
7777
/>
78-
))
78+
)),
7979
);
8080
}, [])}
8181
</g>

src/Circular/Circular.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ export default class Circular extends React.Component<CircularProps, CircularSta
128128
...c,
129129
start: c.fcut,
130130
type: "enzyme",
131-
})
131+
}),
132132
);
133133

134134
// sort all the labels so they're in ascending order

src/Circular/Index.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ export class Index extends React.PureComponent<IndexProps> {
6464
t =>
6565
Math.abs(centralIndex - t) < tickTolerance ||
6666
Math.abs(centralIndex + seqLength - t) < tickTolerance ||
67-
Math.abs(centralIndex - seqLength - t) < tickTolerance
67+
Math.abs(centralIndex - seqLength - t) < tickTolerance,
6868
);
6969
return { indexInc, ticks };
7070
};
@@ -103,7 +103,7 @@ export class Index extends React.PureComponent<IndexProps> {
103103
transform={getRotation(i)}
104104
>
105105
{seqForCircular.charAt(i)}
106-
</text>
106+
</text>,
107107
);
108108
if (showComplement) {
109109
basepairsToRender.push(
@@ -115,7 +115,7 @@ export class Index extends React.PureComponent<IndexProps> {
115115
transform={getRotation(i)}
116116
>
117117
{compSeqForCircular.charAt(i)}
118-
</text>
118+
</text>,
119119
);
120120
}
121121
}

src/Circular/Labels.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ export class Labels extends React.Component<LabelsProps, LabelsState> {
232232

233233
// check whether any of these attempted new labels overlaps with the neighbors
234234
const overlapWithNeighbors = newLabels.some(l =>
235-
[leftNeighbor, rightNeighbor].some(n => n && Math.abs(n.textCoor.y - l.textCoor.y) < 15)
235+
[leftNeighbor, rightNeighbor].some(n => n && Math.abs(n.textCoor.y - l.textCoor.y) < 15),
236236
);
237237
if (overlapWithNeighbors) return acc.concat(g); // just bail and return the original grouping
238238
return acc.concat(...newLabels); // add the newly created labels

src/Circular/WrappedGroupLabel.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ export const WrappedGroupLabel = (props: WrappedGroupLabelProps) => {
7272
const groupHeight = labelRows.length * lineHeight;
7373
const groupWidth = labelRows.reduce(
7474
(max, row, i) => Math.max(max, calcRowWidth(row) - (i === labelRows.length - 1 ? CHAR_WIDTH : 0)), // no comma on last row, correct
75-
0
75+
0,
7676
);
7777
// add one CHAR_WIDTH padding to all sides of label box
7878
const [rectHeight, rectWidth] = [groupHeight, groupWidth].map(x => x + 2 * CHAR_WIDTH);

src/Linear/CutSites.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export const CutSites = (props: {
4343
cutSites,
4444
firstBase,
4545
lastBase,
46-
findXAndWidth
46+
findXAndWidth,
4747
);
4848
if (!enhancedCutSites.length) return null;
4949

@@ -159,7 +159,7 @@ const enhanceCutSites = (
159159
cutSites: CutSite[],
160160
firstBase: number,
161161
lastBase: number,
162-
findXAndWidth: FindXAndWidthType
162+
findXAndWidth: FindXAndWidthType,
163163
): CutSiteEnhanced[] =>
164164
cutSites.map((c: CutSite) => {
165165
// Prevent double rendering of cut-site lines across SeqBlocks. Without the shenanigans below,
@@ -225,7 +225,7 @@ const enhanceCutSites = (
225225
lastBase,
226226
showTopLine,
227227
showBottomLine,
228-
findXAndWidth
228+
findXAndWidth,
229229
),
230230
highlight: calcHighlight(enhancedCutSite, firstBase, lastBase, findXAndWidth),
231231
top: {
@@ -242,18 +242,18 @@ const calcHighlight = (
242242
c: CutSite,
243243
firstBase: number,
244244
lastBase: number,
245-
findXAndWidth: FindXAndWidthType
245+
findXAndWidth: FindXAndWidthType,
246246
): { width: number; x: number } => {
247247
if (isWithinSeqBlock(c.start, c.end, firstBase, lastBase)) {
248248
if (c.start > c.end) {
249249
return findXAndWidth(
250250
c.end < firstBase ? lastBase : Math.min(lastBase, c.end),
251-
c.start > lastBase ? firstBase : Math.max(firstBase, c.start)
251+
c.start > lastBase ? firstBase : Math.max(firstBase, c.start),
252252
);
253253
}
254254
return findXAndWidth(
255255
c.start < firstBase ? lastBase : Math.min(lastBase, c.start),
256-
c.end > lastBase ? firstBase : Math.max(firstBase, c.end)
256+
c.end > lastBase ? firstBase : Math.max(firstBase, c.end),
257257
);
258258
}
259259
return findXAndWidth(c.start, c.end);
@@ -281,7 +281,7 @@ const calcConnector = (
281281
lastBase: number,
282282
showTopLine: boolean,
283283
showBottomLine: boolean,
284-
findXAndWidth: FindXAndWidthType
284+
findXAndWidth: FindXAndWidthType,
285285
): { render: boolean; width: number; x: number } => {
286286
if (showTopLine && showBottomLine) {
287287
return {

src/Linear/Find.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ const FindBlock = ({
8686
if (start > end) {
8787
({ width, x } = findXAndWidth(
8888
start > lastBase ? firstBase : Math.max(firstBase, start),
89-
end < firstBase ? lastBase : Math.min(lastBase, end)
89+
end < firstBase ? lastBase : Math.min(lastBase, end),
9090
));
9191
}
9292

src/Linear/InfiniteScroll.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ export class InfiniteScroll extends React.PureComponent<InfiniteScrollProps, Inf
5757
componentDidUpdate = (
5858
prevProps: InfiniteScrollProps,
5959
prevState: InfiniteScrollState,
60-
snapshot: InfiniteScrollSnapshot
60+
snapshot: InfiniteScrollSnapshot,
6161
) => {
6262
if (!this.scroller.current) {
6363
// scroller not mounted yet
@@ -123,7 +123,7 @@ export class InfiniteScroll extends React.PureComponent<InfiniteScrollProps, Inf
123123

124124
// find the first block that contains the new central index
125125
const centerBlockIndex = seqBlocks.findIndex(
126-
block => block.props.firstBase <= centralIndex && block.props.firstBase + bpsPerBlock >= centralIndex
126+
block => block.props.firstBase <= centralIndex && block.props.firstBase + bpsPerBlock >= centralIndex,
127127
);
128128

129129
// build up the list of blocks that are visible just beneath this first block

src/Linear/Linear.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -113,18 +113,18 @@ export default class Linear extends React.Component<LinearProps> {
113113
const primerFwdRows = createMultiRows(
114114
stackElements(vetAnnotations(primers.filter(p => p.direction === 1)), seq.length),
115115
bpsPerBlock,
116-
arrSize
116+
arrSize,
117117
);
118118
const primerRevRows = createMultiRows(
119119
stackElements(vetAnnotations(primers.filter(p => p.direction === -1)), seq.length),
120120
bpsPerBlock,
121-
arrSize
121+
arrSize,
122122
);
123123

124124
const annotationRows = createMultiRows(
125125
stackElements(vetAnnotations(annotations), seq.length),
126126
bpsPerBlock,
127-
arrSize
127+
arrSize,
128128
);
129129

130130
const searchRows: NameRange[][] =
@@ -213,7 +213,7 @@ export default class Linear extends React.Component<LinearProps> {
213213
zoom={zoom}
214214
zoomed={zoomed}
215215
onUnmount={onUnmount}
216-
/>
216+
/>,
217217
);
218218
yDiff += blockHeights[i];
219219
}

0 commit comments

Comments
 (0)