I think we need to do both. Because of following reasons.
if we choose 1st method since It will check code style errors in build time locally and a developer can mistakenly add code to main repo with errors.
And we if we go for the 2nd method it will prevent the adding code to main repo with code style errors but it will check only when a developer tries to push the code. So developer can’t check code style error locally.
So My opinion is that do both things. But first I will configure with web pack. Is it ok?
For the eslint- rules I put rules used in openmrs-owa-cohortbuilder. I thought that same rules can be apply to built-in-report module.Any suggestions or modifications @judeniroshan, @dkayiwa?
Good to see your suggestions. I like that having flexibility over both the approaches is a good way to go. Because it will help us to define the strict validations when need. Github check is necessary and we can follow the owa-cohortbuilder which you have already referred.
When I am checking with existing code with eslint I have found this warning inside the router.jsx
Warning Component definition is missing display name, react/display-name
normally this warning occurs when we don’t put names to our components and router.jsx having a function without a name. So I modified router.jsx like this to prevent that warning.