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/stylelint-formatter-gitlab

v1.0.2

Published

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

Downloads

18,165

Readme

Stylelint Gitlab Codequality Formatter

Latest Release Coverage Badge Codacy Code Quality Badge Conventional Commits

Formatter that transforms Stylelint 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 stylelint and @gitlab-formatters/stylelint-formatter-gitlab using your package manager:

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

To use in your project, simply run:

npx stylelint . --custom-formatter=@gitlab-formatters/stylelint-formatter-gitlab

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

stylelint:
  image: node:20.14.0-alpine3.20
  stage: codequality
  script:
    - npm ci
    - npx stylelint . --custom-formatter=@gitlab-formatters/stylelint-formatter-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": "unit-no-unknown",
    "description": "Unexpected unknown unit \"pp\" (unit-no-unknown)",
    "content": {
      "body": "Error found in unit-no-unknown. See https://stylelint.io/user-guide/rules/unit-no-unknown for more details."
    },
    "categories": [
      "Style"
    ],
    "location": {
      "path": "src/app.module.scss",
      "lines": {
        "begin": 2,
        "end": 2
      },
      "positions": {
        "begin": {
          "line": 2,
          "column": 14
        },
        "end": {
          "line": 2,
          "column": 16
        }
      }
    },
    "severity": "major",
    "fingerprint": "d87ffdeffd6374e748011a709a4d648a"
  }
]

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

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

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: