-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
[javascript] UnnecessaryBlock - false positives with destructuring assignments #2305
Comments
Weirdly enough the parser produces EmptyStatement nodes for imports. Eg for the example on https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import import defaultExport from "module-name";
import * as name from "module-name";
import { export1 } from "module-name";
import { export1 as alias1 } from "module-name";
import { export1 , export2 } from "module-name";
import { foo , bar } from "module-name/path/to/specific/un-exported/file";
import { export1 , export2 as alias2 } from "module-name";
import defaultExport, { export1 } from "module-name";
import defaultExport, * as name from "module-name";
import "module-name";
var promise = import("module-name");
|
I've just tried it with Rhino 1.7.12 and it seems, that |
any news on this? #2906 will fix it? |
Import is not the only trigger for this error. It also happens with destructuring assignments where pmd sees the curly brackets as an extra block.
|
fixed in #4829 |
Rule: UnnecessaryBlock
Description:
Unfortunately I do not know what version of PMD is being used..
PMD is one of the test suites that codacy.com uses..
Code Sample demonstrating the issue:
throws "Unnecessary block."
However, the brackets are quite necessary and designate a named import.
The text was updated successfully, but these errors were encountered: