Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Breaking: make no-redeclare stricter (fixes #11370, fixes #11405) #11509

Merged
merged 17 commits into from Apr 25, 2019
Merged
Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.

Always

Just for now

fix markdownlint

  • Loading branch information...
mysticatea committed Mar 15, 2019
commit 012bd526d54347a99cb63fcd65171d26bbd4850a
@@ -171,10 +171,10 @@ This method returns the scope which has the following types:

The returned value is a `Scope` object that [`eslint-scope` package defined](scope-manager-interface.md). The `Variable` objects of global variables have some additional properties.
This conversation was marked as resolved by mysticatea

This comment has been minimized.

Copy link
@platinumazure

platinumazure Mar 28, 2019

Member

Possible wording improvement:

Suggested change
The returned value is a `Scope` object that [`eslint-scope` package defined](scope-manager-interface.md). The `Variable` objects of global variables have some additional properties.
The returned value is a [`Scope` object](scope-manager-interface.md) defined by the `eslint-scope` package. The `Variable` objects of global variables have some additional properties.

- `variable.writeable` (`boolean`) ... If `true`, this global variable can be assigned arbitrary value. Otherwise, this global variable is read-only.
- `variable.eslintExplicitGlobal` (`boolean`) ... If `true`, this global variable was defined by a `/* globals */` directive comment in the source code file.
- `variable.eslintExplicitGlobalComments` (`Comment[]`) ... The array of `/* globals */` directive comments which defined this global variable in the source code file.
- `variable.eslintImplicitGlobalSetting` (`"readonly" | "writable" | undefined`) ... The configured value in config files. This can be different from `variable.writeable` if there are `/* globals */` directive comments.
* `variable.writeable` (`boolean`) ... If `true`, this global variable can be assigned arbitrary value. Otherwise, this global variable is read-only.
* `variable.eslintExplicitGlobal` (`boolean`) ... If `true`, this global variable was defined by a `/* globals */` directive comment in the source code file.
* `variable.eslintExplicitGlobalComments` (`Comment[]`) ... The array of `/* globals */` directive comments which defined this global variable in the source code file.
This conversation was marked as resolved by mysticatea

This comment has been minimized.

Copy link
@not-an-aardvark

not-an-aardvark Mar 15, 2019

Member

Will this property always exist, or is it only defined on variables that have at least one comment?

This comment has been minimized.

Copy link
@mysticatea

mysticatea Mar 15, 2019

Author Member

It's only defined on variables that have at least one comment. I will add the description.

* `variable.eslintImplicitGlobalSetting` (`"readonly" | "writable" | undefined`) ... The configured value in config files. This can be different from `variable.writeable` if there are `/* globals */` directive comments.

### context.report()

@@ -6,12 +6,12 @@ The lists below are ordered roughly by the number of users each change is expect

### Breaking changes for users

- [`no-redeclare` rule now checks the redeclarations by `/* globals */` directive comments](#no-redeclare-and-comments)
- [`no-redeclare` rule now checks the redeclarations with built-in globals by default](#no-redeclare-and-builtins)
* [`no-redeclare` rule now checks the redeclarations by `/* globals */` directive comments](#no-redeclare-and-comments)
* [`no-redeclare` rule now checks the redeclarations with built-in globals by default](#no-redeclare-and-builtins)

### Breaking changes for plugin/custom rule developers

- [`variable.eslintExplicitGlobalComment` property was removed](#remove-variable-explicit-global-comment)
* [`variable.eslintExplicitGlobalComment` property was removed](#remove-variable-explicit-global-comment)

### Breaking changes for integration developers

@@ -23,8 +23,8 @@ The lists below are ordered roughly by the number of users each change is expect

[no-redeclare] rule reports the following cases newly:

- Your config file defined a global variable but there is `/* globals */` directive comment of the defined global variable in your source code.
- There are multiple `/* globals */` directive comments for the same variable.
* Your config file defined a global variable but there is `/* globals */` directive comment of the defined global variable in your source code.
* There are multiple `/* globals */` directive comments for the same variable.

**To address:** Please remove the redundant `/* globals */` directive comments.

ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.