We're going to have to re-do the implementation of linting on the front-end.

      The way we had implemented it (globally, applying across all of liferay-portal) was in part dictated by the way the two underlying tools (ESLint and Prettier) deal with globs and with ignore files. Basically, we had to use the lowest-common-denominator configuration that both could understand, because liferay-npm-scripts (and csf before that) have always expected a single glob configuration to apply to all source (the rationale there being that if you care about "fixing" your source, you want to fix all of it, not just some of it).

      The different glob and ignore semantics though, along with the fact that we had some self-imposed different internal criteria for linting and formatting (ie. that we wanted to format everything but only lint "modern" js), meant that we had to jump through some hoops in order to get the tools working together, and working correctly from the top level and when run from individual projects. And on top of that we wanted editors/IDEs to do a reasonable thing based on what were necessarily magical and dynamic config files.

      We got it working, but all of this meant that in CI we would do a global lint run on all matching files. This was deemed unacceptable, so was removed from CI runs. Sadly, this means that in order to run on "< N" files instead of "N" files, we are now running on 0 files (it could be argued that we're making the wrong trade-off there).

      In order to start linting "> 0" files again, we are going to have to make some concessions. Step 1 will be to figure out the details, but my suspicion is that the solution is going to look like this:

      • Roll our own globbing and ignore logic.
      • Make liferay-npm-scripts pass explicit paths to ESLint and Prettier (might involve switching to API-based invocation instead of CLI-based invocation, in order to avoid exceeding argument list length limits).
      • Evaluate whether the approximation of editor/IDE integration can keep working.




            brian.chan Brian Chan
            greg.hurrell Greg Hurrell (Inactive)
            Recent user:
            Jason Pince
            Participants of an Issue:
            0 Vote for this issue
            0 Start watching this issue




                Version Package