multiline-comment-style

对多行注释强制使用特定样式

一些该规则报告的问题可以通过 --fix 命令行选项 自动修复

许多样式指南要求跨多行注释的特定样式。例如,一些样式指南更喜欢对多行注释使用单个块注释,而其他样式指南更喜欢连续行注释。

规则详情

此规则旨在为多行注释强制执行特定样式。

选项

此规则有一个字符串选项,它可以具有以下值之一:

    dSg4CA2x+kwrsHjIzxby5DTJN9+EkxJTzyIZwiP20d1GO2bhEX0QK0ZMwIgs8nGMp0PQuNoaFEuJmy+rXPd++uubULUfHBAny1JyNVJXxm5JHrcXsK+rPUtv//mMPTxWEEvM3HiSdp+rJxSNbcx9RQTN89oHETIIj59HfN7xIjA++JDC+S4Pjhs2p1tKwqvUio8qSoHxAyi+VGjzaXajHv3NicC5YI1E5yS0aKNoT4vJhnTPEuNen91TQ8bRDcPeS2wY+jAADAqHeNKTIKmydPd3zGbTS9VvwRaF5b+siA1xwkPFEgzq3udSmUJB8E9NJslVZiERq+4LhfYWYic0iVQIUhl8Cjv8RGa6X1lGDJrd28TV4o444sjKx1IDwP7zaHnnGMyh8HwizWP+BEM2LaEZgvbm2aG24QstvMOg+sJ3qWQ4RLTDkLIvSZZLp/nff6z7RDyMDIrg6I50YdwNMeitjpN9GlIM0ddIWmPpHUObT0L6BStFZosDcxOYHPvPTLzzN3/aNwfeXQOiiFs2A7bW/7UvE3BPX5GHC31fymrbFRggWrk/NesZzQ8VrS8h

4XRvqx3pRKiYebfOPjG7HyJXfvjfCqCnh1CyK22MeO/OAFZyTA1M+16xA4I2/wgkhAy4pngmA+K0cXM3r3N7oVIDvxeM2rA2GzK8G8vP2sPqzIABXAyLMeA+VLZuFXLjQLb3HzsW8l4JXEfE8dMU3hZyvWa/9roo89fnTGdh7m0FE+VhBfaafctLLO3DjihvS/Zy5f7T+ub5G14H2GVHeouGiUD4wzldQj9u6Ihbf1I=

vGUxWBhIHkIwFaCplge825PSfNpZn64vYmqrZDJptdSiMcp8uquze33CVztjGxiaK3fo58/Kc3Pgaz1qJ9ZsKuj1dT2GZhQINBs8HxCiwjZisgKzSQbgP3LLVWpvVOLv


/* eslint multiline-comment-style: ["error", "starred-block"] */

// this line
// calls foo()
foo();

/* this line
calls foo() */
foo();

/* this comment
 * is missing a newline after /*
 */

/*
 * this comment
 * is missing a newline at the end */

/*
* the star in this line should have a space before it
 */

/*
 * the star on the following line should have a space before it
*/

vGUxWBhIHkIwFaCplge825PSfNpZn64vYmqrZDJptdSiMcp8uquze33CVztjGxiadLVG+JrSp3I1nDeWKiZddcqYHeGwWeiQoK/pZrTOupgdY7N2/ZT5NwFjCd1SXn4u

/* eslint multiline-comment-style: ["error", "starred-block"] */

/*
 * this line
 * calls foo()
 */
foo();

// single-line comment

qVCMgjR5tKUNSBmRY5fDOQx59n5+dtU72WiZ6mZe/vJvXeoinEG0NTEYOlepX0p/4XEuwYDCBn0R4wnQAHxYjDYUVk21y8og+Z2yPh9NMys=

/* eslint multiline-comment-style: ["error", "bare-block"] */

// this line
// calls foo()
foo();

/*
 * this line
 * calls foo()
 */
foo();

qVCMgjR5tKUNSBmRY5fDOQx59n5+dtU72WiZ6mZe/vJvXeoinEG0NTEYOlepX0p/CS4UVdMoCUaDlTlRLvYS1Pk42BZhyjYXzoTxP0VJrjs=

/* eslint multiline-comment-style: ["error", "bare-block"] */

/* this line
   calls foo() */
foo();

qVCMgjR5tKUNSBmRY5fDOdM8f1JgTb7Qls5HmcTdPGcjnZ8TCMLfclx3B7QsUz8uzgDGtkROatl2fNsQ8aKm1pHw9n1igyl7f1PBRmyqyh4=


/* eslint multiline-comment-style: ["error", "separate-lines"] */

/* This line
calls foo() */
foo();

/*
 * This line
 * calls foo()
 */
foo();

qVCMgjR5tKUNSBmRY5fDOdM8f1JgTb7Qls5HmcTdPGcjnZ8TCMLfclx3B7QsUz8uY2DcB8ejPzL/KV5D5clVdCP5MC3XejDrMqUvKkUbitU=

/* eslint multiline-comment-style: ["error", "separate-lines"] */

// This line
// calls foo()
foo();

何时不使用

ZlRMXl4iHlx7Y7ULD3P1h/27AU4Cw9nIvbhpGWfpvR8pn4KjPRKKUG1ohUp9qOiZhoiqvwLumRQxTuaYQHdn4XprI2TA46d5Sbx2QIjF6T0sLcz+qsJ41N/Fn/Jv4i/j