@so1ve/eslint-plugin 0.105.0 → 0.105.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -430,7 +430,10 @@ const noUselessTemplateString = createEslintRule({
430
430
  create: (context) => ({
431
431
  "TemplateLiteral:not(TaggedTemplateExpression > TemplateLiteral)"(node) {
432
432
  const hasNewline = node.quasis.some((n) => n.value.raw.includes("\n"));
433
- if (node.expressions.length === 0 && !hasNewline) {
433
+ const hasQuote = node.quasis.some(
434
+ (n) => n.value.raw.includes('"') || n.value.raw.includes("'")
435
+ );
436
+ if (node.expressions.length === 0 && !hasNewline && !hasQuote) {
434
437
  context.report({
435
438
  node,
436
439
  messageId: "noUselessTemplateString",
package/dist/index.mjs CHANGED
@@ -428,7 +428,10 @@ const noUselessTemplateString = createEslintRule({
428
428
  create: (context) => ({
429
429
  "TemplateLiteral:not(TaggedTemplateExpression > TemplateLiteral)"(node) {
430
430
  const hasNewline = node.quasis.some((n) => n.value.raw.includes("\n"));
431
- if (node.expressions.length === 0 && !hasNewline) {
431
+ const hasQuote = node.quasis.some(
432
+ (n) => n.value.raw.includes('"') || n.value.raw.includes("'")
433
+ );
434
+ if (node.expressions.length === 0 && !hasNewline && !hasQuote) {
432
435
  context.report({
433
436
  node,
434
437
  messageId: "noUselessTemplateString",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@so1ve/eslint-plugin",
3
- "version": "0.105.0",
3
+ "version": "0.105.2",
4
4
  "author": "Ray <i@mk1.io> (https://github.com/so1ve/)",
5
5
  "keywords": [
6
6
  "eslint",