npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@gitlab-formatters/eslint-formatter-gitlab

v1.0.1

Published

Formatter that transforms ESLint reports into a format suitable for use with GitLab widgets.

Downloads

6,693

Readme

Eslint Gitlab Codequality Formatter

Latest Release Coverage Badge Codacy Code Quality Badge Conventional Commits

Formatter that transforms ESLint reports into a format suitable for use with GitLab widgets.

The source code is hosted on GitLab. Although there is an automatic mirror of this repository on GitHub, all bug reports, feature requests, and merge requests should be submitted through GitLab.

Usage

Install eslint and @gitlab-formatters/eslint-formatter-gitlab using your package manager:

npm install --save-dev eslint @gitlab-formatters/eslint-formatter-gitlab
yarn add --dev eslint @gitlab-formatters/eslint-formatter-gitlab

To use in your project, simply run:

npx eslint . --format=@gitlab-formatters/gitlab

For integration with GitLab CI, add the following to your .gitlab-ci.yml:

eslint:
  image: node:20.14.0-alpine3.20
  stage: codequality
  script:
    - npm ci
    - npx eslint . --format=@gitlab-formatters/gitlab --output-file=gl-codequality.json
  artifacts:
    reports:
      codequality: gl-codequality.json

Report Example

Below is a JSON example of how the formatter reports issues.

This particular example outputs a detailed report that goes beyond the minimal fields required by GitLab's code quality widgets.

While GitLab requires only a subset of fields according to the Gitlab Code Quality specification, this formatter implements the full set of fields as outlined in the Code Climate Issue Data Type specification.

This comprehensive implementation enhances the depth of information available and facilitates better issue tracking and resolution.

[
  {
    "type": "issue",
    "check_name": "import/order",
    "description": "`./app.module` import should occur after import of `@nestjs/mongoose/dist/mongoose-core.module`",
    "content": {
      "body": "Error found in import/order"
    },
    "categories": [
      "Style"
    ],
    "location": {
      "path": "src/cli.ts",
      "lines": {
        "begin": 2,
        "end": 2
      },
      "positions": {
        "begin": {
          "line": 2,
          "column": 1
        },
        "end": {
          "line": 2,
          "column": 42
        }
      }
    },
    "severity": "major",
    "fingerprint": "9209a8c4e2408f83d9dd5063891f4e96"
  }
]

You can see an example of the widget and how errors are displayed in Merge Request #2.

This merge request includes detailed examples and explanations of the widget's functionality, showcasing how it integrates with GitLab to display code quality issues reported by ESLint.

Reviewing this merge request can provide insights into the formatter's capabilities and how it enhances error reporting within GitLab.

Contributing

If you'd like to contribute to this project, please read through CONTRIBUTING.md file.

Changelog

Changelog is automatically generated based on semantic-release and conventional commits.

See the CHANGELOG.md file for detailed lists of changes for each version.

License

MIT License. See the License File for more information.

Contact

If you have any questions or suggestions, feel free to reach out by