Skip to content

Commit ebd673f

Browse files
committed
feature: @putout/plugin-convert-template-to-string: migrate to ESM
1 parent f321d54 commit ebd673f

File tree

6 files changed

+13
-14
lines changed

6 files changed

+13
-14
lines changed

packages/plugin-convert-template-to-string/.madrun.mjs renamed to packages/plugin-convert-template-to-string/.madrun.js

File renamed without changes.

packages/plugin-convert-template-to-string/.putout.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,8 @@
33
"*.md": {
44
"convert-template-to-string": "off"
55
}
6+
},
7+
"rules": {
8+
"convert-template-to-string": "off"
69
}
7-
}
10+
}

packages/plugin-convert-template-to-string/eslint.config.mjs renamed to packages/plugin-convert-template-to-string/eslint.config.js

File renamed without changes.
Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
1-
'use strict';
1+
export const report = () => 'Avoid using Template string with only one expression';
22

3-
module.exports.report = () => 'Avoid using Template string with only one expression';
4-
5-
module.exports.match = () => ({
3+
export const match = () => ({
64
'`${__a}`': (vars, path) => {
75
const {parentPath} = path;
86
return !parentPath.isTaggedTemplateExpression();
97
},
108
});
119

12-
module.exports.replace = () => ({
10+
export const replace = () => ({
1311
'`${__a}`': 'String(__a)',
1412
});

packages/plugin-convert-template-to-string/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@putout/plugin-convert-template-to-string",
33
"version": "2.0.0",
4-
"type": "commonjs",
4+
"type": "module",
55
"author": "coderaiser <[email protected]> (https://github.com/coderaiser)",
66
"description": "🐊Putout plugin adds ability to find and remove useless template string",
77
"homepage": "https://github.com/coderaiser/putout/tree/master/packages/plugin-convert-template-to-string#readme",
@@ -42,11 +42,11 @@
4242
"madrun": "^11.0.0"
4343
},
4444
"peerDependencies": {
45-
"putout": ">=35"
45+
"putout": ">=40"
4646
},
4747
"license": "MIT",
4848
"engines": {
49-
"node": ">=18"
49+
"node": ">=20"
5050
},
5151
"publishConfig": {
5252
"access": "public"

packages/plugin-convert-template-to-string/test/convert-template-to-string.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1-
'use strict';
1+
import {createTest} from '@putout/test';
2+
import * as convertTemplateToString from '../lib/convert-template-to-string.js';
23

3-
const {createTest} = require('@putout/test');
4-
const convertTemplateToString = require('..');
5-
6-
const test = createTest(__dirname, {
4+
const test = createTest(import.meta.url, {
75
plugins: [
86
['convert-template-to-string', convertTemplateToString],
97
],

0 commit comments

Comments
 (0)