Skip to content

Commit b465fb4

Browse files
committed
feature: @putout/plugin-apply-flat-map: migrate to ESM
1 parent 588da48 commit b465fb4

File tree

6 files changed

+11
-24
lines changed

6 files changed

+11
-24
lines changed
File renamed without changes.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import {safeAlign} from 'eslint-plugin-putout';
2+
3+
export default safeAlign;

packages/plugin-apply-flat-map/eslint.config.mjs

Lines changed: 0 additions & 11 deletions
This file was deleted.
Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
'use strict';
1+
export const report = () => `Use '.flatMap()' instead of '.map().flat()'`;
22

3-
module.exports.report = () => `Use '.flatMap()' instead of '.map().flat()'`;
4-
5-
module.exports.replace = () => ({
3+
export const replace = () => ({
64
'__a.map(__b).flat()': '__a.flatMap(__b)',
75
});

packages/plugin-apply-flat-map/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-flat-map",
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 apply 'flatMap()'",
77
"homepage": "http://github.com/coderaiser/putout/tree/master/packages/plugin-apply-flat-map#readme",
@@ -32,7 +32,6 @@
3232
"flat-map"
3333
],
3434
"devDependencies": {
35-
"@putout/eslint-flat": "^3.0.0",
3635
"@putout/test": "^13.0.0",
3736
"c8": "^10.0.0",
3837
"eslint": "^9.0.0",
@@ -42,11 +41,11 @@
4241
"nodemon": "^3.0.1"
4342
},
4443
"peerDependencies": {
45-
"putout": ">=28"
44+
"putout": ">=39"
4645
},
4746
"license": "MIT",
4847
"engines": {
49-
"node": ">=16"
48+
"node": ">=20"
5049
},
5150
"publishConfig": {
5251
"access": "public"

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

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

0 commit comments

Comments
 (0)