Skip to content

Commit

Permalink
chore: bump eslint (#10170)
Browse files Browse the repository at this point in the history
Signed-off-by: Matt Krick <matt.krick@gmail.com>
  • Loading branch information
mattkrick authored Aug 28, 2024
1 parent b172a2f commit 002aac2
Show file tree
Hide file tree
Showing 71 changed files with 512 additions and 547 deletions.
30 changes: 0 additions & 30 deletions .eslintrc.js

This file was deleted.

61 changes: 61 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
import eslint from '@eslint/js'
import tseslint from 'typescript-eslint'

export default tseslint.config(
eslint.configs.recommended,
...tseslint.configs.recommendedTypeChecked,
{
ignores: ['**/*.js', '**/*.mjs']
},
{
languageOptions: {
parserOptions: {
ecmaVersion: 2020,
sourceType: 'module',
projectService: true,
tsconfigRootDir: import.meta.dirname
}
},
rules: {
eqeqeq: 'error',
'no-extra-boolean-cast': 'off',
'no-case-declarations': 'off',
'no-useless-escape': 'off',
'no-constant-binary-expression': 'off',
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/camelcase': 'off',
'@typescript-eslint/no-empty-interface': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/no-object-literal-type-assertion': 'off',
'@typescript-eslint/no-use-before-define': 'off',
'@typescript-eslint/explicit-member-accessibility': 'off',
'@typescript-eslint/interface-name-prefix': 'off',
'@typescript-eslint/no-duplicate-enum-values': 'off',
'@typescript-eslint/no-unused-vars': 'off',
'@typescript-eslint/no-var-requires': 'off',
'@typescript-eslint/no-parameter-properties': 'off',
'@typescript-eslint/no-namespace': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-unnecessary-type-assertion': 'off',
'@typescript-eslint/no-unused-expressions': 'off', // relay fragments
'@typescript-eslint/no-unsafe-return': 'off',
'@typescript-eslint/no-unsafe-assignment': 'off',
'@typescript-eslint/no-unsafe-member-access': 'off',
'@typescript-eslint/no-unsafe-call': 'off',
'@typescript-eslint/prefer-promise-reject-errors': 'off',
'@typescript-eslint/no-floating-promises': 'off',
'@typescript-eslint/no-unsafe-argument': 'off',
'@typescript-eslint/no-unsafe-enum-comparison': 'off',
'@typescript-eslint/require-await': 'off',
'@typescript-eslint/no-redundant-type-constituents': 'off',
'@typescript-eslint/no-misused-promises': 'off',
'@typescript-eslint/no-empty-object-type': 'off',
'@typescript-eslint/no-require-imports': 'off',
'@typescript-eslint/restrict-template-expressions': 'off',
'@typescript-eslint/restrict-plus-operands': 'off',
'@typescript-eslint/unbound-method': 'off'
}
}
)
10 changes: 6 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@
"@babel/core": "^7.20.12",
"@babel/preset-env": "^7.25.0",
"@datadog/datadog-ci": "^2.33.0",
"@eslint/compat": "^1.1.1",
"@graphql-codegen/add": "^5.0.0",
"@graphql-codegen/cli": "^5.0.0",
"@graphql-codegen/typescript": "^4.0.1",
Expand All @@ -92,13 +93,13 @@
"@types/dotenv": "^6.1.1",
"@types/jscodeshift": "^0.11.3",
"@types/lodash.toarray": "^4.4.7",
"@typescript-eslint/eslint-plugin": "^7.4.0",
"@typescript-eslint/parser": "^7.4.0",
"@typescript-eslint/eslint-plugin": "^8.3.0",
"@typescript-eslint/parser": "^8.3.0",
"autoprefixer": "^10.4.13",
"babel-loader": "^9.1.2",
"concurrently": "^8.0.1",
"copy-webpack-plugin": "^11.0.0",
"eslint": "^8.57.0",
"eslint": "^9.9.1",
"eslint-config-prettier": "^9.1.0",
"graphql": "16.9.0",
"html-webpack-plugin": "^5.5.0",
Expand All @@ -115,7 +116,7 @@
"postcss": "^8.4.21",
"postcss-loader": "^7.0.2",
"prettier": "^3.2.5",
"prettier-plugin-organize-imports": "^3.2.4",
"prettier-plugin-organize-imports": "^4.0.0",
"prettier-plugin-tailwindcss": "^0.5.13",
"raw-loader": "^4.0.2",
"relay-compiler": "^14.1.0",
Expand All @@ -125,6 +126,7 @@
"terser-webpack-plugin": "^5.3.9",
"ts-loader": "9.2.6",
"typescript": "^5.3.3",
"typescript-eslint": "^8.3.0",
"vscode-apollo-relay": "^1.5.0",
"webpack": "^5.89.0",
"webpack-cli": "4.9.1",
Expand Down
11 changes: 0 additions & 11 deletions packages/chronos/.eslintrc.js

This file was deleted.

8 changes: 4 additions & 4 deletions packages/chronos/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
"url": "git+https://github.com/ParabolInc/parabol.git"
},
"scripts": {
"lint": "eslint --fix . --ext .ts,.tsx",
"lint:check": "eslint . --ext .ts,.tsx",
"prettier": "prettier --config ../../.prettierrc --ignore-path ./.eslintignore --write \"**/*.{ts,tsx,graphql}\"",
"prettier:check": "prettier --config ../../.prettierrc --ignore-path ./.eslintignore --check \"**/*.{ts,tsx,graphql}\"",
"lint": "yarn lint:check --fix .",
"lint:check": "node --max_old_space_size=8192 ../../node_modules/.bin/eslint .",
"prettier": "prettier --config ../../.prettierrc --ignore-path ./.prettierignore --write \"**/*.{ts,tsx,graphql}\"",
"prettier:check": "prettier --config ../../.prettierrc --ignore-path ./.prettierignore --check \"**/*.{ts,tsx,graphql}\"",
"typecheck": "yarn tsc --noEmit -p tsconfig.json"
},
"bugs": {
Expand Down
27 changes: 0 additions & 27 deletions packages/client/.eslintrc.js

This file was deleted.

File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ const ActivityDetails = (props: Props) => {
if (!activity) {
return <Redirect to='/activity-library' />
}
// eslint-disable react-hooks/rules-of-hooks -- return above violates these rules, but is just a safeguard and not normal usage
/* eslint-disable react-hooks/rules-of-hooks */
useEffect(() => {
SendClientSideEvent(atmosphere, 'Viewed Template', {
meetingType: activity.type,
Expand Down
1 change: 0 additions & 1 deletion packages/client/components/AnalyticsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,6 @@ const AnalyticsPage = () => {
configGA()
}, [ReactGA.isInitialized, atmosphere.viewerId])

/* eslint-disable */
const {href, pathname} = location

useEffect(() => {
Expand Down
21 changes: 11 additions & 10 deletions packages/client/components/Dashboard/DashModal.tsx
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
import {keyframes} from '@emotion/core'
import styled from '@emotion/styled'
import React, {ReactNode} from 'react'
import {DECELERATE} from '../../styles/animation'
import {modalShadow} from '../../styles/elevation'
import {PALETTE} from '../../styles/paletteV3'
import {Radius, ZIndex} from '../../types/constEnums'

const animateIn = {
'0%': {
opacity: '0',
transform: 'translate3d(0, -50px, 0)'
},
'100%': {
opacity: '1',
transform: 'translate3d(0, 0, 0)'
export const animateIn = keyframes`
0% {
opacity: 0;
transform: translate3d(0, -50px, 0);
}
}
100% {
opacity: 1;
transform: translate3d(0, 0, 0);
}
`

const Backdrop = styled('div')({
alignItems: 'center',
Expand All @@ -34,7 +35,7 @@ const Backdrop = styled('div')({

const Modal = styled('div')({
animationIterationCount: 1,
animation: `${animateIn} 200ms ${DECELERATE}`,
animation: `${animateIn.toString()} 200ms ${DECELERATE}`,
background: '#FFFFFF',
borderRadius: Radius.DIALOG,
boxShadow: modalShadow,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ const EditorSuggestions = <T extends BaseSuggestion>(props: Props<T>) => {
<MentionMenu>
{suggestions.map((suggestion, idx) => {
return (
// eslint-disable-next-line
<div
key={idx}
onMouseDown={dontTellDraft}
Expand Down
3 changes: 0 additions & 3 deletions packages/client/components/MeetingCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -265,9 +265,6 @@ const MeetingCard = (props: Props) => {
if (!team) {
// 95% sure there's a bug in relay causing this
const errObj = {id: meetingId} as any
if (meeting.hasOwnProperty('team')) {
errObj.team = team
}
Sentry.captureException(new Error(`Missing Team on Meeting ${JSON.stringify(errObj)}`))
return null
}
Expand Down
12 changes: 3 additions & 9 deletions packages/client/components/Menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,9 @@ const Menu = forwardRef((props: Props, ref: any) => {
handleKeyDown
}))

useEffect(
() => {
if (!keepParentFocus) menuRef.current && menuRef.current.focus()
},
resetActiveOnChanges ||
[
/* eslint-disable-line react-hooks/exhaustive-deps*/
]
)
useEffect(() => {
if (!keepParentFocus) menuRef.current && menuRef.current.focus()
}, resetActiveOnChanges || [])

const handleMouseDown = useCallback(
(e: React.MouseEvent) => {
Expand Down
3 changes: 0 additions & 3 deletions packages/client/components/RetroDiscussPhase.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -203,9 +203,6 @@ const RetroDiscussPhase = (props: Props) => {
// this shouldn't ever happen, yet
// https://sentry.io/organizations/parabol/issues/1322927523/?environment=client&project=107196&query=is%3Aunresolved
const errObj = {id: reflectionGroup.id} as any
if (reflectionGroup.hasOwnProperty('reflections')) {
errObj.reflections = reflections
}
Sentry.captureException(new Error(`NO REFLECTIONS ${JSON.stringify(errObj)}`))
}
return (
Expand Down
4 changes: 3 additions & 1 deletion packages/client/components/SAMLRedirect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ const SAMLRedirect = () => {
// cross-domain attempts to access opener.location.origin will throw
// this makes sure that Parabol opened the popup
isSameOriginPopup = !!window.opener.location.origin
} catch {}
} catch {
/* noop */
}
}
if (isSameOriginPopup) {
// SP-initiated
Expand Down
3 changes: 0 additions & 3 deletions packages/client/components/SelectMeetingDropdownItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,6 @@ const SelectMeetingDropdownItem = (props: Props) => {
if (!team) {
// 95% sure there's a bug in relay causing this
const errObj = {id: meetingId} as any
if (meeting.hasOwnProperty('team')) {
errObj.team = team
}
Sentry.captureException(new Error(`Missing Team on Meeting ${JSON.stringify(errObj)}`))
return null
}
Expand Down
19 changes: 7 additions & 12 deletions packages/client/components/SwipeableDashSidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -120,18 +120,13 @@ const SwipeableDashSidebar = (props: Props) => {
const SIDEBAR_WIDTH: number = sidebarWidth || NavSidebar.WIDTH
const HYSTERESIS_THRESH = HYSTERESIS * SIDEBAR_WIDTH

useEffect(
() => {
openPortal()
return () => {
window.clearTimeout(swipe.peekTimeout)
hideSidebar()
}
},
[
/* eslint-disable-line react-hooks/exhaustive-deps*/
]
)
useEffect(() => {
openPortal()
return () => {
window.clearTimeout(swipe.peekTimeout)
hideSidebar()
}
}, [])

const hideSidebar = useCallback(() => {
setX(0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const GCalIntegrationResults = (props: Props) => {

const gcal = query.viewer.teamMember?.integrations.gcal

const gcalResults = gcal?.events ? [...gcal?.events] : null
const gcalResults = gcal?.events ? [...gcal!.events] : null
if (order === 'DESC') {
gcalResults?.reverse()
}
Expand Down
31 changes: 13 additions & 18 deletions packages/client/components/ViewerNotOnTeam.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,24 +46,19 @@ const ViewerNotOnTeam = (props: Props) => {
const {history} = useRouter()
const {onError, onCompleted} = useMutationProps()
useDocumentTitle(`Invitation Required`, 'Invitation Required')
useEffect(
() => {
if (teamInvitation) {
// if an invitation already exists, accept it
AcceptTeamInvitationMutation(
atmosphere,
{invitationToken: teamInvitation.token},
{history, meetingId}
)
return
} else if (teamId)
PushInvitationMutation(atmosphere, {meetingId, teamId}, {onError, onCompleted})
return undefined
},
[
/* eslint-disable-line react-hooks/exhaustive-deps*/
]
)
useEffect(() => {
if (teamInvitation) {
// if an invitation already exists, accept it
AcceptTeamInvitationMutation(
atmosphere,
{invitationToken: teamInvitation.token},
{history, meetingId}
)
return
} else if (teamId)
PushInvitationMutation(atmosphere, {meetingId, teamId}, {onError, onCompleted})
return undefined
}, [])

if (teamInvitation) return null
return (
Expand Down
Loading

0 comments on commit 002aac2

Please sign in to comment.