commitlint | 📓 Lint commit messages | Code Analyzer library

 by   conventional-changelog TypeScript Version: 19.3.0 License: MIT

kandi X-RAY | commitlint Summary

kandi X-RAY | commitlint Summary

commitlint is a TypeScript library typically used in Code Quality, Code Analyzer, Nodejs applications. commitlint has no bugs, it has no vulnerabilities, it has a Permissive License and it has medium support. You can download it from GitHub.

Demo generated with svg-term-cli cat docs/assets/commitlint.json | svg-term --out docs/assets/commitlint.svg --frame --profile=Seti --height=20 --width=80.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              commitlint has a medium active ecosystem.
              It has 13899 star(s) with 836 fork(s). There are 62 watchers for this library.
              There were 10 major release(s) in the last 12 months.
              There are 131 open issues and 397 have been closed. On average issues are closed in 119 days. There are 16 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of commitlint is 19.3.0

            kandi-Quality Quality

              commitlint has 0 bugs and 0 code smells.

            kandi-Security Security

              commitlint has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              commitlint code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              commitlint is licensed under the MIT License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              commitlint releases are available to install and integrate.
              Installation instructions, examples and code snippets are available.
              It has 139 lines of code, 0 functions and 339 files.
              It has low code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of commitlint
            Get all kandi verified functions for this library.

            commitlint Key Features

            No Key Features are available at this moment for commitlint.

            commitlint Examples and Code Snippets

            copy iconCopy
            npm i -D husky lint-staged @commitlint/cli @commitlint/config-conventional commitizen cz-customizable @commitlint/config-lerna-scopes commitlint-config-gitmoji standard-version cross-env
            
            touch commitlint.config.js
            
            const czConfig = require('./.cz-co  
            copy iconCopy
            import type { UserConfig } from '@commitlint/types'
            import commitizenConfig from './.cz-config.js'
            
            const Configuration: UserConfig = {
              extends: ['@commitlint/config-conventional'],
              rules: {
                'type-enum': [2, 'always', commitizenConfig.types.m  
            danger-plugin-conventional-commitlint,Usage
            TypeScriptdot img3Lines of Code : 12dot img3License : Strong Copyleft (GPL-3.0)
            copy iconCopy
            npm install --save-dev danger-plugin-conventional-commitlint
            
            // dangerfile.js
            import commitlint from 'danger-plugin-conventional-commitlint'
            import configConventional from '@commitlint/config-conventional';
            
            (async function dangerReport() {
            
              const  
            How to setup lint-staged for Vue projects?
            JavaScriptdot img4Lines of Code : 19dot img4License : Strong Copyleft (CC BY-SA 4.0)
            copy iconCopy
            "scripts": {
              "lint:js": "eslint . --ext .js,.vue",
              "lint:js:fix": "eslint --ext .js,.vue --fix",
            },
            
            {
              "**/*.{js,vue}": ["npm run lint:js:fix"]
            }
            
            #!/bin/sh
            . "$(dirname "$0")/_/husky.s

            Community Discussions

            QUESTION

            An unhandled exception occurred: The requested module 'sourcemap-codec' does not provide an export named 'decode'
            Asked 2022-Mar-03 at 14:48

            On Upgrading, to angular 13, My build step on pipeline is failing. My initial version was 11, on upgrading to 12 the build worked fine but on upgrading from 12 to 13, it started giving me this error on pipeline. The build is running fine on local but failing on pipeline.

            I have also added the package.json file code and dependencies and also added the image that displays error.

            ...

            ANSWER

            Answered 2022-Mar-03 at 14:48

            I was facing the same issue which is why I stumbled across this post.

            My issue was I was using the wrong node version. I faced a similar issue after upgrading to Angular 13 but I was using node version v14.2.0.

            I changed the node version to v14.15.0 and it worked.

            nvm use v14.15.0

            PS: NVM manages multiple nodejs versions.

            Source https://stackoverflow.com/questions/71331825

            QUESTION

            Customise commitlint header format
            Asked 2022-Jan-10 at 07:48

            I am using Husky to set my git hooks, and am trying to change to default format of the header expected by Commitlint:

            ...

            ANSWER

            Answered 2022-Jan-10 at 07:48

            This should work for :gitmoji:? [scope] subject

            Source https://stackoverflow.com/questions/70521236

            QUESTION

            Is it possible to automate .Net assembly versioning using semantic-release?
            Asked 2021-Dec-31 at 12:45

            I have a C# solution containing a single project and multiple libraries using .Net 6. I'm using conventional commits (commitlint with husky) and want to use semantic-release to deploy the latest build as a ZIP file on Github based on the commit messages.

            The setup I tried for C# projects:

            • Install packages

            .

            ...

            ANSWER

            Answered 2021-Dec-31 at 12:45

            You could dry-run semantic-release before dotnet publish to fetch the version number of the release (using the @semantic-release/exec plugin). Then pass this fetched version number to dotnet publish:

            Add the @semantic-release/exec plugin to your npm install commands and adjust your .releaserc.json file to store the next release version (for example in an environment variable):

            Source https://stackoverflow.com/questions/70480421

            QUESTION

            How to setup lint-staged for Vue projects?
            Asked 2021-Dec-30 at 10:10

            I created a new Vue3 app using the Vue CLI and selected Prettier for my linter config. I want to use commitlint, husky and lint-staged to validate commit messages and lint the code before pushing it.

            What I did

            Based on https://commitlint.js.org/#/guides-local-setup I setup commitlint with husky

            ...

            ANSWER

            Answered 2021-Dec-30 at 10:10
            Update regarding the comments Other lint-staged syntaxes

            I've suggested "**/*.{js,vue}": ["npm run lint:js:fix"], first of, lint:js:fix is subjective and up to you. This is what Kent C Dodds is using, so I'm just naming it in the same way.

            But you could totally have lint:watermelon-potato-hehe instead, doesn't matter.

            Now, about your propositions:

            1. "**/*.{vue,js,jsx,ts,tsx}": "npm run lint", this one is targeting more extensions, which is totally fine. You may not really use .tsx/.jsx since it's not really popular among Vue devs.
              About .ts itself, it may probably work good enough (maybe you'll need to add some plugins to your ESlint configuration). I'm not into TS so I can't really help on this one but it's out of the husky/lint-staged scope anyway.
              Last time I started a Vue3 project, I've used Vitesse which has some nice defaults with TS, this may be a good start for you maybe.

            As for the second part, since I like to setup my own ESlint config, with some simple and well documented API, we're using eslint --ext .js,.vue --fix. That way I'm sure of what is happening and how to troubleshoot it if needed.
            vue-cli-service lint may be a good default package aimed towards Vue with some defaults, I'm not sure what's inside it and even if it's probably just an ESlint with some baked-in configuration, again we prefer to make our own Vue configuration with vanilla ESlint.

            So yeah, if you need to go fast, use vue-cli-service lint for some quick linting, if you want to have a better flow in your project and want to fine grain your config, use vanilla ESlint, you'll get less trouble overall IMO.

            1. "**/*.{vue,js,jsx,ts,tsx}": "eslint --ext .vue,.js,.jsx,.ts,.tsx --fix". On the right side, we globally have the same lint:js:fix scripts but with additional extensions.

            So, you may ask why are we even writing the extensions on the left side for lint-staged and on the right side for lint:js:fix? I'd answer that those are not really needed on the right side (AFAIK), because lint-staged will only run the command to the left list of extensions.
            Here, we wanted to be more explicit about the exact extensions we're targeting and also, it enables you to run npm run lint:js:fix in your CLI at any given point without getting errors on files ESlint is not handling (.txt, .json, .md, .jpg etc...).
            So it could maybe be removed (not sure), fastest way to be sure is to try!

            1. "**/*.{vue,js,jsx,ts,tsx}": "eslint --fix", this one may work fine as explained in the previous paragraph. Didn't tried it myself thought.
            What about the other extensions?

            Regarding .html, you should not have a lot of those in your Vue project. You could use the W3C validator to check for any errors if you really need it.
            If you're speaking about your HTML in the template tags in your .vue files, those will be ESlint'ed properly. If you setup a Prettier on top of it, you will also get some nice auto-formatting which is really awesome to work with (once your team has agreed on a .prettierrc config).

            Regarding .json files, those are not handled by ESlint. ESlint is only for JavaScript-ish files. If you want to lint/format your .json or even any other extensions at all, you can aim towards NPM, find a package that suits your team's needs and add it to your chain like "**/*.json": ["npm run lint-my-json-please"] and you should be good!

            At the end, husky + lint-staged are not doing anything special really. They are tools to automate what you could write yourself in a CLI, so if it's working when done manually and you're happy with the result, you can put it in your config but you need to first found what the proper package and it's configuration.

            In your package.json, you could have the following

            Source https://stackoverflow.com/questions/70494159

            QUESTION

            How to add the build files as an asset to a release in Github?
            Asked 2021-Nov-06 at 07:15

            I have a project based on Node/npm and use commitlint, husky and semantic-release. Whenever I push to the protected main branch I want to create a new release.

            In Github I added the following workflow

            ...

            ANSWER

            Answered 2021-Nov-06 at 07:15

            You need to configure the semantic-release github-plugin using the configuration file

            The CLI uses some default configuration, and if you need a custom config you will have to create an entire config from scratch (as far as I know).

            Create a file called release.config.js in the root project folder:

            Source https://stackoverflow.com/questions/69841763

            QUESTION

            Strange error when attempting to commit. [subject-empty]
            Asked 2021-Jul-05 at 21:10

            I type this into the CLI

            ...

            ANSWER

            Answered 2021-Jul-05 at 21:10

            I fixed this problem with "npm uninstall husky"

            Source https://stackoverflow.com/questions/68261650

            QUESTION

            CommitLint in yarn v2
            Asked 2021-Jun-10 at 07:53

            there. I'm trying to set CommitLint and husky in my project with yarn 2 but when I commit, I ran to this problem. Is there any way to fix this? I've tried using 3 commands below:

            • npx --no-install commitlint --edit "$1"
            • yarn --no-install commitlint --edit "$1"
            • yarn run --no-install commitlint --edit "$1"

            I'm using Mac OS X 10.11.6 with Node 14 LTS. My repo is on GitLab (have to bypass the commitlint check)

            Using npx
            Using yarn
            Using yarn run

            ...

            ANSWER

            Answered 2021-Jun-10 at 07:53

            I've checked this with CommitLint Devs. He said that currently it isn't supported. You can have a look here. And there is a note on the website, too

            Source https://stackoverflow.com/questions/67867149

            QUESTION

            How to use dotnet format to format the whole project inside a subfolder?
            Asked 2021-May-25 at 19:02

            I have a .Net 5 app and want to use dotnet format. First I added commitlint, husky and lint-staged to the repository. The folder structure looks like

            ...

            ANSWER

            Answered 2021-May-25 at 19:02

            You need to check your version of dotnet format. I the new version - v5.1.22507 the feature of format run on solution filter using - dotnet format solution.slnf.

            This will not work prior to the above version.

            please refer the github page.

            Source https://stackoverflow.com/questions/67546915

            QUESTION

            How to run commitlint in GitHub workflow on every commit of a push
            Asked 2021-May-03 at 18:24

            I have a Github repository, installed commitlint and husky locally and would like to setup a workflow running commitlint on every commit of a push when validating pull requests. On the main branch older commits are not following the conventional commit rules.

            I created a separate branch, based on this comment

            https://github.com/conventional-changelog/commitlint/issues/586#issuecomment-657226800

            I started with this workflow

            ...

            ANSWER

            Answered 2021-May-03 at 18:24

            git rev-list is considered because the commit of the pull request (PR) seems invalid. No loop should be required.

            This issue hints to checkout the PR branch which seems simpler than fetching the PR commits. From the question, testing on default branch does not seem required.

            Source https://stackoverflow.com/questions/67307001

            QUESTION

            Angular 11 is not running ngcc
            Asked 2021-Apr-19 at 19:46

            I have an old Angular application, which I have upgraded from Angular 9 to Angular 11. (It had many stable upgrades throughout the years, starting from Angular 2)

            My problem is, that the ngcc is not running ng build:

            ...

            ANSWER

            Answered 2021-Feb-03 at 14:10

            My problem was that an another tsconfig file was overwriting the root's definitions, and turned off ivy and ngcc altogether.

            sr5c/tsconfig.app.json:

            Source https://stackoverflow.com/questions/65901974

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install commitlint

            To lint commits before they are created you can use Husky's commit-msg hook:. Check the husky documentation on how you can automatically have Git hooks enabled after install for different yarn versions.
            Local setup - Lint messages on commit with husky
            CI setup - Lint messages during CI builds
            For more information on how to contribute please take a look at our contribution guide.

            Support

            Node.js LTS >= 12git >= 2.13.2
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            Install
          • npm

            npm i commitlint

          • CLONE
          • HTTPS

            https://github.com/conventional-changelog/commitlint.git

          • CLI

            gh repo clone conventional-changelog/commitlint

          • sshUrl

            git@github.com:conventional-changelog/commitlint.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link

            Explore Related Topics

            Consider Popular Code Analyzer Libraries

            javascript

            by airbnb

            standard

            by standard

            eslint

            by eslint

            tools

            by rome

            mypy

            by python

            Try Top Libraries by conventional-changelog

            standard-version

            by conventional-changelogJavaScript

            conventional-changelog

            by conventional-changelogJavaScript

            releaser-tools

            by conventional-changelogJavaScript

            conventional-changelog-config-spec

            by conventional-changelogJavaScript

            conventional-commits-detector

            by conventional-changelogJavaScript