Skip to content

Commit dcc460b

Browse files
committed
Fix linter complaints
1 parent 8e9e570 commit dcc460b

File tree

10 files changed

+15
-18
lines changed

10 files changed

+15
-18
lines changed

src/createTag/createTag.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ function getInterimTag(originalTag, extraTag) {
3333
function getTagCallInfo(transformers) {
3434
return {
3535
transformers,
36-
context: transformers.map(transformer =>
36+
context: transformers.map((transformer) =>
3737
transformer.getInitialContext ? transformer.getInitialContext() : {},
3838
),
3939
};
@@ -98,7 +98,7 @@ export default function createTag(...rawTransformers) {
9898

9999
// if the first argument is an array, return a transformed end result of processing the template with our tag
100100
const processedTemplate = strings
101-
.map(string => applyHook0(tagCallInfo, 'onString', string))
101+
.map((string) => applyHook0(tagCallInfo, 'onString', string))
102102
.reduce((result, string, index) =>
103103
''.concat(
104104
result,

src/createTag/createTag.test.js

+1-4
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,7 @@ test('transformer methods are optional', () => {
1919
});
2020
const noStringNorEnd = createTag({
2121
onSubstitution(sub) {
22-
return sub
23-
.split('')
24-
.reverse()
25-
.join('');
22+
return sub.split('').reverse().join('');
2623
},
2724
});
2825
expect(noMethods`foo`).toBe('foo');

src/html/html.test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ test('renders HTML, including arrays', () => {
1010
const actual = html`
1111
<h1>${val}${nil}</h1>
1212
<ul>
13-
${fruits.map(fruit => `<li>${fruit}</li>`)}
13+
${fruits.map((fruit) => `<li>${fruit}</li>`)}
1414
</ul>
1515
`;
1616

src/index.test.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,15 @@ function requireModule(module) {
1717
test('common-tags exports all the right modules directly', () => {
1818
const modules = context.modules;
1919
expect.assertions(modules.length);
20-
modules.forEach(module => {
20+
modules.forEach((module) => {
2121
expect(requireModule(module)).toBeDefined();
2222
});
2323
});
2424

2525
test('common-tags exports all the right modules as props', () => {
2626
const modules = context.modules;
2727
expect.assertions(modules.length);
28-
modules.forEach(module => {
28+
modules.forEach((module) => {
2929
expect(require('./index')).toHaveProperty(module, requireModule(module));
3030
});
3131
});

src/removeNonPrintingValuesTransformer/removeNonPrintingValuesTransformer.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const isValidValue = x =>
1+
const isValidValue = (x) =>
22
x != null && !Number.isNaN(x) && typeof x !== 'boolean';
33

44
const removeNonPrintingValuesTransformer = () => ({

src/safeHtml/safeHtml.test.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ test('renders HTML, including arrays', () => {
99
const actual = safeHtml`
1010
<h1>${val}</h1>
1111
<ul>
12-
${fruits.map(fruit => `${fruit}`)}
12+
${fruits.map((fruit) => `${fruit}`)}
1313
</ul>
1414
`;
1515
expect(actual).toBe(expected);
@@ -34,7 +34,7 @@ test('correctly escapes HTML tags on substitution', () => {
3434
const actual = safeHtml`
3535
<h1>${val}</h1>
3636
<ul>
37-
${fruits.map(fruit => `${fruit}`)}
37+
${fruits.map((fruit) => `${fruit}`)}
3838
</ul>
3939
`;
4040
expect(actual).toBe(expected);

src/splitStringTransformer/splitStringTransformer.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const splitStringTransformer = splitBy => {
1+
const splitStringTransformer = (splitBy) => {
22
if (typeof splitBy !== 'string') {
33
throw new Error('You need to specify a string character to split by.');
44
}

src/stripIndentTransformer/stripIndentTransformer.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const stripIndentTransformer = (type = 'initial') => {
1919

2020
// remove the shortest leading indentation from each line
2121
const match = endResult.match(/^[^\S\n]*(?=\S)/gm);
22-
const indent = match && Math.min(...match.map(el => el.length));
22+
const indent = match && Math.min(...match.map((el) => el.length));
2323
if (indent) {
2424
const regexp = new RegExp(`^.{${indent}}`, 'gm');
2525
return endResult.replace(regexp, '');

src/testUtils/index.test.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,15 @@ function requireModule(module) {
1717
test('test utils exports all the right modules directly', () => {
1818
const modules = context.modules;
1919
expect.assertions(modules.length);
20-
modules.forEach(module => {
20+
modules.forEach((module) => {
2121
expect(requireModule(module)).toBeDefined();
2222
});
2323
});
2424

2525
test('test utils exports all the right modules as props', () => {
2626
const modules = context.modules;
2727
expect.assertions(modules.length);
28-
modules.forEach(module => {
28+
modules.forEach((module) => {
2929
expect(require('./index')).toHaveProperty(module, requireModule(module));
3030
});
3131
});

src/utils/index.test.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,15 @@ function requireModule(module) {
1717
test('utils exports all the right modules directly', () => {
1818
const modules = context.modules;
1919
expect.assertions(modules.length);
20-
modules.forEach(module => {
20+
modules.forEach((module) => {
2121
expect(requireModule(module)).toBeDefined();
2222
});
2323
});
2424

2525
test('utils exports all the right modules as props', () => {
2626
const modules = context.modules;
2727
expect.assertions(modules.length);
28-
modules.forEach(module => {
28+
modules.forEach((module) => {
2929
expect(require('./index')).toHaveProperty(module, requireModule(module));
3030
});
3131
});

0 commit comments

Comments
 (0)