openedx / paragon

💎 An accessible, theme-ready design system built for learning applications and Open edX.
https://paragon-openedx.netlify.app
Apache License 2.0
121 stars 66 forks source link

add `lint:fix` to package.json #2514

Open brian-smith-tcril opened 1 year ago

brian-smith-tcril commented 1 year ago

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.

adamstankiewicz commented 1 year ago

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 commented 1 year ago

@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.

brian-smith-tcril commented 1 year ago

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 commented 1 year ago

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

PKulkoRaccoonGang commented 2 months ago

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.