Skip to content

Enhance validate-token plugin of stylelint-bezier #2467

Description

@yangwooseong

Description

validate-token 플러그인을 개선합니다.

Reasons for suggestion

현재 css variable에 기본값을 넣으면 린트에 걸리고 있습니다. bezier-token 을 사용하는지 아닌지를 검사하는 것이 목적이기 때문에 기본값 사용을 허용해야 합니다.

Proposed solution

  1. css variable 안에 기본값을 포함하는 것을 허용합니다. 지금은 아래처럼 기본값을 넣으면 린트에 걸립니다.
image
  1. 에러 메시지에 ignorePrefix에 대한 정보를 추가합니다. 위 예의 경우는
    Invalid token: "token-name". Use tokens from @channel.io/bezier-tokens, or add some prefix to "ignorePrefix" of plugin option. (bezier/validate-token)Stylelint(bezier/validate-token) 정도라면 좋을 것 같습니다.

  2. 테스트 코드를 추가해서 체크가 통과하는 경우와 실패하는 경우를 명확히 알게 합니다. bezier-token을 import 하고 있지만 validate(value, option, tokens) 같은 함수를 분리한다면 충분히 테스트 코드 작성이 가능할 것 같습니다.

References

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueIssue that good for newcomersstylelint-bezierIssue of PR related to stylelint-bezier

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions