Skip to content

Commit

Permalink
feat(non-literal-require): support template literals (#81)
Browse files Browse the repository at this point in the history
* Add non-literal require TemplateLiteral support

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}`)
```

* Add babel-eslint and non-literal-require test

* ESLint >6 requires absolute path for ruletester parsers.

https://github.com/eslint/eslint/blob/main/docs/user-guide/migrating-to-6.0.0.md#rule-tester-parser

* chore: removed dependency on babel-eslint

* chore: ran linting fix

Co-authored-by: Grant Murphy <grant.murphy@elastic.co>
  • Loading branch information
MarkKragerup and gcmurphy authored Apr 8, 2022
1 parent fb1d9ef commit 208019b
Show file tree
Hide file tree
Showing 3 changed files with 590 additions and 6 deletions.
Loading

0 comments on commit 208019b

Please # to comment.