Skip to content

Commit

Permalink
(chore) Flag duplicate imports (#358)
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 authored Nov 13, 2024
1 parent 361054e commit 5154c46
Show file tree
Hide file tree
Showing 5 changed files with 223 additions and 13 deletions.
3 changes: 2 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@
"project": true,
"tsconfigRootDir": "__dirname"
},
"plugins": ["@typescript-eslint", "jest-dom", "react-hooks", "testing-library"],
"plugins": ["@typescript-eslint", "import", "react-hooks", "testing-library"],
"root": true,
"rules": {
"import/no-duplicates": "error",
"react-hooks/exhaustive-deps": "warn",
"react-hooks/rules-of-hooks": "error",
// not hugely concerned about accidental implicit type coercions for now https://typescript-eslint.io/rules/no-base-to-string
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@
"@typescript-eslint/parser": "^6.21.0",
"css-loader": "^6.11.0",
"eslint": "^8.57.0",
"eslint-plugin-import": "^2.31.0",
"eslint-plugin-jest-dom": "^5.4.0",
"eslint-plugin-playwright": "^0.16.0",
"eslint-plugin-react-hooks": "^4.6.2",
Expand All @@ -100,7 +101,7 @@
"jest-environment-jsdom": "^29.7.0",
"lint-staged": "^14.0.1",
"openmrs": "next",
"prettier": "^3.2.5",
"prettier": "^3.3.3",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-error-boundary": "^4.0.13",
Expand Down
3 changes: 1 addition & 2 deletions src/components/modals/save-form.modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ import {
updateForm,
uploadSchema,
} from '../../forms.resource';
import type { EncounterType } from '../../types';
import type { Resource, Schema } from '../../types';
import type { EncounterType, Resource, Schema } from '../../types';
import { useEncounterTypes } from '../../hooks/useEncounterTypes';
import { useForm } from '../../hooks/useForm';
import styles from './save-form-modal.scss';
Expand Down
3 changes: 1 addition & 2 deletions src/components/schema-editor/schema-editor.component.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import React, { useState, useEffect, useCallback } from 'react';
import AceEditor from 'react-ace';
import 'ace-builds/webpack-resolver';
import 'ace-builds/src-noconflict/ext-language_tools';
import type { IMarker } from 'react-ace';
import { addCompleter } from 'ace-builds/src-noconflict/ext-language_tools';
import type { IMarker } from 'react-ace';
import { useTranslation } from 'react-i18next';
import { useStandardFormSchema } from '../../hooks/useStandardFormSchema';
import Ajv from 'ajv';
Expand Down
Loading

0 comments on commit 5154c46

Please sign in to comment.