ESLint: Added semi rule (#2836)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719
diff --git a/.eslintrc.js b/.eslintrc.js
index d9782df..2552545 100644
--- a/.eslintrc.js
+++ b/.eslintrc.js
@@ -5,6 +5,7 @@ module.exports = {
rules: {
// stylistic rules
'quotes': ['warn', 'single', { avoidEscape: true, allowTemplateLiterals: true }],
+ 'semi': 'warn',
// I turned this rule off because we use `hasOwnProperty` in a lot of places
// TODO: Think about re-enabling this rule
diff --git a/assets/code.js b/assets/code.js
index 70c42b5..23c600e 100644
--- a/assets/code.js
+++ b/assets/code.js
@@ -124,7 +124,7 @@ if (toc.children.length > 0) {
if (PrefixFree.functions.indexOf('calc') == -1) {
var style = document.createElement('_').style;
- style.width = 'calc(1px + 1%)'
+ style.width = 'calc(1px + 1%)';
if(!style.width) {
// calc not supported
diff --git a/assets/download.js b/assets/download.js
index a7bbd87..2b4f2c1 100644
--- a/assets/download.js
+++ b/assets/download.js
@@ -62,7 +62,7 @@ if (hstr) {
if (components[category][id]) {
if (components[category][id].option !== 'default') {
if (typeof components[category][id] === 'string') {
- components[category][id] = { title: components[category][id] }
+ components[category][id] = { title: components[category][id] };
}
components[category][id].option = 'default';
}
diff --git a/assets/examples.js b/assets/examples.js
index 4ce38bc..ff9f6a5 100644
--- a/assets/examples.js
+++ b/assets/examples.js
@@ -160,7 +160,7 @@ function buildContentsHeader(id) {
header += ':';
header += '<ul>';
deps.forEach(function (text) {
- header += '<li>' + text + '.</li>'
+ header += '<li>' + text + '.</li>';
});
header += '</ul>';
}
diff --git a/components/prism-cil.js b/components/prism-cil.js
index e2b4934..f0f5963 100644
--- a/components/prism-cil.js
+++ b/components/prism-cil.js
@@ -24,4 +24,4 @@ Prism.languages.cil = {
'number': /\b-?(?:0x[0-9a-fA-F]+|[0-9]+)(?:\.[0-9a-fA-F]+)?\b/i,
'punctuation': /[{}[\];(),:=]|IL_[0-9A-Za-z]+/
-}
+};
diff --git a/components/prism-cpp.js b/components/prism-cpp.js
index b771da1..1775278 100644
--- a/components/prism-cpp.js
+++ b/components/prism-cpp.js
@@ -1,7 +1,7 @@
(function (Prism) {
var keyword = /\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char8_t|char16_t|char32_t|class|compl|concept|const|consteval|constexpr|constinit|const_cast|continue|co_await|co_return|co_yield|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|final|float|for|friend|goto|if|import|inline|int|int8_t|int16_t|int32_t|int64_t|uint8_t|uint16_t|uint32_t|uint64_t|long|module|mutable|namespace|new|noexcept|nullptr|operator|override|private|protected|public|register|reinterpret_cast|requires|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/;
- var modName = /\b(?!<keyword>)\w+(?:\s*\.\s*\w+)*\b/.source.replace(/<keyword>/g, function () { return keyword.source; })
+ var modName = /\b(?!<keyword>)\w+(?:\s*\.\s*\w+)*\b/.source.replace(/<keyword>/g, function () { return keyword.source; });
Prism.languages.cpp = Prism.languages.extend('c', {
'class-name': [
diff --git a/components/prism-csharp.js b/components/prism-csharp.js
index 3520128..671e2be 100644
--- a/components/prism-csharp.js
+++ b/components/prism-csharp.js
@@ -69,7 +69,7 @@
var identifier = replace(/(?!<<0>>)<<1>>(?:\s*\.\s*<<1>>)*/.source, [nonTypeKeywords, genericName]);
var array = /\[\s*(?:,\s*)*\]/.source;
var typeExpressionWithoutTuple = replace(/<<0>>(?:\s*(?:\?\s*)?<<1>>)*(?:\s*\?)?/.source, [identifier, array]);
- var tupleElement = replace(/[^,()<>[\];=+\-*/%&|^]|<<0>>|<<1>>|<<2>>/.source, [generic, nestedRound, array])
+ var tupleElement = replace(/[^,()<>[\];=+\-*/%&|^]|<<0>>|<<1>>|<<2>>/.source, [generic, nestedRound, array]);
var tuple = replace(/\(<<0>>+(?:,<<0>>+)+\)/.source, [tupleElement]);
var typeExpression = replace(/(?:<<0>>|<<1>>)(?:\s*(?:\?\s*)?<<2>>)*(?:\s*\?)?/.source, [tuple, identifier, array]);
@@ -308,10 +308,10 @@
// string interpolation
var formatString = /:[^}\r\n]+/.source;
// multi line
- var mInterpolationRound = nested(replace(/[^"'/()]|<<0>>|\(<<self>>*\)/.source, [regularStringCharacterOrComment]), 2)
+ var mInterpolationRound = nested(replace(/[^"'/()]|<<0>>|\(<<self>>*\)/.source, [regularStringCharacterOrComment]), 2);
var mInterpolation = replace(/\{(?!\{)(?:(?![}:])<<0>>)*<<1>>?\}/.source, [mInterpolationRound, formatString]);
// single line
- var sInterpolationRound = nested(replace(/[^"'/()]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|<<0>>|\(<<self>>*\)/.source, [regularStringOrCharacter]), 2)
+ var sInterpolationRound = nested(replace(/[^"'/()]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|<<0>>|\(<<self>>*\)/.source, [regularStringOrCharacter]), 2);
var sInterpolation = replace(/\{(?!\{)(?:(?![}:])<<0>>)*<<1>>?\}/.source, [sInterpolationRound, formatString]);
function createInterpolationInside(interpolation, interpolationRound) {
diff --git a/components/prism-dns-zone-file.js b/components/prism-dns-zone-file.js
index e2518ca..7829ac2 100644
--- a/components/prism-dns-zone-file.js
+++ b/components/prism-dns-zone-file.js
@@ -30,4 +30,4 @@ Prism.languages['dns-zone-file'] = {
'punctuation': /[()]/
};
-Prism.languages['dns-zone'] = Prism.languages['dns-zone-file']
+Prism.languages['dns-zone'] = Prism.languages['dns-zone-file'];
diff --git a/components/prism-haml.js b/components/prism-haml.js
index 4ec10b8..eda53ca 100644
--- a/components/prism-haml.js
+++ b/components/prism-haml.js
@@ -133,7 +133,7 @@
},
rest: Prism.languages[filter.language]
}
- }
+ };
}
}
diff --git a/components/prism-icu-message-format.js b/components/prism-icu-message-format.js
index c5dfeb8..7b9de16 100644
--- a/components/prism-icu-message-format.js
+++ b/components/prism-icu-message-format.js
@@ -12,7 +12,7 @@
if (level <= 0) {
return /[]/.source;
} else {
- return source.replace(/<SELF>/g, function () { return nested(source, level - 1) });
+ return source.replace(/<SELF>/g, function () { return nested(source, level - 1); });
}
}
diff --git a/components/prism-ignore.js b/components/prism-ignore.js
index 597516b..b81ac28 100644
--- a/components/prism-ignore.js
+++ b/components/prism-ignore.js
@@ -16,8 +16,8 @@
}
};
- Prism.languages.gitignore = Prism.languages.ignore
- Prism.languages.hgignore = Prism.languages.ignore
- Prism.languages.npmignore = Prism.languages.ignore
+ Prism.languages.gitignore = Prism.languages.ignore;
+ Prism.languages.hgignore = Prism.languages.ignore;
+ Prism.languages.npmignore = Prism.languages.ignore;
}(Prism));
diff --git a/components/prism-javadoc.js b/components/prism-javadoc.js
index c0c3151..6e0219e 100644
--- a/components/prism-javadoc.js
+++ b/components/prism-javadoc.js
@@ -3,7 +3,7 @@
var codeLinePattern = /(^(?:\s*(?:\*\s*)*))[^*\s].*$/m;
var memberReference = /#\s*\w+(?:\s*\([^()]*\))?/.source;
- var reference = /(?:[a-zA-Z]\w+\s*\.\s*)*[A-Z]\w*(?:\s*<mem>)?|<mem>/.source.replace(/<mem>/g, function () { return memberReference });
+ var reference = /(?:[a-zA-Z]\w+\s*\.\s*)*[A-Z]\w*(?:\s*<mem>)?|<mem>/.source.replace(/<mem>/g, function () { return memberReference; });
Prism.languages.javadoc = Prism.languages.extend('javadoclike', {});
Prism.languages.insertBefore('javadoc', 'keyword', {
diff --git a/components/prism-jq.js b/components/prism-jq.js
index ee44b3a..a1dd435 100644
--- a/components/prism-jq.js
+++ b/components/prism-jq.js
@@ -60,7 +60,7 @@
pattern: /\./,
alias: 'important'
}
- }
+ };
stringInterpolation.interpolation.inside.content.inside = jq;
diff --git a/components/prism-json5.js b/components/prism-json5.js
index 855e6d5..c8cccad 100644
--- a/components/prism-json5.js
+++ b/components/prism-json5.js
@@ -1,6 +1,6 @@
(function (Prism) {
- var string = /("|')(?:\\(?:\r\n?|\n|.)|(?!\1)[^\\\r\n])*\1/
+ var string = /("|')(?:\\(?:\r\n?|\n|.)|(?!\1)[^\\\r\n])*\1/;
Prism.languages.json5 = Prism.languages.extend('json', {
'property': [
diff --git a/components/prism-jsstacktrace.js b/components/prism-jsstacktrace.js
index cab1224..479903a 100644
--- a/components/prism-jsstacktrace.js
+++ b/components/prism-jsstacktrace.js
@@ -45,4 +45,4 @@ Prism.languages.jsstacktrace = {
}
}
-}
+};
diff --git a/components/prism-jsx.js b/components/prism-jsx.js
index 434e695..b1adb39 100644
--- a/components/prism-jsx.js
+++ b/components/prism-jsx.js
@@ -105,7 +105,7 @@ var walkTokens = function (tokens) {
openedTags[openedTags.length - 1].openedBraces--;
} else {
- notTagNorBrace = true
+ notTagNorBrace = true;
}
}
if (notTagNorBrace || typeof token === 'string') {
diff --git a/components/prism-markdown.js b/components/prism-markdown.js
index 5c2ca6f..715b1ff 100644
--- a/components/prism-markdown.js
+++ b/components/prism-markdown.js
@@ -297,7 +297,7 @@
// this might be a language that Prism does not support
// do some replacements to support C++, C#, and F#
- var lang = codeLang.content.replace(/\b#/g, 'sharp').replace(/\b\+\+/g, 'pp')
+ var lang = codeLang.content.replace(/\b#/g, 'sharp').replace(/\b\+\+/g, 'pp');
// only use the first word
lang = (/[a-z][\w-]*/i.exec(lang) || [''])[0].toLowerCase();
var alias = 'language-' + lang;
diff --git a/components/prism-nevod.js b/components/prism-nevod.js
index 6a8d216..398238b 100644
--- a/components/prism-nevod.js
+++ b/components/prism-nevod.js
@@ -122,4 +122,4 @@ Prism.languages.nevod = {
],
'punctuation': /[:;,()]/,
'name': /[a-zA-Z0-9\-.]+/
-}
+};
diff --git a/components/prism-powerquery.js b/components/prism-powerquery.js
index 7abf0ad..fb21d84 100644
--- a/components/prism-powerquery.js
+++ b/components/prism-powerquery.js
@@ -52,4 +52,4 @@ Prism.languages.powerquery = {
};
Prism.languages.pq = Prism.languages['powerquery'];
-Prism.languages.mscript = Prism.languages['powerquery']
\ No newline at end of file
+Prism.languages.mscript = Prism.languages['powerquery'];
\ No newline at end of file
diff --git a/components/prism-pug.js b/components/prism-pug.js
index 49877db..78ccd29 100644
--- a/components/prism-pug.js
+++ b/components/prism-pug.js
@@ -174,7 +174,7 @@
},
rest: Prism.languages[filter.language]
}
- }
+ };
}
}
diff --git a/components/prism-qsharp.js b/components/prism-qsharp.js
index 25198db..2e97ade 100644
--- a/components/prism-qsharp.js
+++ b/components/prism-qsharp.js
@@ -46,7 +46,7 @@
type: 'Adj BigInt Bool Ctl Double false Int One Pauli PauliI PauliX PauliY PauliZ Qubit Range Result String true Unit Zero',
// all other keywords
other: 'Adjoint adjoint apply as auto body borrow borrowing Controlled controlled distribute elif else fail fixup for function if in internal intrinsic invert is let mutable namespace new newtype open operation repeat return self set until use using while within'
- }
+ };
// keywords
function keywordsToPattern(words) {
return '\\b(?:' + words.trim().replace(/ /g, '|') + ')\\b';
diff --git a/components/prism-regex.js b/components/prism-regex.js
index 6d7c301..ca4a453 100644
--- a/components/prism-regex.js
+++ b/components/prism-regex.js
@@ -101,4 +101,4 @@
}
};
-}(Prism))
+}(Prism));
diff --git a/components/prism-splunk-spl.js b/components/prism-splunk-spl.js
index b9ec3fc..47dbcdf 100644
--- a/components/prism-splunk-spl.js
+++ b/components/prism-splunk-spl.js
@@ -21,4 +21,4 @@ Prism.languages['splunk-spl'] = {
'boolean': /\b(?:f|false|t|true)\b/i,
'operator': /[<>=]=?|[-+*/%|]/,
'punctuation': /[()[\],]/
-}
+};
diff --git a/components/prism-xquery.js b/components/prism-xquery.js
index 8541263..5a4a9ba 100644
--- a/components/prism-xquery.js
+++ b/components/prism-xquery.js
@@ -118,7 +118,7 @@
openedTags[openedTags.length - 1].openedBraces--;
} else if (token.type !== 'comment') {
- notTagNorBrace = true
+ notTagNorBrace = true;
}
}
if (notTagNorBrace || typeof token === 'string') {
diff --git a/components/prism-yaml.js b/components/prism-yaml.js
index fe0a5b9..2cecda8 100644
--- a/components/prism-yaml.js
+++ b/components/prism-yaml.js
@@ -25,7 +25,7 @@
flags = (flags || '').replace(/m/g, '') + 'm'; // add m flag
var pattern = /([:\-,[{]\s*(?:\s<<prop>>[ \t]+)?)(?:<<value>>)(?=[ \t]*(?:$|,|]|}|(?:[\r\n]\s*)?#))/.source
.replace(/<<prop>>/g, function () { return properties; }).replace(/<<value>>/g, function () { return value; });
- return RegExp(pattern, flags)
+ return RegExp(pattern, flags);
}
Prism.languages.yaml = {
diff --git a/dangerfile.js b/dangerfile.js
index 76f4d15..36face9 100644
--- a/dangerfile.js
+++ b/dangerfile.js
@@ -54,7 +54,7 @@ const formatBytes = (bytes, decimals = 2) => {
const i = Math.floor(Math.log(Math.abs(bytes)) / Math.log(k));
return parseFloat((bytes / Math.pow(k, i)).toFixed(dm)) + ' ' + sizes[i];
-}
+};
const maybePlus = (from, to) => from < to ? '+' : '';
@@ -64,7 +64,7 @@ const absDiff = (from, to) => {
}
return `${maybePlus(from, to)}${formatBytes(to - from)}`;
-}
+};
const percDiff = (from, to) => {
if (from === to) {
@@ -72,7 +72,7 @@ const percDiff = (from, to) => {
}
return `${maybePlus(from, to)}${(100 * (to - from) / (from || to)).toFixed(1)}%`;
-}
+};
const getSummary = (rows, totalMasterFileSize, totalFileSize) => {
const numFiles = rows.length;
@@ -81,7 +81,7 @@ const getSummary = (rows, totalMasterFileSize, totalFileSize) => {
const percentDiff = percDiff(totalMasterFileSize, totalFileSize);
return `A total of ${numFiles} file${maybeS} have changed, with a combined diff of ${byteDiff} (${percentDiff}).`;
-}
+};
const run = async () => {
const minified = await getChangedMinifiedFiles();
@@ -107,7 +107,7 @@ const run = async () => {
]);
totalFileSize += fileSize;
- totalMasterFileSize += fileMasterSize
+ totalMasterFileSize += fileMasterSize;
rows.push([
file,
@@ -130,7 +130,7 @@ ${rows.map(row => `| ${row.join(' | ')} |`).join('\n')}
</details>
`);
-}
+};
run().catch(err => {
console.error(err);
diff --git a/gulpfile.js/changelog.js b/gulpfile.js/changelog.js
index 984dc67..899a3d7 100644
--- a/gulpfile.js/changelog.js
+++ b/gulpfile.js/changelog.js
@@ -369,7 +369,7 @@ async function changes() {
for (const subCategory of Object.keys(category).sort(strCompare)) {
if (subCategory) {
md += `${indentation}* __${subCategory}__\n`;
- printCategory(category[subCategory], indentation + ' ')
+ printCategory(category[subCategory], indentation + ' ');
} else {
for (const info of category['']) {
md += `${indentation}* ${infoToString(info)}\n`;
diff --git a/gulpfile.js/docs.js b/gulpfile.js/docs.js
index 1e5b1c8..0dcf919 100644
--- a/gulpfile.js/docs.js
+++ b/gulpfile.js/docs.js
@@ -65,7 +65,7 @@ module.exports = {
// error if used. So we just replace the "function" with some literal that JSDoc will interpret as a
// namespace. Not pretty but it works.
comment.comment = comment.comment
- .replace(/\bimport\s*\(\s*(?:"(?:[^"\r\n\\]|\\.)*"|'(?:[^'\r\n\\]|\\.)*')\s*\)/g, '__dyn_import__')
+ .replace(/\bimport\s*\(\s*(?:"(?:[^"\r\n\\]|\\.)*"|'(?:[^'\r\n\\]|\\.)*')\s*\)/g, '__dyn_import__');
}
}
};
diff --git a/plugins/autoloader/prism-autoloader.js b/plugins/autoloader/prism-autoloader.js
index 2da746f..035e47f 100644
--- a/plugins/autoloader/prism-autoloader.js
+++ b/plugins/autoloader/prism-autoloader.js
@@ -354,7 +354,7 @@
* @returns {string}
*/
function getLanguagePath(lang) {
- return config.languages_path + 'prism-' + lang + (config.use_minified ? '.min' : '') + '.js'
+ return config.languages_path + 'prism-' + lang + (config.use_minified ? '.min' : '') + '.js';
}
/**
diff --git a/plugins/copy-to-clipboard/prism-copy-to-clipboard.js b/plugins/copy-to-clipboard/prism-copy-to-clipboard.js
index 04d69c8..4721a2f 100644
--- a/plugins/copy-to-clipboard/prism-copy-to-clipboard.js
+++ b/plugins/copy-to-clipboard/prism-copy-to-clipboard.js
@@ -79,7 +79,7 @@
*/
function selectElementText(element) {
// https://stackoverflow.com/a/20079910/7595472
- window.getSelection().selectAllChildren(element)
+ window.getSelection().selectAllChildren(element);
}
/**
diff --git a/plugins/custom-class/prism-custom-class.js b/plugins/custom-class/prism-custom-class.js
index c2c6622..44b4ccf 100644
--- a/plugins/custom-class/prism-custom-class.js
+++ b/plugins/custom-class/prism-custom-class.js
@@ -63,7 +63,7 @@
prefix: function prefix(string) {
prefixString = string || '';
}
- }
+ };
Prism.hooks.add('wrap', function (env) {
if (adder) {
diff --git a/plugins/file-highlight/prism-file-highlight.js b/plugins/file-highlight/prism-file-highlight.js
index 79893a8..78c0def 100644
--- a/plugins/file-highlight/prism-file-highlight.js
+++ b/plugins/file-highlight/prism-file-highlight.js
@@ -140,6 +140,6 @@
logged = true;
}
Prism.plugins.fileHighlight.highlight.apply(this, arguments);
- }
+ };
})();
diff --git a/plugins/line-highlight/prism-line-highlight.js b/plugins/line-highlight/prism-line-highlight.js
index 1735e7c..652bfeb 100644
--- a/plugins/line-highlight/prism-line-highlight.js
+++ b/plugins/line-highlight/prism-line-highlight.js
@@ -56,7 +56,7 @@
document.body.removeChild(d);
}
return res;
- }
+ };
}());
/**
diff --git a/plugins/normalize-whitespace/prism-normalize-whitespace.js b/plugins/normalize-whitespace/prism-normalize-whitespace.js
index 13683fe..5735d98 100644
--- a/plugins/normalize-whitespace/prism-normalize-whitespace.js
+++ b/plugins/normalize-whitespace/prism-normalize-whitespace.js
@@ -10,7 +10,7 @@ var assign = Object.assign || function (obj1, obj2) {
obj1[name] = obj2[name];
}
return obj1;
-}
+};
function NormalizeWhitespace(defaults) {
this.defaults = assign({}, defaults);
diff --git a/plugins/wpd/prism-wpd.js b/plugins/wpd/prism-wpd.js
index b612396..140e18c 100644
--- a/plugins/wpd/prism-wpd.js
+++ b/plugins/wpd/prism-wpd.js
@@ -44,7 +44,7 @@ if (Prism.languages.markup) {
'hkern': 1, 'vkern': 1
},
MathML: {}
- }
+ };
}
var language;
diff --git a/prism.js b/prism.js
index 5982d5c..d5ff4ef 100644
--- a/prism.js
+++ b/prism.js
@@ -1769,6 +1769,6 @@ Prism.languages.js = Prism.languages.javascript;
logged = true;
}
Prism.plugins.fileHighlight.highlight.apply(this, arguments);
- }
+ };
})();
diff --git a/tests/dependencies-test.js b/tests/dependencies-test.js
index 7988f11..ebacf5b 100644
--- a/tests/dependencies-test.js
+++ b/tests/dependencies-test.js
@@ -318,12 +318,12 @@ describe('components.json', function () {
for (const modifyId of toArray(entry.modify)) {
if (optional.has(modifyId)) {
- assert.fail(`The component "${id}" has declared "${modifyId}" as both optional and modify.`)
+ assert.fail(`The component "${id}" has declared "${modifyId}" as both optional and modify.`);
}
}
for (const requireId of toArray(entry.require)) {
if (optional.has(requireId)) {
- assert.fail(`The component "${id}" has declared "${requireId}" as both optional and require.`)
+ assert.fail(`The component "${id}" has declared "${requireId}" as both optional and require.`);
}
}
});
diff --git a/tests/examples-test.js b/tests/examples-test.js
index 0a4f3e4..a993afc 100644
--- a/tests/examples-test.js
+++ b/tests/examples-test.js
@@ -151,7 +151,7 @@ function parseHTML(html) {
const p = new Parser({
onerror(err) {
- reject(err)
+ reject(err);
},
onend() {
resolve(tree);
diff --git a/tests/helper/checks.js b/tests/helper/checks.js
index 69fd17e..c667537 100644
--- a/tests/helper/checks.js
+++ b/tests/helper/checks.js
@@ -110,7 +110,7 @@ module.exports = (Prism) => {
} else {
elementStr = String(element);
}
- redefStr += `\t'${key}': ${elementStr},\n`
+ redefStr += `\t'${key}': ${elementStr},\n`;
}
redefStr += '}';
} else {
diff --git a/tests/helper/test-case.js b/tests/helper/test-case.js
index 184d6c1..4879af1 100644
--- a/tests/helper/test-case.js
+++ b/tests/helper/test-case.js
@@ -74,7 +74,7 @@ module.exports = {
if (testCase.comment.trim()) {
content += separator + testCase.comment.trim();
}
- content += '\n'
+ content += '\n';
content = content.replace(/\r?\n/g, lineEnd);
fs.writeFileSync(filePath, content, 'utf-8');
diff --git a/tests/helper/token-stream-transformer.js b/tests/helper/token-stream-transformer.js
index c405b6e..a704bf5 100644
--- a/tests/helper/token-stream-transformer.js
+++ b/tests/helper/token-stream-transformer.js
@@ -286,8 +286,8 @@ function printPrettyTokenStream(prettyStream, indentationLevel = 1, indentationC
const lineEnd = (i === prettyStream.length - 1) ? '\n' : ',\n';
out += lineEnd;
}
- })
- out += indentation.substr(indentationChar.length) + ']'
+ });
+ out += indentation.substr(indentationChar.length) + ']';
return out;
}
diff --git a/tests/plugins/keep-markup/test.js b/tests/plugins/keep-markup/test.js
index af2f006..bc98ef0 100644
--- a/tests/plugins/keep-markup/test.js
+++ b/tests/plugins/keep-markup/test.js
@@ -1,18 +1,18 @@
/* eslint-disable no-undef */
const expect = require('chai').expect;
-const jsdom = require('jsdom')
-const { JSDOM } = jsdom
+const jsdom = require('jsdom');
+const { JSDOM } = jsdom;
-require('../../../prism')
+require('../../../prism');
// fake DOM
-global.self = {}
-global.self.Prism = Prism
-global.document = {}
+global.self = {};
+global.self.Prism = Prism;
+global.document = {};
document.createRange = function () {
-}
-global.self.document = document
+};
+global.self.document = document;
-require('../../../plugins/keep-markup/prism-keep-markup')
+require('../../../plugins/keep-markup/prism-keep-markup');
describe('Prism Keep Markup Plugin', function () {
@@ -23,62 +23,62 @@ describe('Prism Keep Markup Plugin', function () {
document.createRange = function () {
return {
setStart: function (node, offset) {
- start.push({ node, offset })
+ start.push({ node, offset });
},
setEnd: function (node, offset) {
- end.push({ node, offset })
+ end.push({ node, offset });
},
extractContents: function () {
- return new JSDOM('').window.document.createTextNode('')
+ return new JSDOM('').window.document.createTextNode('');
},
insertNode: function (node) {
- nodes.push(node)
+ nodes.push(node);
},
detach: function () {
}
- }
- }
- const beforeHighlight = Prism.hooks.all['before-highlight'][0]
- const afterHighlight = Prism.hooks.all['after-highlight'][0]
+ };
+ };
+ const beforeHighlight = Prism.hooks.all['before-highlight'][0];
+ const afterHighlight = Prism.hooks.all['after-highlight'][0];
const env = {
element: new JSDOM(code).window.document.getElementsByTagName('code')[0],
language: 'javascript'
- }
- beforeHighlight(env)
- afterHighlight(env)
- return { start, end, nodes }
+ };
+ beforeHighlight(env);
+ afterHighlight(env);
+ return { start, end, nodes };
}
it('should keep <span> markup', function () {
- const result = execute(`<code class="language-javascript">x<span>a</span>y</code>`)
- expect(result.start.length).to.equal(1)
- expect(result.end.length).to.equal(1)
- expect(result.nodes.length).to.equal(1)
- expect(result.nodes[0].nodeName).to.equal('SPAN')
- })
+ const result = execute(`<code class="language-javascript">x<span>a</span>y</code>`);
+ expect(result.start.length).to.equal(1);
+ expect(result.end.length).to.equal(1);
+ expect(result.nodes.length).to.equal(1);
+ expect(result.nodes[0].nodeName).to.equal('SPAN');
+ });
it('should preserve markup order', function () {
- const result = execute(`<code class="language-javascript">x<a></a><b></b>y</code>`)
- expect(result.start.length).to.equal(2)
- expect(result.start[0].offset).to.equal(0)
- expect(result.start[0].node.textContent).to.equal('y')
- expect(result.start[1].offset).to.equal(0)
- expect(result.start[1].node.textContent).to.equal('y')
- expect(result.end.length).to.equal(2)
- expect(result.end[0].offset).to.equal(0)
- expect(result.end[0].node.textContent).to.equal('y')
- expect(result.end[1].offset).to.equal(0)
- expect(result.end[1].node.textContent).to.equal('y')
- expect(result.nodes.length).to.equal(2)
- expect(result.nodes[0].nodeName).to.equal('A')
- expect(result.nodes[1].nodeName).to.equal('B')
- })
+ const result = execute(`<code class="language-javascript">x<a></a><b></b>y</code>`);
+ expect(result.start.length).to.equal(2);
+ expect(result.start[0].offset).to.equal(0);
+ expect(result.start[0].node.textContent).to.equal('y');
+ expect(result.start[1].offset).to.equal(0);
+ expect(result.start[1].node.textContent).to.equal('y');
+ expect(result.end.length).to.equal(2);
+ expect(result.end[0].offset).to.equal(0);
+ expect(result.end[0].node.textContent).to.equal('y');
+ expect(result.end[1].offset).to.equal(0);
+ expect(result.end[1].node.textContent).to.equal('y');
+ expect(result.nodes.length).to.equal(2);
+ expect(result.nodes[0].nodeName).to.equal('A');
+ expect(result.nodes[1].nodeName).to.equal('B');
+ });
it('should keep last <span> markup', function () {
- const result = execute(`<code class="language-javascript">xy<span>a</span></code>`)
- expect(result.start.length).to.equal(1)
- expect(result.end.length).to.equal(1)
- expect(result.nodes.length).to.equal(1)
- expect(result.nodes[0].nodeName).to.equal('SPAN')
- })
+ const result = execute(`<code class="language-javascript">xy<span>a</span></code>`);
+ expect(result.start.length).to.equal(1);
+ expect(result.end.length).to.equal(1);
+ expect(result.nodes.length).to.equal(1);
+ expect(result.nodes[0].nodeName).to.equal('SPAN');
+ });
// The markup is removed if it's the last element and the element's name is a single letter: a(nchor), b(old), i(talic)...
// https://github.com/PrismJS/prism/issues/1618
/*
@@ -90,4 +90,4 @@ describe('Prism Keep Markup Plugin', function () {
expect(result.nodes[0].nodeName).to.equal('A')
})
*/
-})
+});