-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(chore) Various tooling updates and tweaks #73
Conversation
@@ -1,2 +1 @@ | |||
src/**/*.test.tsx |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's no reason why we shouldn't lint test files.
// Control the line ending. See options at https://github.com/ryanve/eol | ||
|
||
locales: ["en", "am", "es", "fr", "km", "he"], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We only want to extract en
translations and use those as the source of truth. We use the Transifex integration as the source of truth for non English locales.
@@ -4,6 +4,7 @@ | |||
const path = require('path'); | |||
|
|||
module.exports = { | |||
clearMocks: true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So mocks gets automatically cleared between test runs.
}; | ||
}, [ | ||
getValues, | ||
patientCatergory.insuranceScheme, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO: We need to fix this typo in a subsequent commit. It's coming from the config schema so we need to figure out what the blast radius of this change will be beforehand.
{ | ||
"name": "require-billing-modal", | ||
"component": "requirePaymentModal" | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Modals should be registered under the modals
key.
"allowSyntheticDefaultImports": true, | ||
"esModuleInterop": true, | ||
"jsx": "react", | ||
"lib": [ | ||
"dom", | ||
"dom.iterable", | ||
"esnext" | ||
], | ||
"module": "esnext", | ||
"moduleResolution": "node", | ||
"module": "ESNext", | ||
"noEmit": true, | ||
"lib": ["es2022", "dom", "dom.iterable"], | ||
"resolveJsonModule": true, | ||
"skipLibCheck": true, | ||
"target": "esnext" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just reorganized for sanity.
}, | ||
"extends": ["eslint:recommended", "plugin:@typescript-eslint/recommended", "prettier"], | ||
"extends": ["eslint:recommended", "plugin:@typescript-eslint/recommended"], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't we add plugin:jest-dom/recommended
and plugin:testing-library/react
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could. Only reason I didn't is because I want to keep the diff small
"project": true, | ||
"tsconfigRootDir": "__dirname" | ||
}, | ||
"plugins": ["@typescript-eslint", "import", "react-hooks"], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know if its a standard or if we should do it but we have testing-library
added as a plugin in patient-chart and form-builder but not core
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shall we add the import
plugin as well, to flag duplicate imports?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's already in there
import { getBillableServiceUuid } from '../invoice/payments/utils'; | ||
import { type LineItem, type MappedBill } from '../types'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import { type LineItem, type MappedBill } from '../types'; | |
import type { LineItem, MappedBill } from '../types'; |
import { showSnackbar } from '@openmrs/esm-framework'; | ||
import { type LineItem, type MappedBill } from '../types'; | ||
import { type MappedBill } from '../types'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import { type MappedBill } from '../types'; | |
import type { MappedBill } from '../types'; |
Tile, | ||
} from '@carbon/react'; | ||
import { ArrowRight } from '@carbon/react/icons'; | ||
import { useLayoutType, isDesktop, useConfig, usePagination, ErrorState, navigate } from '@openmrs/esm-framework'; | ||
import { EmptyState } from '@openmrs/esm-patient-common-lib'; | ||
import { type BillableService } from '../types/index'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import { type BillableService } from '../types/index'; | |
import type { BillableService } from '../types/index'; |
import { apiBasePath } from '../constants'; | ||
import isEmpty from 'lodash-es/isEmpty'; | ||
import { convertToCurrency } from '../helpers'; | ||
import { type BillabeItem } from '../types'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import { type BillabeItem } from '../types'; | |
import type { BillabeItem } from '../types'; |
@@ -1,6 +1,4 @@ | |||
import { type Payment, type LineItem } from '../types'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import { type Payment, type LineItem } from '../types'; | |
import type { Payment, LineItem } from '../types'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please feel free to ignore the type import suggestions, we can always do them later on if this needs to go in asap!
import { showModal, useConfig, useDebounce } from '@openmrs/esm-framework'; | ||
import { useTranslation } from 'react-i18next'; | ||
import { MappedBill } from '../types'; | ||
import { type MappedBill } from '../types'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import { type MappedBill } from '../types'; | |
import type { MappedBill } from '../types'; |
import { useConfig } from '@openmrs/esm-framework'; | ||
import { MappedBill } from '../../../types'; | ||
import PaymentHistory from './payment-history.component'; | ||
import { type MappedBill } from '../../../types'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import { type MappedBill } from '../../../types'; | |
import type { MappedBill } from '../../../types'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @denniskigen! LGTM! Left some comments of a couple of nitpicks and questions I had about the imports in .eslintrc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
@@ -1,17 +1,39 @@ | |||
{ | |||
"env": { | |||
"node": true, | |||
"browser": true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't this disable global browser-specific variables like console
, window
etc.?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't think so, no. We don't have that elsewhere AFAICT.
Thanks for the reviews |
Requirements
For changes to apps
If applicable
Summary
This PR introduces several improvements to our tooling setup:
Screenshots
Related Issue
Other