Skip to content

Commit

Permalink
chore(mono): update lint to enforce notify hook usage
Browse files Browse the repository at this point in the history
Enforce the usage of the "useNotifyX" wrapper around the equivalent HTTP hook if the wrapper exists.
  • Loading branch information
mjhuff committed Apr 25, 2024
1 parent f6099c4 commit 1846117
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,27 @@ module.exports = {
'no-case-declarations': 'warn',
'prefer-regex-literals': 'warn',
'react/prop-types': 'warn',

// Notification migration hooks
'no-restricted-imports': [
'error',
{
paths: [
{
name: '@opentrons/react-api-client',
importNames: [
'useAllRunsQuery',
'useRunQuery',
'useLastRunCommandKey',
'useCurrentMaintenanceRun',
'useDeckConfigurationQuery',
],
message:
'The HTTP hook is deprecated. Utilize the equivalent notification wrapper (useNotifyX) instead.',
},
],
},
],
},

globals: {},
Expand Down Expand Up @@ -137,5 +158,12 @@ module.exports = {
'cypress/unsafe-to-chain-command': 'warn',
},
},
// Allow HTTP hooks in notification wrappers and tests
{
files: ['app/src/resources/**', '**/__tests__/**test**'],
rules: {
'no-restricted-imports': 'off',
},
},
],
}

0 comments on commit 1846117

Please sign in to comment.