Skip to content

Commit

Permalink
(chore) Flag duplicate imports (#1206)
Browse files Browse the repository at this point in the history
* (chore) Flag duplicate imports

This PR adds the [ESLint import plugin](https://github.com/import-js/eslint-plugin-import) and configures it to flag duplicate imports.

* Fixup
  • Loading branch information
denniskigen authored Nov 13, 2024
1 parent 5760269 commit 2fa66c1
Show file tree
Hide file tree
Showing 5 changed files with 771 additions and 7 deletions.
3 changes: 2 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
},
"extends": ["eslint:recommended", "plugin:@typescript-eslint/recommended"],
"parser": "@typescript-eslint/parser",
"plugins": ["@typescript-eslint", "react-hooks"],
"plugins": ["@typescript-eslint", "import", "react-hooks"],
"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 in a future PR that fixes lint issues.
"@typescript-eslint/ban-ts-comment": "off",
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
"cross-env": "7.0.3",
"dotenv": "^16.0.3",
"eslint": "^8.55.0",
"eslint-plugin-import": "^2.31.0",
"eslint-plugin-react-hooks": "^4.6.2",
"fake-indexeddb": "^4.0.2",
"fork-ts-checker-webpack-plugin": "^7.2.13",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import React from 'react';
import { useTranslation } from 'react-i18next';
import { Button, SwitcherItem } from '@carbon/react';
import { LocationIcon, navigate, useSession } from '@openmrs/esm-framework';
import { Button } from '@carbon/react';
import styles from './change-location-link.scss';
import { SwitcherItem } from '@carbon/react';

const ChangeLocationLink: React.FC = () => {
const { t } = useTranslation();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import React from 'react';
import { useTranslation } from 'react-i18next';
import { Toggle } from '@carbon/react';
import { SwitcherItem, Toggle } from '@carbon/react';
import { Network_3 } from '@carbon/react/icons';
import { getCurrentOfflineMode, setCurrentOfflineMode } from '@openmrs/esm-framework/src/internal';
import styles from './offline-actions-mode-button.scss';
import { SwitcherItem } from '@carbon/react';

function doNotCloseMenu(ev: React.SyntheticEvent) {
ev.stopPropagation();
Expand Down
Loading

0 comments on commit 2fa66c1

Please sign in to comment.