Skip to content

Commit

Permalink
Fix the lint check job
Browse files Browse the repository at this point in the history
  • Loading branch information
vasharma05 committed Jan 2, 2025
1 parent e9762fa commit c121358
Show file tree
Hide file tree
Showing 5 changed files with 1,093 additions and 19 deletions.
23 changes: 19 additions & 4 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,22 @@
"env": {
"node": true
},
"extends": ["eslint:recommended", "plugin:@typescript-eslint/recommended"],
"extends": ["eslint:recommended", "plugin:@typescript-eslint/recommended", "plugin:jest-dom/recommended"],
"parser": "@typescript-eslint/parser",
"plugins": ["@typescript-eslint", "react-hooks"],
"root": true,
"plugins": ["@typescript-eslint", "import", "jest-dom", "react-hooks", "testing-library"],
"overrides": [
{
"files": ["**/*.test.tsx"],
"extends": ["plugin:testing-library/react"]
},
{
"files": ["e2e/**/*.spec.ts"],
"extends": ["plugin:playwright/recommended"],
"rules": {
"testing-library/prefer-screen-queries": "off"
}
}
],
"rules": {
"react-hooks/exhaustive-deps": "warn",
"react-hooks/rules-of-hooks": "error",
Expand All @@ -22,6 +34,7 @@
"fixStyle": "inline-type-imports"
}
],
"import/no-duplicates": "error",
"prefer-const": "off",
"no-console": ["error", { "allow": ["warn", "error"] }],
"no-unsafe-optional-chaining": "off",
Expand All @@ -33,6 +46,7 @@
"error",
{
"paths": [
// These two rules ensure that we're importing lodash and lodash-es correctly. Not doing so can bloat our bundle size significantly.
{
"name": "lodash",
"message": "Import specific methods from `lodash`. e.g. `import map from 'lodash/map'`"
Expand All @@ -42,6 +56,7 @@
"importNames": ["default"],
"message": "Import specific methods from `lodash-es`. e.g. `import { map } from 'lodash-es'`"
},
// These two rules ensure that we're importing Carbon components and icons from the correct packages (after v10). May be removed in the future.
{
"name": "carbon-components-react",
"message": "Import from `@carbon/react` directly. e.g. `import { Toggle } from '@carbon/react'`"
Expand All @@ -54,4 +69,4 @@
}
]
}
}
}
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,12 @@
"dotenv": "^16.0.3",
"eslint": "^8.50.0",
"eslint-config-prettier": "^8.8.0",
"eslint-plugin-import": "^2.31.0",
"eslint-plugin-jest-dom": "^5.4.0",
"eslint-plugin-playwright": "^2.1.0",
"eslint-plugin-prettier": "^5.1.3",
"eslint-plugin-react-hooks": "^4.6.2",
"eslint-plugin-testing-library": "^7.1.1",
"husky": "^8.0.3",
"i18next": "^23.2.8",
"i18next-parser": "^9.0.2",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import { OverflowMenuItem } from '@carbon/react';
import { useLaunchWorkspaceRequiringVisit, useOrderBasket, type Order } from '@openmrs/esm-patient-common-lib';
import React from 'react';
import { Layer, OverflowMenu, OverflowMenuItem } from '@carbon/react';
import { useLaunchWorkspaceRequiringVisit, useOrderBasket, type Order } from '@openmrs/esm-patient-common-lib';
import { type MedicalSupplyOrderBasketItem } from '../types';
import { buildMedicalSupplyOrderItem } from '../resources';
import { useTranslation } from 'react-i18next';
import { OverflowMenu } from '@carbon/react';
import { Layer } from '@carbon/react';

interface ModifyMedicalSupplyOrderMenuItemProps {
orderItem: Order;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ import {
Grid,
InlineNotification,
Layer,
NumberInput,
SelectSkeleton,
TextArea,
TextInput,
} from '@carbon/react';
Expand All @@ -28,9 +30,6 @@ import styles from './medical-supply-order-form.scss';
import { type Concept, ordersEqual, prepOrderPostData, useQuantityUnits } from '../resources';
import { moduleName } from '../../constants';
import { type MedicalSupplyOrderBasketItem } from '../types';
import { NumberInput } from '@carbon/react';
import { Select } from '@carbon/react';
import { SelectSkeleton } from '@carbon/react';

export interface OrderFormProps extends DefaultPatientWorkspaceProps {
initialOrder: MedicalSupplyOrderBasketItem;
Expand Down
Loading

0 comments on commit c121358

Please sign in to comment.