Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

📦️ update typescript-eslint #3192

Merged
merged 4 commits into from
Dec 17, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,6 @@ module.exports = {
'@typescript-eslint/no-unsafe-argument': 'off',
'@typescript-eslint/no-unsafe-member-access': 'off',
'@typescript-eslint/no-unused-vars': ['error', { args: 'all', argsIgnorePattern: '^_', vars: 'all' }],
'@typescript-eslint/no-unused-expressions': 'off',
'@typescript-eslint/triple-slash-reference': ['error', { path: 'always', types: 'prefer-import', lib: 'always' }],

'import/no-cycle': 'error',
Expand Down
2 changes: 1 addition & 1 deletion developer-extension/src/panel/components/panel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export function Panel() {
const [activeTab, setActiveTab] = useState<string | null>(DEFAULT_PANEL_TAB)
function updateActiveTab(activeTab: string | null) {
setActiveTab(activeTab)
activeTab && datadogRum.startView(activeTab)
datadogRum.startView(activeTab!)
}

return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ function Entry({
}

const handleClearClick = () => {
onChange && onChange(null)
onChange!(null)
cy-moi marked this conversation as resolved.
Show resolved Hide resolved
reloadPage()
}

Expand Down
8 changes: 4 additions & 4 deletions packages/core/src/domain/context/contextManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export function createContextManager(customerDataTracker?: CustomerDataTracker)
setContext: (newContext: Context) => {
if (getType(newContext) === 'object') {
context = sanitize(newContext)
customerDataTracker && customerDataTracker.updateCustomerData(context)
customerDataTracker?.updateCustomerData(context)
} else {
contextManager.clearContext()
}
Expand All @@ -26,19 +26,19 @@ export function createContextManager(customerDataTracker?: CustomerDataTracker)

setContextProperty: (key: string, property: any) => {
context[key] = sanitize(property)
customerDataTracker && customerDataTracker.updateCustomerData(context)
customerDataTracker?.updateCustomerData(context)
changeObservable.notify()
},

removeContextProperty: (key: string) => {
delete context[key]
customerDataTracker && customerDataTracker.updateCustomerData(context)
customerDataTracker?.updateCustomerData(context)
changeObservable.notify()
},

clearContext: () => {
context = {}
customerDataTracker && customerDataTracker.resetCustomerData()
customerDataTracker?.resetCustomerData()
changeObservable.notify()
},

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@ const EXPIRED_SESSION: SessionState = { isExpired: '1' }

describe('with lock access disabled', () => {
beforeEach(() => {
sessionStoreStrategy.isLockEnabled && pending('lock-access required')
if (sessionStoreStrategy.isLockEnabled) {
pending('lock-access required')
}
})

it('should persist session when process returns a value', () => {
Expand Down Expand Up @@ -99,7 +101,9 @@ const EXPIRED_SESSION: SessionState = { isExpired: '1' }

describe('with lock access enabled', () => {
beforeEach(() => {
!sessionStoreStrategy.isLockEnabled && pending('lock-access not enabled')
if (!sessionStoreStrategy.isLockEnabled) {
pending('lock-access not enabled')
}
})

it('should persist session when process returns a value', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,11 @@ export function processSessionStoreOperations(
expireSession()
} else {
expandSessionState(processedSession)
isLockEnabled ? persistWithLock(processedSession) : persistSession(processedSession)
if (isLockEnabled) {
persistWithLock(processedSession)
} else {
persistSession(processedSession)
}
}
}
if (isLockEnabled) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ describe('trackInteractionToNextPaint', () => {
setViewEnd = interactionToNextPaintTracking.setViewEnd

registerCleanupTask(() => {
interactionToNextPaintTracking.stop
interactionToNextPaintTracking.stop()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👏 praise: ‏ nice catch!

resetExperimentalFeatures()
interactionCountMock.clear()
})
Expand Down
Loading