]> git.proxmox.com Git - pve-eslint.git/blobdiff - eslint/docs/src/rules/no-fallthrough.md
import 8.41.0 source
[pve-eslint.git] / eslint / docs / src / rules / no-fallthrough.md
index 7986b8109d006d0b20709a912f35bc9ede7841be..c49293cad4aae0f7978d7baeb87631dace043f3e 100644 (file)
@@ -1,6 +1,5 @@
 ---
 title: no-fallthrough
-layout: doc
 rule_type: problem
 related_rules:
 - default-case
@@ -33,7 +32,7 @@ switch(foo) {
 }
 ```
 
-That works fine when you don't want a fallthrough, but what if the fallthrough is intentional, there is no way to indicate that in the language. It's considered a best practice to always indicate when a fallthrough is intentional using a comment which matches the `/falls?\s?through/i` regular expression:
+That works fine when you don't want a fallthrough, but what if the fallthrough is intentional, there is no way to indicate that in the language. It's considered a best practice to always indicate when a fallthrough is intentional using a comment which matches the `/falls?\s?through/i` regular expression but isn't a directive:
 
 ```js
 switch(foo) {
@@ -170,7 +169,7 @@ Note that the last `case` statement in these examples does not cause a warning b
 
 This rule has an object option:
 
-* Set the `commentPattern` option to a regular expression string to change the test for intentional fallthrough comment.
+* Set the `commentPattern` option to a regular expression string to change the test for intentional fallthrough comment. If the fallthrough comment matches a directive, that takes precedence over `commentPattern`.
 
 * Set the `allowEmptyCase` option to `true` to allow empty cases regardless of the layout. By default, this rule does not require a fallthrough comment after an empty `case` only if the empty `case` and the next `case` are on the same line or on consecutive lines.