Skip to content
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

feat(non-literal-require): support template literals #81

Merged

Conversation

MarkKragerup
Copy link
Contributor

@MarkKragerup MarkKragerup commented Mar 28, 2022

I did not have write access to the fork for #32, so i forked the fork and implemented the following changes:

This closes #29 and #27

@nzakas Can you close #32 in favor of this pr, and possibly merge?

gcmurphy and others added 4 commits May 30, 2018 12:39
Currently following code triggers the detect-non-literal-require rule:

```js
const foo = require(`bar`)
```

However it would be more accurate (and less noisey) if it triggered on
cases such as:

```js
const foo = require(`${bar}`)
```
package.json Outdated Show resolved Hide resolved
test/detect-non-literal-require.js Outdated Show resolved Hide resolved
@MarkKragerup MarkKragerup changed the title Improve non literal require - replaces #32 feat(non-literal-require): support template literals Apr 7, 2022
@MarkKragerup
Copy link
Contributor Author

@nzakas removed the babel-eslint dependency and cleaned it up.

Copy link
Contributor

@nzakas nzakas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks!

@nzakas nzakas merged commit 208019b into eslint-community:main Apr 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

detect-non-literal-require doesn't recognise backticks as literal
3 participants