paragon icon indicating copy to clipboard operation
paragon copied to clipboard

add `lint:fix` to package.json

Open brian-smith-tcril opened this issue 1 year ago • 5 comments

We have this in frontend-template-application https://github.com/openedx/frontend-template-application/blob/984c19a3a617c2686fbdb412c6eec637d3725ccf/package.json#L16.

It'd be nice to be able to tell people who have lint errors on their PR to try running npm run lint:fix to quickly resolve lint issues.

brian-smith-tcril avatar Aug 09 '23 15:08 brian-smith-tcril

Good idea to have! Also, perhaps as a separate task, we may want to have improved documentation (in the README?) around what NPM scripts exist for this repo (that's a lot now 😄).

adamstankiewicz avatar Aug 09 '23 16:08 adamstankiewicz

@brian-smith-tcril Secondary thought, are you aware of any tooling in place to ensure common NPM scripts exist on repos? Similar to how PRs automatically open to add missing standard GitHub action workflows, etc.

Maybe thats a level of standardization too far, but I could see some script automatically running to open a PR to add a lint:fix script to JS repos that don't have it. Beyond this, or now that we're introducing a Paragon CLI to more easily work with custom @edx/brand packages during local development, it'd be great to more automatically add/maintain the following NPM scripts to save needing to manually go through each repo ourselves:

{
  "scripts": {
    "start:with-theme": "paragon install-theme && npm start",
    "build:with-theme": "paragon install-theme && npm run build",
  }
}

Food for thought. Not sure if the juice is worth the squeeze to build out such automated tooling for modifying repo's common configured NPM scripts.

adamstankiewicz avatar Aug 09 '23 16:08 adamstankiewicz

are you aware of any tooling in place to ensure common NPM scripts exist on repos?

not off the top of my head, it does seem like something we could include in a github action similar to the one we discussed adding for dependency checks

brian-smith-tcril avatar Aug 09 '23 18:08 brian-smith-tcril

we may want to have improved documentation (in the README?) around what NPM scripts exist for this repo (that's a lot now ).

good call https://github.com/openedx/paragon/issues/2515

brian-smith-tcril avatar Aug 09 '23 19:08 brian-smith-tcril

This is a great idea, thanks Brian! I admit, I manually add parameters for fixing before I need to run the linter :)

As an additional point, should we add a separate command to lint the www directory? I periodically remove www from .eslintignore in order to check the code and fix problems.

PKulkoRaccoonGang avatar Aug 07 '24 05:08 PKulkoRaccoonGang