eslint-plugin-lube 0.3.2 → 0.3.3

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/package.json CHANGED
@@ -22,5 +22,5 @@
22
22
  "test": "mocha"
23
23
  },
24
24
  "type": "commonjs",
25
- "version": "0.3.2"
25
+ "version": "0.3.3"
26
26
  }
@@ -54,6 +54,8 @@ module.exports = {
54
54
  const temp_indexes = [...text_indexes]
55
55
  /** @type {(string | undefined)[]} */
56
56
  const types = []
57
+ /** @type {true[]} */
58
+ const extras = []
57
59
  /**
58
60
  * @param {number} start
59
61
  * @param {number} end
@@ -105,6 +107,7 @@ module.exports = {
105
107
  temp_text_changes(left, left + 1)
106
108
  close++
107
109
  if (temp_text.slice(temp_indexes[right + 1], temp_indexes[right + 5]) == "/**/") {
110
+ extras[right] = true
108
111
  temp_text_changes(right, right += 5)
109
112
  } else {
110
113
  temp_text_changes(right, ++right)
@@ -128,7 +131,7 @@ module.exports = {
128
131
  }
129
132
  const start = temp_indexes[node.range[0]]
130
133
  let end = temp_indexes[node.range[1]]
131
- if (temp_text.slice(end, end + 4) == "/**/") {
134
+ if (extras[end] || open && temp_text.slice(end, end + 4) == "/**/") {
132
135
  end += 4
133
136
  }
134
137
  let corrected_text = temp_text.slice(start, end)
@@ -24,6 +24,9 @@ exports.module = (valid, invalid) => {
24
24
  {
25
25
  code: "var v = { b: /** @type {A} */(a)/**/ }"
26
26
  },
27
+ {
28
+ code: "a = /** @type {A} */((b.c || d).e(f))/**/"
29
+ },
27
30
  {
28
31
  code: `var v = /** @type {V} */({
29
32
  a: /** @type {A} */([/** @type {B} */(b)/**/, /** @type {C} */(c)/**/, /** @type {D} */(d)/**/])/**/,