Skip to content

Use artifact generation options in plugin-eslint #1068

@BioPhoton

Description

@BioPhoton

To leverage parallelisation and caching of external tools like Nx we have to adjust the eslint plugin.

Preparations:

  • Pass persist options to runnerConfig.args and the runnerFunction to be able to know the Persist.outputDir in the runner. This enables to write files under ${persist.outputDir}/${PLUGIN_SLUG}/xy.z, similar as the cache.write option
  • Make runner create eslint-report.<count>.json
    • Use --output-path to create .json file (loosing terminal output so we also write before sending)
  • Add artifice artefact generation logic
    • Accept globs for artificePaths
  • Remove additional bin execution and switch to runnerFunction

Implementation:

  • Add artifact options to plugin-eslint
  • lint-json target in projects and nx.json
  • Use Nx run-many to generate eslint-report artifacts
    • Include only relevant projects in plugin-eslint config

Optional:

  • Add Custom reporter to plugint-eslint
    • lint-formatter target in projects and nx.json
    • Use custom reporter in plugint-eslint CP config artifact command
  • move custom formatter into separate repo @code-pushup/eslint-formatter

PoC: #1069

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions