not work "builtinGlobals" in rule "no-redeclare"
See original GitHub issueTell us about your environment
- ESLint Version: v4.0.0
- Node Version: v8.0.0
- npm Version: v5.0.0
Hi, maybe I finded bug. Not wokr rule property “builtinGlobals” in rule “no-redeclare”.
/*eslint no-redeclare: ["error", { "builtinGlobals": true }]*/
/*eslint-env browser*/
var top = 0;
var Object = 0;
console message without error “no-redeclare”
4:1 error Unexpected var, use let or const instead no-var
4:5 error 'top' is assigned a value but never used no-unused-vars
4:11 error Number constants declarations must use 'const' no-magic-numbers
5:1 error Unexpected var, use let or const instead no-var
5:5 error 'Object' is assigned a value but never used no-unused-vars
5:14 error Number constants declarations must use 'const' no-magic-numbers
Issue Analytics
- State:
- Created 6 years ago
- Comments:7 (5 by maintainers)
Top Results From Across the Web
no-redeclare - ESLint - Pluggable JavaScript Linter
This rule takes one optional argument, an object with a boolean property "builtinGlobals" . It defaults to true . If set to true...
Read more >no-redeclare | typescript-eslint
This rule extends the base eslint/no-redeclare rule. It adds support for TypeScript function overloads, and declaration merging.
Read more >Add an ESLint rule/configuration to disallow definition of Cc ...
I've dug around a bit. I'd like to change our config to use no-redeclare's builtinGlobals option: "no-redeclare": ["error", {"builtinGlobals": ...
Read more >Migrating to v6.0.0 - ESLint中文文档
The no-redeclare rule is now more strict by default. Note: This update is planned, but has not been implemented in the latest alpha...
Read more >eslint/eslint - Gitter
Are there any supported mechanisms for causing no-redeclare to not consider globals as declarations? ... ESLint can only run rules after a successful...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Because you have
env: {node: true}
in your configuration. The node environment has special function scope which encloses whole code. So variable declarations shadow globals but don’t redeclare globals.Good point @boggddan, we should add a note about module scope for Node and similar environments and recommend
no-shadow
’s equivalent option. Thanks!