Skip to content

Commit ac77f5d

Browse files
committed
fix: @putout/plugin-putout: declare: get-rule
1 parent 9f8bd36 commit ac77f5d

File tree

5 files changed

+13
-9
lines changed

5 files changed

+13
-9
lines changed

packages/plugin-putout/.putout.json

+3
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
"match": {
33
"*.md{js}": {
44
"putout": "off"
5+
},
6+
"declare/get-rule.js": {
7+
"nodejs/convert-commonjs-to-esm-common": "off"
58
}
69
}
710
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
'use strict';
2+
3+
module.exports.getRule = (name, options = 'on') => ({
4+
[name]: [options, require(`./${name}`)],
5+
});

packages/plugin-putout/lib/declare/get-rule.js

-7
This file was deleted.

packages/plugin-putout/lib/declare/get-rule.spec.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1+
import {createRequire} from 'node:module';
12
import {test} from 'supertape';
2-
import {getRule} from './get-rule.js';
33
import * as index from './index.js';
44

5+
const require = createRequire(import.meta.url);
6+
const {getRule} = require('./get-rule.cjs');
7+
58
test('putout: plugin-putout: declare: getRule', (t) => {
69
const rule = getRule('index');
710
const expected = ['on', index];

packages/plugin-putout/lib/declare/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import operator from './operator/index.js';
2-
import {getRule} from './get-rule.js';
2+
import {getRule} from './get-rule.cjs';
33
import types from './types.js';
44

55
export const declare = () => ({

0 commit comments

Comments
 (0)