You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Unfortunately, this plugin conflicts with that rule:
constfs=require('fs');// error by ESLint's quotes ruleconstfs=require(`fs`);// warning by this plugin's detect-non-literal-require rule// -> No possibility to use require without errors/warnings
All rules enforcing a literal usage pass with single ticks and fail with back ticks, without respecting whether or not the template string does actually contain variables.
The rules actually check the argument's type to be 'Literal' (rules/detect-non-literal-require.js#L18), maybe it's possible to also check to case that the argument is non-literal, but is a template string doesn't containing any variables?
The text was updated successfully, but these errors were encountered:
In our project, we decided to always use template literals with backticks instead of normal quotes as Template Literals are Strictly Better Strings. So we want to use
const str = `text`;
instead ofconst str = 'text';
. See our issue on that topic.Unfortunately, this plugin conflicts with that rule:
All rules enforcing a literal usage pass with single ticks and fail with back ticks, without respecting whether or not the template string does actually contain variables.
The rules actually check the argument's
type
to be'Literal'
(rules/detect-non-literal-require.js#L18), maybe it's possible to also check to case that the argument is non-literal, but is a template string doesn't containing any variables?The text was updated successfully, but these errors were encountered: