Skip to content

Commit 2f86e89

Browse files
committed
feature: @putout/plugin-putout-config: drop support of 🐊 < 39
1 parent 0ae2a7d commit 2f86e89

File tree

40 files changed

+265
-195
lines changed

40 files changed

+265
-195
lines changed

packages/plugin-putout-config/.putout.json

+9
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,13 @@
11
{
2+
"rules": {
3+
"putout/apply-exports": ["on", {
4+
"createRenameProperty": [
5+
"report",
6+
"fix",
7+
"traverse"
8+
]
9+
}]
10+
},
211
"match": {
312
"*.md{json}": {
413
"putout-config": "off"

packages/plugin-putout-config/lib/apply-conditions/index.js

+15-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
'use strict';
2-
3-
const {createRenameProperty} = require('../rename-property');
1+
import {createRenameProperty} from '../rename-property.js';
42

53
const v32 = [
64
['remove-useless-else', 'conditions/remove-useless-else'],
@@ -19,7 +17,19 @@ const v29 = [
1917
['remove-boolean-from-assertions', 'conditions/remove-boolean'],
2018
];
2119

22-
module.exports = createRenameProperty([
20+
const versions = [
2321
...v32,
2422
...v29,
25-
]);
23+
];
24+
25+
const {
26+
report,
27+
fix,
28+
traverse,
29+
} = createRenameProperty(versions);
30+
31+
export {
32+
report,
33+
fix,
34+
traverse,
35+
};

packages/plugin-putout-config/lib/apply-conditions/index.spec.js

+3-5
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 './index.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-conditions', plugin],
97
],

packages/plugin-putout-config/lib/apply-esm/index.js

+12-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
'use strict';
2-
3-
const {createRenameProperty} = require('../rename-property');
1+
import {createRenameProperty} from '../rename-property.js';
42

53
const v37 = [
64
['convert-assert-to-with', 'esm/convert-assert-to-with'],
@@ -13,4 +11,14 @@ const v37 = [
1311
['merge-duplicate-imports', 'esm/merge-duplicate-imports'],
1412
];
1513

16-
module.exports = createRenameProperty(v37);
14+
const {
15+
report,
16+
fix,
17+
traverse,
18+
} = createRenameProperty(v37);
19+
20+
export {
21+
report,
22+
fix,
23+
traverse,
24+
};

packages/plugin-putout-config/lib/apply-esm/index.spec.js

+3-5
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 './index.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-esm', plugin],
97
],
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
'use strict';
1+
import {createRenameProperty} from '../rename-property.js';
22

3-
const {createRenameProperty} = require('../rename-property');
4-
5-
module.exports = createRenameProperty([
3+
const {
4+
report,
5+
fix,
6+
traverse,
7+
} = createRenameProperty([
68
['convert-for-to-for-of', 'for-of/for'],
79
['convert-for-each-to-for-of', 'for-of/for-each'],
810
['convert-for-in-to-for-of', 'for-of/for-in'],
@@ -13,3 +15,9 @@ module.exports = createRenameProperty([
1315
['remove-useless-array-from', 'for-of/remove-useless-array-from'],
1416
['remove-useless-variables/for-of', 'for-of/remove-useless-variables"'],
1517
]);
18+
19+
export {
20+
report,
21+
fix,
22+
traverse,
23+
};

packages/plugin-putout-config/lib/apply-for-of/index.spec.js

+3-5
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 './index.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
['putout-config/apply-for-of', plugin],
97
],
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,16 @@
1-
'use strict';
1+
import {createRenameProperty} from '../rename-property.js';
22

3-
const {createRenameProperty} = require('../rename-property');
4-
5-
module.exports = createRenameProperty([
3+
const {
4+
report,
5+
fix,
6+
traverse,
7+
} = createRenameProperty([
68
['remove-unused-labels', 'labels/remove-unused'],
79
['convert-label-to-object', 'labels/convert-to-object'],
810
]);
11+
12+
export {
13+
report,
14+
fix,
15+
traverse,
16+
};

packages/plugin-putout-config/lib/apply-labels/index.spec.js

+3-5
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 './index.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-labels', plugin],
97
],
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,18 @@
1-
'use strict';
1+
import {createRenameProperty} from '../rename-property.js';
22

3-
const {createRenameProperty} = require('../rename-property');
4-
5-
module.exports = createRenameProperty([
3+
const {
4+
report,
5+
fix,
6+
traverse,
7+
} = createRenameProperty([
68
['convert-math-pow', 'math/apply-exponential'],
79
['apply-numeric-separators', 'math/apply-numeric-separators'],
810
['convert-imul-to-multiplication', 'math/apply-multiplication'],
911
['convert-sqrt-to-hypot', 'math/convert-sqrt-to-hypot'],
1012
]);
13+
14+
export {
15+
report,
16+
fix,
17+
traverse,
18+
};

packages/plugin-putout-config/lib/apply-math/index.spec.js

+3-5
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 './index.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-math', plugin],
97
],
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,24 @@
1-
'use strict';
2-
3-
const {createRenameProperty} = require('../rename-property');
1+
import {createRenameProperty} from '../rename-property.js';
42

53
const v24 = [
64
['remove-process-exit', 'nodejs/remove-process-exit'],
75
['convert-top-level-return', 'nodejs/convert-top-level-return'],
86
];
97

10-
module.exports = createRenameProperty([
8+
const {
9+
report,
10+
fix,
11+
traverse,
12+
} = createRenameProperty([
1113
...v24,
1214
['strict-mode/add-missing', 'nodejs/add-missing-strict-mode'],
1315
['strict-mode/remove-useless', 'nodejs/remove-useless-strict-mode'],
1416
['convert-esm-to-commonjs', 'nodejs/convert-esm-to-commonjs'],
1517
['convert-commonjs-to-esm', 'nodejs/convert-commonjs-to-esm'],
1618
]);
19+
20+
export {
21+
report,
22+
fix,
23+
traverse,
24+
};

packages/plugin-putout-config/lib/apply-nodejs/index.spec.js

+3-5
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 './index.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-nodejs', plugin],
97
],
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
'use strict';
2-
3-
const {createRenameProperty} = require('../rename-property');
1+
import {createRenameProperty} from '../rename-property.js';
42

53
const v37 = [
64
['convert-optional-to-logical/assign', 'optional-chaining/convert-optional-assign-to-logical'],
@@ -9,4 +7,14 @@ const v37 = [
97
['apply-optional-chaining/use', 'optional-chaining/convert-logical-to-optional'],
108
];
119

12-
module.exports = createRenameProperty(v37);
10+
const {
11+
report,
12+
fix,
13+
traverse,
14+
} = createRenameProperty(v37);
15+
16+
export {
17+
report,
18+
fix,
19+
traverse,
20+
};

packages/plugin-putout-config/lib/apply-optional-chaining/index.spec.js

+3-5
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 './index.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-optional-chaining', plugin],
97
],
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,17 @@
1-
'use strict';
2-
3-
const {createRenameProperty} = require('../rename-property');
1+
import {createRenameProperty} from '../rename-property.js';
42

53
const v37 = [
64
['add-missing-parens', 'parens/add-missing'],
75
];
86

9-
module.exports = createRenameProperty(v37);
7+
const {
8+
report,
9+
fix,
10+
traverse,
11+
} = createRenameProperty(v37);
12+
13+
export {
14+
report,
15+
fix,
16+
traverse,
17+
};

packages/plugin-putout-config/lib/apply-parens/index.spec.js

+3-5
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 './index.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-parens', plugin],
97
],
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,15 @@
1-
'use strict';
1+
import {createRenameProperty} from '../rename-property.js';
22

3-
const {createRenameProperty} = require('../rename-property');
4-
5-
module.exports = createRenameProperty([
3+
const {
4+
report,
5+
fix,
6+
traverse,
7+
} = createRenameProperty([
68
['remove-useless-variables/await', 'promises/remove-useless-variables'],
79
]);
10+
11+
export {
12+
report,
13+
fix,
14+
traverse,
15+
};

packages/plugin-putout-config/lib/apply-promises/index.spec.js

+3-5
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 './index.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-promises', plugin],
97
],
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,18 @@
1-
'use strict';
1+
import {createRenameProperty} from '../rename-property.js';
22

3-
const {createRenameProperty} = require('../rename-property');
4-
5-
module.exports = createRenameProperty([
3+
const {
4+
report,
5+
fix,
6+
traverse,
7+
} = createRenameProperty([
68
['apply-early-return', 'return/apply-early'],
79
['remove-useless-return', 'return/remove-useless'],
810
['simplify-boolean-return', 'return/simplify-boolean'],
911
['convert-break-to-return', 'return/convert-from-break'],
1012
]);
13+
14+
export {
15+
report,
16+
fix,
17+
traverse,
18+
};

packages/plugin-putout-config/lib/apply-return/index.spec.js

+3-5
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 './index.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-return', plugin],
97
],

0 commit comments

Comments
 (0)