sonarjs/no-duplicate-string : ignore import expressions
a-tarasyuk opened this issue · comments
I want to report a bug.
Reproducer
import("./main");
import("./main");
import("./main");
Expected behavior
No error
eslint-plugin-sonarjs version: 0.10.0
eslint version: 7.32.0
Node.js version: 14.17.1
Rule key: no-duplicate-string
Why would you want to import the same module 3 times?
@vilchik-elena This is just a simplified example. no-duplicate-string
ignores import declarations and cjs requires, however, import expressions are not ignored. Does it make sense to ignore them?
eslint-plugin-sonarjs/tests/rules/no-duplicate-string.test.ts
Lines 81 to 83 in 6250300
eslint-plugin-sonarjs/src/rules/no-duplicate-string.ts
Lines 30 to 31 in 6250300
eslint-plugin-sonarjs/tests/rules/no-duplicate-string.test.ts
Lines 94 to 97 in 6250300