Skip to content

Commit

Permalink
docs: migration guide entry for no-inner-declarations (#17977)
Browse files Browse the repository at this point in the history
* docs: migration guide entry for no-inner-declarations

* fix punctuation

* minor fix

* minor fix

* docs: add To adress section
  • Loading branch information
Tanujkanti4441 committed Jan 11, 2024
1 parent 40be60e commit 96307da
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions docs/src/use/migrate-to-9.0.0.md
Expand Up @@ -31,6 +31,7 @@ The lists below are ordered roughly by the number of users each change is expect
* [Case-sensitive flags in `no-invalid-regexp`](#no-invalid-regexp)
* [`varsIgnorePattern` option of `no-unused-vars` no longer applies to catch arguments](#vars-ignore-pattern)
* [`"eslint:recommended"` and `"eslint:all"` strings no longer accepted in flat config](#string-config)
* [`no-inner-declarations` has a new default behavior with a new option](#no-inner-declarations)

### Breaking changes for plugin developers

Expand Down Expand Up @@ -308,6 +309,23 @@ export default [

**Related issue(s):** [#17488](https://github.com/eslint/eslint/issues/17488)

## <a name="no-inner-declarations"></a> `no-inner-declarations` has a new default behavior with a new option

ESLint v9.0.0 introduces a new option in `no-inner-declarations` rule called `blockScopeFunctions` which by default allows block-level `function`s in strict mode when `languageOptions.ecmaVersion` is set to `2015` or above.

```js
/*eslint no-inner-declarations: "error"*/
"use strict";

if (test) {
function foo () { } // no error
}
```

**To address:** If you want to report the block-level `function`s in every condition regardless of strict or non-strict mode, set the `blockScopeFunctions` option to `"disallow"`.

**Related issue(s):** [#15576](https://github.com/eslint/eslint/issues/15576)

## <a name="removed-context-methods"></a> Removed multiple `context` methods

ESLint v9.0.0 removes multiple deprecated methods from the `context` object and moves them onto the `SourceCode` object:
Expand Down

0 comments on commit 96307da

Please sign in to comment.