Skip to content

Commit

Permalink
Enable unicorn prefer-array-some
Browse files Browse the repository at this point in the history
  • Loading branch information
garrettjstevens committed Aug 21, 2023
1 parent 54adfb5 commit 00d4201
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 9 deletions.
3 changes: 1 addition & 2 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,7 @@ module.exports = {
'unicorn/no-array-for-each': 'off',
'unicorn/no-empty-file': 'off', // False positives
'unicorn/no-null': 'off',
'unicorn/prefer-array-some': 'off',
'unicorn/prefer-module': 'off',
'unicorn/prefer-module': 'off', // Cypress and apollo-collaboration-server need this
'unicorn/prevent-abbreviations': 'off',
// Special case @typescript-eslint/eslint-plugin rule
// Will be part of "plugin:@typescript-eslint/recommended-type-checked" when
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export class ParentChildValidation extends Validation {
const errMsg = `ERROR: The following featureId was not found in database ='${featureId}'`
throw new Error(errMsg)
}
if (!topLevelFeatures.find((f) => f._id === topLevelFeature._id)) {
if (!topLevelFeatures.some((f) => f._id === topLevelFeature._id)) {
topLevelFeatures.push(topLevelFeature)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ const stateModelFactory = (
}
const { menuItems } = apolloMenu
if (
!menuItems.find(
!menuItems.some(
(menuItem) =>
'label' in menuItem && menuItem.label === 'Add Assembly',
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,14 +185,14 @@ function ApolloRendering(props: ApolloRenderingProps) {
transcript[parentID] = []
}
if (
!transcript[parentID].find(
!transcript[parentID].some(
(el) => el[0] === startPx && el[1] === lineY,
)
) {
transcript[parentID].push([startPx, lineY])
}
if (
!transcript[parentID].find((el) => el[0] === endPx && el[1] === lineY)
!transcript[parentID].some((el) => el[0] === endPx && el[1] === lineY)
) {
transcript[parentID].push([endPx, lineY])
}
Expand Down
5 changes: 2 additions & 3 deletions packages/jbrowse-plugin-apollo/src/session/session.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,9 @@ export function extendSession(
},
addApolloTrackConfig(assembly: AssemblyModel, baseURL?: string) {
const trackId = `apollo_track_${assembly.name}`
const hasTrack = Boolean(
const hasTrack =
// eslint-disable-next-line @typescript-eslint/no-explicit-any
self.tracks.find((track: any) => track.trackId === trackId),
)
self.tracks.some((track: any) => track.trackId === trackId)
if (!hasTrack) {
self.addTrackConf({
type: 'ApolloTrack',
Expand Down

0 comments on commit 00d4201

Please sign in to comment.