no-var should not fix variables named 'let'
See original GitHub issueTell us about your environment
- ESLint Version: 5.16.0
- Node Version: 10.16.0
- npm Version: 6.9.0
What parser (default, Babel-ESLint, etc.) are you using?
default
Please show your full configuration:
Configuration
module.exports = {
parserOptions: {
ecmaVersion: 6,
},
rules: {
"no-var": "error",
}
};
What did you do? Please include the actual source code causing the issue, as well as the command that you used to run ESLint.
// this is valid code in non-strict mode
function foo() {
var let;
}
function bar() {
var { let } = {};
}
eslint index.js --fix
What did you expect to happen?
No autofix, because it produces SyntaxError.
What actually happened? Please include the actual, raw output from ESLint.
function foo() {
let let; // SyntaxError
}
function bar() {
let { let } = {}; // SyntaxError
}
Off topic: ESLint parser doesn’t treat let { let } = {}
as SyntaxError (probably an Acorn bug)
Are you willing to submit a pull request to fix this bug? yes
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Why not letrec as fix? - scheme - Stack Overflow
I have not scrutinized the R5RS report, but I have used letrec and the equivalent "named let " in Scheme programs and the...
Read more >4.6 Local Binding - Northwestern University PLT
That is, a named let binds a function identifier that is visible only in the function's body, and it implicitly calls the function...
Read more >SCORE Statement - SAS Help Center
The SCORE statement applies the contents of the source item store to compute predicted values and other observation-wise statistics for a SAS data...
Read more >sasmacros/existvar.sas at master · chris-swenson/sasmacros · GitHub
Name : ExistVar. Author: Chris Swenson. Created: 2011-04-18. Purpose: Check if a variable exists in a data set. Arguments: ds - data set....
Read more >Eval - Neovim docs
This works like a :let command is done for each list item. Again, the types must remain the same to avoid an error....
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
Sure, reported in acorn #837 now.
I confirmed it in the spec: https://www.ecma-international.org/ecma-262/9.0/#sec-let-and-const-declarations-static-semantics-early-errors