@putout/plugin-remove-useless-escape 6.0.0 → 7.0.0

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.
@@ -156,12 +156,11 @@ function unEscape(raw) {
156
156
  return raw;
157
157
  }
158
158
 
159
- function unescapeRegExp(raw) {
160
- return raw
161
- .replaceAll('\\:', ':')
162
- .replaceAll('\\+\\/', '+/')
163
- .replaceAll('\\,', ',');
164
- }
159
+ const unescapeRegExp = (raw) => raw
160
+ .replaceAll('\\:', ':')
161
+ .replaceAll('\\+\\/', '+/')
162
+ .replaceAll('\\,', ',')
163
+ .replaceAll('\\`', '`');
165
164
 
166
165
  const is = (a) => (b) => b.includes(`\\${a}`) && !b.includes(`\\\\${a}`);
167
166
  const isRegExpColon = is(':');
@@ -172,5 +171,8 @@ function isEscapedRegExp(raw) {
172
171
  if (raw.includes('\\/'))
173
172
  return false;
174
173
 
174
+ if (raw.includes('\\`'))
175
+ return true;
176
+
175
177
  return isRegExpColon(raw) || isRegExpSlash(raw) || isComa(raw);
176
178
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@putout/plugin-remove-useless-escape",
3
- "version": "6.0.0",
3
+ "version": "7.0.0",
4
4
  "type": "commonjs",
5
5
  "author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
6
6
  "description": "🐊Putout plugin adds ability to find and remove useless escape",
@@ -11,7 +11,7 @@
11
11
  "changelog": false,
12
12
  "repository": {
13
13
  "type": "git",
14
- "url": "git://github.com/coderaiser/putout.git"
14
+ "url": "git+https://github.com/coderaiser/putout.git"
15
15
  },
16
16
  "scripts": {
17
17
  "test": "madrun test",
@@ -36,17 +36,18 @@
36
36
  "escape"
37
37
  ],
38
38
  "devDependencies": {
39
+ "@putout/eslint-flat": "^2.0.0",
39
40
  "@putout/plugin-madrun": "*",
40
41
  "@putout/plugin-regexp": "*",
41
- "@putout/test": "^9.0.0",
42
- "c8": "^9.0.0",
42
+ "@putout/test": "^12.0.0",
43
+ "c8": "^10.0.0",
43
44
  "eslint": "^9.0.0",
44
45
  "eslint-plugin-n": "^17.0.0",
45
- "eslint-plugin-putout": "^22.0.0",
46
+ "eslint-plugin-putout": "^25.0.1",
46
47
  "madrun": "^10.0.0"
47
48
  },
48
49
  "peerDependencies": {
49
- "putout": ">=35"
50
+ "putout": ">=38"
50
51
  },
51
52
  "license": "MIT",
52
53
  "engines": {