`no-self-assign` failing for property assignment
See original GitHub issueWhat version of ESLint are you using?
3.1.1
What parser (default, Babel-ESLint, etc.) are you using?
Default
Please show your full configuration:
{ "env": { "browser": true }, "parserOptions": { "ecmaVersion": 6 }, "rules": { "no-self-assign": "error" } }
What did you do? Please include the actual source code causing the issue.
var a = 123;
a = a;
var b = { a };
b.a = b.a;
What did you expect to happen?
I would expect b.a = b.a
to be a error;
What actually happened? Please include the actual, raw output from ESLint.
Only a.a
is an error.
2:5 error ‘a’ is assigned to itself no-self-assign
✖ 1 problem (1 error, 0 warnings)
Issue Analytics
- State:
- Created 7 years ago
- Comments:12 (12 by maintainers)
Top Results From Across the Web
c++ - What is wrong with "checking for self-assignment" and ...
To answer my rhetorical question: It means that a well-designed assignment operator should not need to check for self-assignment. Assigning an ...
Read more >Rules - ESLint - Pluggable JavaScript Linter
The "extends": "eslint:recommended" property in a configuration file enables ... Disallow assignment operators in conditional expressions ... no-self-assign.
Read more >How to set up property assignment? in JustMock - Telerik
With JustMock I can't find any method that would assign a property value on a mocked instance. The following code fails in assertion:...
Read more >CA2011: Do not assign property within its setter (code analysis)
Cause. A property was accidentally assigned a value within its own set accessor. Rule description. Assigning a property to itself in its set ......
Read more >Property Validation fails due to assignment issues. - MathWorks
Property Validation fails due to assignment... Learn more about property validation, properties, validation, property validation function, ...
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
Can we put it behind a rule option so users can make that call?
On Jul 21, 2016 11:12 AM, “Nicholas C. Zakas” notifications@github.com wrote:
👍