Skip to content

Commit 436333e

Browse files
committed
ci: add test and lint jobs to ci
1 parent e58ecbc commit 436333e

File tree

10 files changed

+48
-28
lines changed

10 files changed

+48
-28
lines changed

.editorconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,6 @@ insert_final_newline = true
1010
charset = utf-8
1111
indent_style = space
1212
indent_size = 4
13+
14+
[*.{yml,yaml}]
15+
indent_size = 2

.gitlab-ci.yml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,20 @@
1+
before_script:
2+
- npm ci --ignore-scripts --force
3+
4+
build:
5+
stage: build
6+
script: npm run build
7+
only:
8+
- merge_requests
9+
10+
lint:
11+
stage: test
12+
script: npm run lint
13+
only:
14+
- merge_requests
15+
116
test:
217
stage: test
3-
script: npm ci --ignore-scripts --force && npm run test
18+
script: npm run test
419
only:
520
- merge_requests

dist/squire-raw.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -338,11 +338,13 @@
338338
if (!child || isLeaf(child)) {
339339
if (startOffset) {
340340
child = startContainer.childNodes[startOffset - 1];
341-
let prev = child.previousSibling;
342-
while (child instanceof Text && !child.length && prev && prev instanceof Text) {
343-
child.remove();
344-
child = prev;
345-
continue;
341+
const prev = child.previousSibling;
342+
if (prev && prev instanceof Text) {
343+
while (child instanceof Text && !child.length) {
344+
child.remove();
345+
child = prev;
346+
continue;
347+
}
346348
}
347349
if (child instanceof Text) {
348350
startContainer = child;

dist/squire-raw.mjs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -340,11 +340,13 @@ var moveRangeBoundariesDownTree = (range) => {
340340
if (!child || isLeaf(child)) {
341341
if (startOffset) {
342342
child = startContainer.childNodes[startOffset - 1];
343-
let prev = child.previousSibling;
344-
while (child instanceof Text && !child.length && prev && prev instanceof Text) {
345-
child.remove();
346-
child = prev;
347-
continue;
343+
const prev = child.previousSibling;
344+
if (prev && prev instanceof Text) {
345+
while (child instanceof Text && !child.length) {
346+
child.remove();
347+
child = prev;
348+
continue;
349+
}
348350
}
349351
if (child instanceof Text) {
350352
startContainer = child;

dist/squire.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/squire.js.map

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/squire.mjs

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

dist/squire.mjs.map

Lines changed: 2 additions & 2 deletions
Large diffs are not rendered by default.

source/node/MergeSplit.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ const fixContainer = (
6060
root: Element | DocumentFragment,
6161
): Node => {
6262
let wrapper: HTMLElement | null = null;
63-
[...container.childNodes].forEach(child => {
63+
[...container.childNodes].forEach((child) => {
6464
const isBR = child.nodeName === 'BR';
6565
if (!isBR && isInline(child)) {
6666
if (!wrapper) {

source/range/Boundaries.ts

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -48,19 +48,17 @@ const moveRangeBoundariesDownTree = (range: Range): void => {
4848
if (!child || isLeaf(child)) {
4949
if (startOffset) {
5050
child = startContainer.childNodes[startOffset - 1];
51-
let prev = child.previousSibling;
51+
const prev = child.previousSibling;
5252
// If we have an empty text node next to another text node,
5353
// just skip and remove it.
54-
while (
55-
child instanceof Text &&
56-
!child.length &&
57-
prev &&
58-
prev instanceof Text
59-
) {
60-
child.remove();
61-
child = prev;
62-
continue;
54+
if (prev && prev instanceof Text) {
55+
while (child instanceof Text && !child.length) {
56+
child.remove();
57+
child = prev;
58+
continue;
59+
}
6360
}
61+
6462
if (child instanceof Text) {
6563
startContainer = child;
6664
startOffset = child.data.length;

0 commit comments

Comments
 (0)