Skip to content

Commit ecee7cb

Browse files
committed
feature: @putout/plugin-apply-shorthand-properties: drop support of 🐊 < 40
1 parent 65c2ff2 commit ecee7cb

File tree

5 files changed

+14
-20
lines changed

5 files changed

+14
-20
lines changed

β€Žpackages/plugin-apply-shorthand-properties/.madrun.jsβ€Ž

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
'use strict';
1+
import {run} from 'madrun';
22

3-
const {run} = require('madrun');
4-
5-
module.exports = {
3+
export default {
64
'publishOnly': () => run('lint'),
75
'test': () => `tape 'test/*.js'`,
86
'watch:test': async () => `nodemon -w lib -w test -x "${await run('test')}"`,
File renamed without changes.

β€Žpackages/plugin-apply-shorthand-properties/lib/apply-shorthand-properties.jsβ€Ž

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
1-
'use strict';
1+
import {types, operator} from 'putout';
22

3-
const {types, operator} = require('putout');
43
const {findBinding, rename} = operator;
5-
64
const {isImportSpecifier} = types;
75

8-
module.exports.report = () => `Use shorthand properties`;
6+
export const report = () => `Use shorthand properties`;
97

10-
module.exports.fix = ({path, from, to, toRename}) => {
8+
export const fix = ({path, from, to, toRename}) => {
119
if (isImportSpecifier(path)) {
1210
path.node.imported = path.node.local;
1311
return;
@@ -19,7 +17,7 @@ module.exports.fix = ({path, from, to, toRename}) => {
1917
path.node.shorthand = true;
2018
};
2119

22-
module.exports.traverse = ({push, options}) => ({
20+
export const traverse = ({push, options}) => ({
2321
ImportSpecifier(path) {
2422
if (path.node.imported.value === path.node.local.name)
2523
push({

β€Žpackages/plugin-apply-shorthand-properties/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-apply-shorthand-properties",
33
"version": "6.1.0",
4-
"type": "commonjs",
4+
"type": "module",
55
"author": "coderaiser <[email protected]> (https://github.com/coderaiser)",
66
"description": "🐊Putout plugin adds ability to apply shorthand properties",
77
"homepage": "https://github.com/coderaiser/putout/tree/master/packages/plugin-apply-shorthand-properties#readme",
@@ -42,11 +42,11 @@
4242
"madrun": "^11.0.0"
4343
},
4444
"peerDependencies": {
45-
"putout": ">=36"
45+
"putout": ">=40"
4646
},
4747
"license": "MIT",
4848
"engines": {
49-
"node": ">=18"
49+
"node": ">=20"
5050
},
5151
"publishConfig": {
5252
"access": "public"

β€Žpackages/plugin-apply-shorthand-properties/test/apply-shorthand-properties.jsβ€Ž

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,14 @@
1-
'use strict';
1+
import * as removeUnusedVariables from '@putout/plugin-remove-unused-variables';
2+
import {createTest} from '@putout/test';
3+
import * as applyShorthandProperties from '../lib/apply-shorthand-properties.js';
24

3-
const removeUnusedVariables = require('@putout/plugin-remove-unused-variables');
4-
const {createTest} = require('@putout/test');
5-
const applyShorthandProperties = require('../lib/apply-shorthand-properties.js');
6-
7-
const test = createTest(__dirname, {
5+
const test = createTest(import.meta.url, {
86
plugins: [
97
['apply-shorthand-properties', applyShorthandProperties],
108
],
119
});
1210

13-
const testWithRemove = createTest(__dirname, {
11+
const testWithRemove = createTest(import.meta.url, {
1412
plugins: [
1513
['apply-shorthand-properties', applyShorthandProperties],
1614
['rm-unused-vars', removeUnusedVariables],

0 commit comments

Comments
Β (0)