Skip to content

Commit

Permalink
(chore) Flag duplicate imports
Browse files Browse the repository at this point in the history
This PR adds the [ESLint import plugin](https://github.com/import-js/eslint-plugin-import) and configures it to flag duplicate imports.
  • Loading branch information
denniskigen committed Nov 13, 2024
1 parent 565a949 commit 7158055
Show file tree
Hide file tree
Showing 4 changed files with 799 additions and 7 deletions.
5 changes: 3 additions & 2 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@
"plugin:testing-library/react"
],
"parser": "@typescript-eslint/parser",
"plugins": ["@typescript-eslint", "jest-dom", "react-hooks", "testing-library"],
"plugins": ["@typescript-eslint", "import", "jest-dom", "react-hooks", "testing-library"],
"rules": {
"import/no-duplicates": "error",
"react-hooks/rules-of-hooks": "error",
// Disabling these rules for now just to keep the diff small. I'll enable them one by one as we go.
// Disabling these rules for now just to keep the diff small. We'll enable them one by one as we go.
"@typescript-eslint/ban-ts-comment": "off",
"@typescript-eslint/ban-types": "off",
"@typescript-eslint/no-explicit-any": "off",
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
"dayjs": "^1.8.36",
"dotenv": "^16.0.3",
"eslint": "^8.55.0",
"eslint-plugin-import": "^2.31.0",
"eslint-plugin-jest-dom": "^5.4.0",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-testing-library": "^6.2.2",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import React from 'react';
import { useTranslation } from 'react-i18next';
import { UserAvatarIcon } from '@openmrs/esm-framework';
import { ActionMenuButton, launchWorkspace } from '@openmrs/esm-framework';
import { ActionMenuButton, launchWorkspace, UserAvatarIcon } from '@openmrs/esm-framework';
import type { WardPatientWorkspaceProps } from '../../types';

export default function WardPatientActionButton() {
Expand All @@ -12,7 +11,7 @@ export default function WardPatientActionButton() {
getIcon={(props) => <UserAvatarIcon {...props} />}
label={t('Patient', 'patient')}
iconDescription={t('Patient', 'patient')}
handler={() => launchWorkspace<WardPatientWorkspaceProps>('ward-patient-workspace')}
handler={() => launchWorkspace<WardPatientWorkspaceProps>('ward-patient-workspace')}
type={'ward'}
/>
);
Expand Down
Loading

0 comments on commit 7158055

Please sign in to comment.