Skip to content

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

Merged
nzakas merged 7 commits intoeslint-community:mainfrom
MarkKragerup:improve-non-literal-require
Apr 8, 2022
Merged

feat(non-literal-require): support template literals#81
nzakas merged 7 commits intoeslint-community:mainfrom
MarkKragerup:improve-non-literal-require

Conversation

@MarkKragerup
Copy link
Copy Markdown
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?

Grant Murphy 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}`)
```
Comment thread package.json Outdated
Comment thread test/detect-non-literal-require.js Outdated
@MarkKragerup MarkKragerup changed the title Improve non literal require - replaces #32 feat(non-literal-require): support template literals Apr 7, 2022
@MarkKragerup
Copy link
Copy Markdown
Contributor Author

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

Copy link
Copy Markdown
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

2 participants