search

Home  >  Q&A  >  body text

javascript - eslinit rules--the first line of the block statement must be empty and the end of the line must not be empty.

How to set "the first line of the block statement is empty and the end of the line is not empty" in the eslint rules?

padded-blocks

padded-blocks seems to only be able to set all blank lines, or no blank lines

阿神阿神2752 days ago685

reply all(1)I'll reply

  • 漂亮男人

    漂亮男人2017-05-19 10:42:05

    Only blank lines and non-blank lines can be set in ordinary {} block-level statements

    { "blocks": "always" }//或者{ "blocks": "never" }

    Other setting methods will ignore the general {} and only use the block-level statements of special methods, such as:

    { "classes": "always" }//只管class中的constructor{}前后是否空行
    { "switches": "always" }//只管switch里case前后空行

    But no matter which way it is, setting a blank line at the beginning of the line alone will not work

    reply
    0
  • Cancelreply