8 In JavaScript, prior to ES6, standalone code blocks delimited by curly braces do not create a new scope and have no use. For example, these curly braces do nothing to `foo`:
16 In ES6, code blocks may create a new scope if a block-level binding (`let` and `const`), a class declaration or a function declaration (in strict mode) are present. A block is not considered redundant in these cases.
20 This rule aims to eliminate unnecessary and potentially confusing blocks at the top level of a script or within other blocks.
22 Examples of **incorrect** code for this rule:
27 /*eslint no-lone-blocks: "error"*/
64 Examples of **correct** code for this rule with ES6 environment:
69 /*eslint no-lone-blocks: "error"*/
116 Examples of **correct** code for this rule with ES6 environment and strict mode via `"parserOptions": { "sourceType": "module" }` in the ESLint configuration or `"use strict"` directive in the code:
121 /*eslint no-lone-blocks: "error"*/