[no-path-concat] overlooks template literals
See original GitHub issueTell us about your environment
- ESLint Version: 6.4.0
- Node Version: -
- npm Version: -
What parser (default, Babel-ESLint, etc.) are you using?
Default.
Please show your full configuration: What did you do? Please include the actual source code causing the issue, as well as the command that you used to run ESLint.
/*eslint no-path-concat: error */
const a = __dirname + "/foo.js"
const b = `${__dirname}/foo.js`
What did you expect to happen?
There are two errors:
__dirname + "/foo.js"
`${__dirname}/foo.js`
What actually happened? Please include the actual, raw output from ESLint.
There is only one error:
__dirname + "/foo.js"
The rule doesn’t seem to consider the interpolation of template literals as concatenation.
Are you willing to submit a pull request to fix this bug?
Yes.
Should we pass the rule to eslint-plugin-node
plugin?
Issue Analytics
- State:
- Created 4 years ago
- Reactions:3
- Comments:7 (6 by maintainers)
Top Results From Across the Web
No results found
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 Free
Top 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
👍 to updating the rule’s behavior and am not opposed to deprecating it in core and moving it to
eslint-plugin-node
. I wonder if it’s worth evaluating whether we should move our other Node-specific rules to the plugin?ok, I will work on the tests and fixing the error in the code base today and will open a pr with the changes 😃