Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

False alarm of 'disallowSpacesInsideAttributeBrackets' for multiline statements #181

Open
TokugawaTakeshi opened this issue Feb 23, 2021 · 0 comments

Comments

@TokugawaTakeshi
Copy link

TokugawaTakeshi commented Feb 23, 2021

Documentation:

Disallows space after opening attribute bracket and before closing.

//- Invalid
input( type='text' name='name' value='value' )

//- Valid
input(type='text' name='name' value='value')

If the rule disallowSpacesInsideAttributeBrackets aims on multiline declarations too, it's not obvious.

Live example:

mixin AttentionBox(propertiesObject)

  include AttentionBox-ComponentPropertiesSpecification

  -
    const {
      semanticType,
      CSS_Namespace,
      hasDefaultPrependedSVG_Icon,
      hasDismissButton
    } = MixinParametersValidator.getValidatedParameters(propertiesObject, AttentionBoxComponentPropertiesSpecification);

  div&attributes(attributes)(
    class= CSS_Namespace
    class= `${CSS_Namespace}${BEM_MODIFIER_SEPARATOR}${AttentionBox.SemanticTypesCSS_Modifiers[semanticType]}`
    role="alert"
  )

    if hasDefaultPrependedSVG_Icon
      svg(class=`${CSS_Namespace}${BEM_ELEMENT_SEPARATOR}PrependedSVG_Icon` viewBox="0 0 24 24")
        case semanticType
          when AttentionBox.SemanticTypes.importantInfo
            path(
              d="M13,13H11V7H13M13,17H11V15H13M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2Z"
            )
          when AttentionBox.SemanticTypes.secondaryInfo
            path(d="M13 14H11V9H13M13 18H11V16H13M1 21H23L12 2L1 21Z")
          when AttentionBox.SemanticTypes.error
            path(
              d="M13,13H11V7H13M13,17H11V15H13M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2Z"
            )
          when AttentionBox.SemanticTypes.warning
            path(d="M13 14H11V9H13M13 18H11V16H13M1 21H23L12 2L1 21Z")

image

I tried that

            path(
              d="M13,13H11V7H13M13,17H11V15H13M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2Z"
)

is a valid Pug syntax, but subjectively it makes code formatting ugly. I don't think that everyone wants this rule warn for multiline statements...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant