Skip to content

Commit 795bfa2

Browse files
Merge branch 'feature/fix-jest-lint-errors' into develop
2 parents 0282ca8 + eb23ba1 commit 795bfa2

File tree

4 files changed

+18
-21
lines changed

4 files changed

+18
-21
lines changed

demo/index.html

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
<!-- Google Tag Manager -->
2020
<script>
21-
(function(w, d, s, l, i) {
21+
(function (w, d, s, l, i) {
2222
w[l] = w[l] || [];
2323
w[l].push({
2424
'gtm.start': new Date().getTime(),
@@ -52,7 +52,7 @@
5252
src="https://www.googletagmanager.com/ns.html?id=GTM-W4BK9P"
5353
height="0"
5454
width="0"
55-
style="display:none;visibility:hidden"
55+
style="display: none; visibility: hidden"
5656
>
5757
</iframe>
5858
</noscript>
@@ -97,9 +97,7 @@
9797

9898
<div class="form-inline">
9999
<div class="form-group">
100-
<label for="delimiter">
101-
Words/phrases are separated by:
102-
</label>
100+
<label for="delimiter"> Words/phrases are separated by: </label>
103101
<select
104102
id="delimiter"
105103
class="form-control js-delimiter track-field"
@@ -117,9 +115,7 @@
117115
id="case"
118116
class="form-check-input js-case track-field"
119117
/>
120-
<label class="form-check-label" for="case">
121-
Case-sensitive
122-
</label>
118+
<label class="form-check-label" for="case"> Case-sensitive </label>
123119
</div>
124120

125121
<div class="form-group form-check">
@@ -149,9 +145,7 @@
149145
<div class="container">
150146
<section class="output">
151147
<div class="form-group">
152-
<label for="output">
153-
Matching Regular Expression:
154-
</label>
148+
<label for="output"> Matching Regular Expression: </label>
155149
<textarea
156150
readonly="readonly"
157151
id="output"

demo/src/utils/wordList.spec.ts

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@ const { Preserve, TrimLeadingAndTrailing } = WhitespaceHandling;
55
describe('parseString', () => {
66
it.each(['', null, undefined])(
77
'returns an empty array when input string is %p',
8-
input => {
8+
(input) => {
99
const wordList = parseString(input as string, ',', Preserve);
1010
expect(wordList).toEqual([]);
1111
}
1212
);
1313

1414
it.each(['', null, undefined])(
1515
'returns entire input string in array when delimiter is %p',
16-
testDelimiter => {
16+
(testDelimiter) => {
1717
const delimiter = testDelimiter as string;
1818
const wordList = parseString(' some input string ', delimiter, Preserve);
1919
expect(wordList).toEqual([' some input string ']);
@@ -22,7 +22,7 @@ describe('parseString', () => {
2222

2323
it.each([',', '\n', '\t'])(
2424
'returns entire input string in array when delimiter %p is not present in input string',
25-
delimiter => {
25+
(delimiter) => {
2626
const wordList = parseString(' some input string ', delimiter, Preserve);
2727
expect(wordList).toEqual([' some input string ']);
2828
}
@@ -40,10 +40,13 @@ describe('parseString', () => {
4040
it.each([
4141
['foo Bar b@z ', ' '],
4242
['foo Bar b@z ', ' '],
43-
])('splits input string %p by delimiter %p', (inputString, delimiter) => {
44-
const wordList = parseString(inputString, delimiter, Preserve);
45-
expect(wordList).toEqual(['foo', 'Bar', 'b@z', '']);
46-
});
43+
])(
44+
'splits input string %p by whitespace delimiter %p',
45+
(inputString, delimiter) => {
46+
const wordList = parseString(inputString, delimiter, Preserve);
47+
expect(wordList).toEqual(['foo', 'Bar', 'b@z', '']);
48+
}
49+
);
4750

4851
it('splits multiline input string by newline delimiter', () => {
4952
const input = `foo

demo/src/utils/wordList.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export function parseString(
1919
let words = raw.split(delimiter);
2020

2121
if (whitespaceHandling === WhitespaceHandling.TrimLeadingAndTrailing) {
22-
words = words.map(word => word.trim());
22+
words = words.map((word) => word.trim());
2323
}
2424

2525
return words;

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"build:demo": "wp --config demo/webpack.config.js",
2424
"build:types": "tsc -p ./tsconfig.types.json",
2525
"clean": "rimraf lib/*",
26-
"format": "prettier --write 'src/**'",
26+
"format": "prettier --write 'src/**' 'demo/**'",
2727
"lint": "run-s lint:*",
2828
"lint:src": "tsc -p ./tsconfig.json && eslint ./src --report-unused-disable-directives --ext .js,.ts --parser-options=project:./tsconfig.json",
2929
"lint:demo": "tsc -p ./demo/tsconfig.json && eslint ./demo --report-unused-disable-directives --ext .js,.ts --parser-options=project:./demo/tsconfig.json",
@@ -61,7 +61,7 @@
6161
"jest": "^26.0.0",
6262
"jest-when": "^3.1.0",
6363
"npm-run-all": "^4.1.5",
64-
"prettier": "^2.2.1",
64+
"prettier": "2.2.1",
6565
"pretty-quick": "^3.1.0",
6666
"regex-to-strings": "^2.0.1",
6767
"rimraf": "^3.0.2",

0 commit comments

Comments
 (0)