Skip to content

Commit 845a076

Browse files
committed
feature: @putout/plugin-apply-overrides: convert to ESM
1 parent a09f6f0 commit 845a076

File tree

5 files changed

+11
-16
lines changed

5 files changed

+11
-16
lines changed
File renamed without changes.
File renamed without changes.

packages/plugin-apply-overrides/lib/apply-overrides.js

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
1-
'use strict';
2-
3-
const {
1+
import {
42
types,
53
operator,
64
template,
7-
} = require('putout');
5+
} from 'putout';
86

97
const {
108
returnStatement,
@@ -20,8 +18,8 @@ const {replaceWith} = operator;
2018

2119
const createOverrides = template('const %%overrides%% = overrides');
2220

23-
module.exports.report = () => `Use variable 'overrides' instead of destructuring function argument`;
24-
module.exports.fix = (path) => {
21+
export const report = () => `Use variable 'overrides' instead of destructuring function argument`;
22+
export const fix = (path) => {
2523
const {node, parentPath} = path;
2624
const {right} = node;
2725

@@ -37,7 +35,7 @@ module.exports.fix = (path) => {
3735
}));
3836
};
3937

40-
module.exports.traverse = ({push}) => ({
38+
export const traverse = ({push}) => ({
4139
Function(path) {
4240
const params = path.get('params');
4341
const {length} = params;

packages/plugin-apply-overrides/package.json

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@putout/plugin-apply-overrides",
33
"version": "2.1.0",
4-
"type": "commonjs",
4+
"type": "module",
55
"author": "coderaiser <[email protected]> (https://github.com/coderaiser)",
66
"description": "🐊Putout plugin adds ability apply 'overrides'",
77
"homepage": "https://github.com/coderaiser/putout/tree/master/packages/plugin-apply-overrides#readme",
@@ -31,7 +31,6 @@
3131
"overrides"
3232
],
3333
"devDependencies": {
34-
"@putout/eslint-flat": "^3.0.0",
3534
"@putout/test": "^13.0.0",
3635
"c8": "^10.0.0",
3736
"eslint": "^9.0.0",
@@ -41,11 +40,11 @@
4140
"nodemon": "^3.0.1"
4241
},
4342
"peerDependencies": {
44-
"putout": ">=36"
43+
"putout": ">=40"
4544
},
4645
"license": "MIT",
4746
"engines": {
48-
"node": ">=18"
47+
"node": ">=20"
4948
},
5049
"publishConfig": {
5150
"access": "public"

packages/plugin-apply-overrides/test/apply-overrides.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 plugin from '../lib/apply-overrides.js';
23

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

0 commit comments

Comments
 (0)