Skip to content

Make error (position) more visible in output #633

@byCedric

Description

@byCedric

Expected Behavior

This is an improvement I did not make by myself. I got the as great in-person feedback from @satya164, did not forget about you ❤️

So right now, it's sometimes hard to pinpoint the exact cause of a violated rule. Luckily, we are not the only one with this problem. Every compiler have a similar feature already implemented, take TypeScript for example:

Screenshot 2019-04-26 at 21 10 46

This red squiggly line you see in the picture actually points to the problematic area.

I think it would definitely help readability (and therefore usability) if we add similar functionality. But, I feel we have to "pimp" the rules API for this to work properly. Think of something like:

$ echo 'foo: this is a normal commit with wrong type' | npx commitlint                                                                                                                                                      [577ca5d] × 21:10

⧗   input: foo: this is a normal commit with wrong type
           ~~~
✖   type must be one of [feature, fix, test, performance, documentation, pipeline, style, refactor, release, chore] [type-enum]
✖   found 1 problems, 0 warnings
    (Need help? -> https://github.com/conventional-changelog/commitlint#what-is-commitlint )

Current Behavior

Affected packages

  • cli
  • core
  • prompt
  • config-angular

Possible Solution

Steps to Reproduce (for bugs)

Context

Your Environment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions