Skip to content

Commit 97a1617

Browse files
committed
chore: lint
1 parent b494454 commit 97a1617

File tree

51 files changed

+262
-371
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+262
-371
lines changed

codemods/convert-pascal-to-camel/lib/pascal-to-camel.js

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -69,13 +69,11 @@ function isBig({node}) {
6969
return /[A-Z]/.test(node.name[0]);
7070
}
7171

72-
function checkBig(query, push) {
73-
return (path) => {
74-
const keyPath = path.get(query);
75-
76-
if (!isBig(keyPath))
77-
return;
78-
79-
push(keyPath);
80-
};
81-
}
72+
const checkBig = (query, push) => (path) => {
73+
const keyPath = path.get(query);
74+
75+
if (!isBig(keyPath))
76+
return;
77+
78+
push(keyPath);
79+
};

packages/babel-plugin-putout/test/index.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,7 @@ const {
1111

1212
const plugin = require('..');
1313

14-
function trim(str) {
15-
return str.replace(/^\s+|\s+$/, '');
16-
}
14+
const trim = (str) => str.replace(/^\s+|\s+$/, '');
1715

1816
const fixturesDir = path.join(__dirname, 'fixture');
1917

packages/cli-cache/lib/cache.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,8 @@ const canUseCache = ({fileCache, getOptionsHash}) => (name, options) => {
126126
return !places.length;
127127
};
128128

129-
const hash = (a) => murmur(a).result()
129+
const hash = (a) => murmur(a)
130+
.result()
130131
.toString(36);
131132

132133
const createGetOptionsCache = ({version}) => (options) => {

packages/cli-keypress/lib/keypress.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,10 @@ const IS_NOT_SET = () => false;
1313
const {KEYPRESS} = process.env;
1414

1515
const isKeypress = (a) => a.name === '__keypress';
16-
const isSet = (a, b) => a.listeners(b).filter(isKeypress).length;
16+
const isSet = (a, b) => a
17+
.listeners(b)
18+
.filter(isKeypress)
19+
.length;
1720

1821
module.exports = (stream = process.stdin) => {
1922
if (!stream.isTTY || isCI && KEYPRESS !== '1')

packages/cli-ruler/lib/rule-processor.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,4 @@ export const enableAll = (places, config) => {
6969
return config;
7070
};
7171

72-
function parseRules(places) {
73-
return places.map(getRule);
74-
}
72+
const parseRules = (places) => places.map(getRule);

packages/compare/lib/vars.spec.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -596,9 +596,7 @@ test('putout: compare: vars: "__a"', (t) => {
596596
},
597597
};
598598

599-
path
600-
.get('arguments.0')
601-
.replaceWith(regexp);
599+
path.get('arguments.0').replaceWith(regexp);
602600
return path.node;
603601
},
604602
}),

packages/engine-loader/lib/index.js

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -74,15 +74,11 @@ module.exports.loadPlugins = (options) => {
7474
});
7575
};
7676

77-
function splitRule(rule) {
78-
return [rule, 'putout'];
79-
}
77+
const splitRule = (rule) => [rule, 'putout'];
8078

81-
function parseRule(rule) {
82-
return rule
83-
.replace('import:@putout/plugin-', '')
84-
.replace('@putout/plugin-', '');
85-
}
79+
const parseRule = (rule) => rule
80+
.replace('import:@putout/plugin-', '')
81+
.replace('@putout/plugin-', '');
8682

8783
const maybeFromTuple = (a) => isArray(a) ? a[1] : a;
8884

packages/engine-loader/lib/plugins/load-plugins-async.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,7 @@ module.exports.loadPluginsAsync = async (options) => {
3737
});
3838
};
3939

40-
function splitRule(rule) {
41-
return [rule, 'putout'];
42-
}
40+
const splitRule = (rule) => [rule, 'putout'];
4341

4442
async function loadPlugins({items, loadedRules}) {
4543
const promises = [];

packages/engine-parser/lib/parse.js

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -33,19 +33,17 @@ module.exports = (source, options) => {
3333
});
3434
};
3535

36-
function getParser({parser = 'babel', isTS, isFlow, isJSX, printer}) {
37-
return {
38-
parse(source) {
39-
const ast = toBabel(customParser(source, parser, {
40-
isTS,
41-
isFlow,
42-
isJSX,
43-
}));
44-
45-
if (printer === 'recast')
46-
moveOutDirectives(ast);
47-
48-
return ast;
49-
},
50-
};
51-
}
36+
const getParser = ({parser = 'babel', isTS, isFlow, isJSX, printer}) => ({
37+
parse(source) {
38+
const ast = toBabel(customParser(source, parser, {
39+
isTS,
40+
isFlow,
41+
isJSX,
42+
}));
43+
44+
if (printer === 'recast')
45+
moveOutDirectives(ast);
46+
47+
return ast;
48+
},
49+
});

packages/engine-parser/lib/print.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ const {isArray} = Array;
99

1010
const maybeArray = (a) => isArray(a) ? a : [a, {}];
1111

12-
const btoa = (a) => Buffer.from(a, 'binary').toString('base64');
12+
const btoa = (a) => Buffer
13+
.from(a, 'binary')
14+
.toString('base64');
1315

1416
const addSourceMap = (sourceMapName, {code, map}) => !sourceMapName ? code : `${code}\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,${btoa(stringify(map))}\n`;
1517
const fixStrictMode = (a) => a.replace(`\n\n\n'use strict'`, `\n\n'use strict'`);

0 commit comments

Comments
 (0)