commentPattern

{ "commentPattern": "break[\\s\\w]*omitted" } 选项的正确代码示例:

Examples of correct code for the { "commentPattern": "break[\\s\\w]*omitted" } option:

/*eslint no-fallthrough: ["error", { "commentPattern": "break[\\s\\w]*omitted" }]*/

switch(foo) {
    case 1:
        doSomething();
        // break omitted

    case 2:
        doSomething();
}

switch(foo) {
    case 1:
        doSomething();
        // caution: break is omitted intentionally

    default:
        doSomething();
}