@putout/plugin-remove-useless-escape 7.0.0 → 8.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.
@@ -1,16 +1,13 @@
1
- 'use strict';
2
-
3
- const emojiRegex = require('emoji-regex');
4
-
5
- const {types, operator} = require('putout');
1
+ import emojiRegex from 'emoji-regex';
2
+ import {types, operator} from 'putout';
6
3
 
7
4
  const {replaceWith} = operator;
8
- const {RegExpLiteral} = types;
5
+ const {regExpLiteral} = types;
9
6
  const {assign} = Object;
10
7
 
11
- module.exports.report = () => 'Unnecessary escape character';
8
+ export const report = () => 'Unnecessary escape character';
12
9
 
13
- module.exports.fix = (path) => {
10
+ export const fix = (path) => {
14
11
  if (path.isStringLiteral()) {
15
12
  const {raw} = path.node;
16
13
 
@@ -25,7 +22,7 @@ module.exports.fix = (path) => {
25
22
  const unescaped = unescapeRegExp(pattern);
26
23
  const raw = `/${unescaped}/`;
27
24
 
28
- const regExpNode = assign(RegExpLiteral(unescaped, flags), {
25
+ const regExpNode = assign(regExpLiteral(unescaped, flags), {
29
26
  value: unescaped,
30
27
  raw,
31
28
  extra: {
@@ -44,7 +41,7 @@ module.exports.fix = (path) => {
44
41
  }
45
42
  };
46
43
 
47
- module.exports.traverse = ({push}) => ({
44
+ export const traverse = ({push}) => ({
48
45
  'RegExpLiteral'(path) {
49
46
  const {raw} = path.node;
50
47
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@putout/plugin-remove-useless-escape",
3
- "version": "7.0.0",
4
- "type": "commonjs",
3
+ "version": "8.0.0",
4
+ "type": "module",
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",
7
7
  "homepage": "https://github.com/coderaiser/putout/tree/master/packages/plugin-remove-useless-escape#readme",
@@ -36,22 +36,22 @@
36
36
  "escape"
37
37
  ],
38
38
  "devDependencies": {
39
- "@putout/eslint-flat": "^2.0.0",
39
+ "@putout/eslint-flat": "^3.0.0",
40
40
  "@putout/plugin-madrun": "*",
41
41
  "@putout/plugin-regexp": "*",
42
- "@putout/test": "^12.0.0",
42
+ "@putout/test": "^13.0.0",
43
43
  "c8": "^10.0.0",
44
44
  "eslint": "^9.0.0",
45
45
  "eslint-plugin-n": "^17.0.0",
46
- "eslint-plugin-putout": "^25.0.1",
47
- "madrun": "^10.0.0"
46
+ "eslint-plugin-putout": "^26.0.0",
47
+ "madrun": "^11.0.0"
48
48
  },
49
49
  "peerDependencies": {
50
- "putout": ">=38"
50
+ "putout": ">=40"
51
51
  },
52
52
  "license": "MIT",
53
53
  "engines": {
54
- "node": ">=18"
54
+ "node": ">=20"
55
55
  },
56
56
  "publishConfig": {
57
57
  "access": "public"