Add a --fix option for new-parens
See original GitHub issueI’m using Node v6.4.0 and ESLint v3.4.0.
It would be useful to have an autofix option for the new-parens
rule. The fixer would simply add ()
to all places where the rule reports an error.
var x = new Foo;
var y = new foo.Bar;
var z = (new Foo).bar;
// gets corrected to:
var x = new Foo();
var y = new foo.Bar();
var z = (new Foo()).bar;
I would be willing to add this if the issue is accepted.
Issue Analytics
- State:
- Created 7 years ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
new-parens - ESLint - Pluggable JavaScript Linter
A pluggable and configurable linter tool for identifying and reporting on patterns in JavaScript. Maintain your code quality with ease.
Read more >ESLint v3.5.0 released - ESLint中文文档
This release adds some new features and fixes several bugs found in the previous release. ... Eight rules gained support for the --fix...
Read more >Configuring TSLint - Palantir Open Source
When using the CLI or many third-party tools, a file named tslint.json or tslint.yaml is used to configure which rules get run and...
Read more >eslint/eslint - Gitter
hello, this is the first time i use eslint. it seems i have some issues fixable by eslint ( --fix option) i type:...
Read more >@sailshq/eslint | Yarn - Package Manager
3ff5d11 Fix: no-invalid-regexp not understand variable for flags (fixes #10112) ... 0360cc2 Chore: Adding debug logs on successful plugin loads (#10100) ...
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
Oh, it’s a bug!
Currently,
new-parens
rule seems to check whether there are 2 or more parentheses in aNewExpression
node. It does not check whether the parentheses is for arguments or not.I will open an issue.
👍