Commit 01cc18eda9e59198ab2f596944fc3338ac85a2c0

Michael Schmidt 2021-05-25T12:49:30

ESLint: Added eol-last rule (#2902)

diff --git a/.eslintrc.js b/.eslintrc.js
index 7a758b1..a0cf27c 100644
--- a/.eslintrc.js
+++ b/.eslintrc.js
@@ -9,6 +9,8 @@ module.exports = {
 		// stylistic rules
 		'brace-style': ['warn', '1tbs', { allowSingleLine: true }],
 		'curly': ['warn', 'all'],
+		'eol-last': 'warn',
+		'no-multiple-empty-lines': ['warn', { max: 2, maxBOF: 0, maxEOF: 0 }],
 		'no-tabs': ['warn', { allowIndentationTabs: true }],
 		'no-var': 'error',
 		'one-var': ['warn', 'never'],
diff --git a/components/prism-abap.js b/components/prism-abap.js
index 1e0d963..3f25897 100644
--- a/components/prism-abap.js
+++ b/components/prism-abap.js
@@ -45,4 +45,4 @@ Prism.languages.abap = {
 		alias: 'punctuation'
 	}],
 	'punctuation': /[,.:()]/
-};
\ No newline at end of file
+};
diff --git a/components/prism-ada.js b/components/prism-ada.js
index 17fd6b3..6cdaa82 100644
--- a/components/prism-ada.js
+++ b/components/prism-ada.js
@@ -16,4 +16,4 @@ Prism.languages.ada = {
 	'punctuation': /\.\.?|[,;():]/,
 	'char': /'.'/,
 	'variable': /\b[a-z](?:[_a-z\d])*\b/i
-};
\ No newline at end of file
+};
diff --git a/components/prism-arff.js b/components/prism-arff.js
index c13c22d..6a366b5 100644
--- a/components/prism-arff.js
+++ b/components/prism-arff.js
@@ -7,4 +7,4 @@ Prism.languages.arff = {
 	'keyword': /@(?:attribute|data|end|relation)\b/i,
 	'number': /\b\d+(?:\.\d+)?\b/,
 	'punctuation': /[{},]/
-};
\ No newline at end of file
+};
diff --git a/components/prism-bbcode.js b/components/prism-bbcode.js
index 244c9cf..386fbd1 100644
--- a/components/prism-bbcode.js
+++ b/components/prism-bbcode.js
@@ -26,4 +26,4 @@ Prism.languages.bbcode = {
 	}
 };
 
-Prism.languages.shortcode = Prism.languages.bbcode;
\ No newline at end of file
+Prism.languages.shortcode = Prism.languages.bbcode;
diff --git a/components/prism-brainfuck.js b/components/prism-brainfuck.js
index 604d122..f6a5913 100644
--- a/components/prism-brainfuck.js
+++ b/components/prism-brainfuck.js
@@ -17,4 +17,4 @@ Prism.languages.brainfuck = {
 	},
 	'operator': /[.,]/,
 	'comment': /\S+/
-};
\ No newline at end of file
+};
diff --git a/components/prism-csp.js b/components/prism-csp.js
index 72910bc..81f15be 100644
--- a/components/prism-csp.js
+++ b/components/prism-csp.js
@@ -26,4 +26,4 @@ Prism.languages.csp = {
 		pattern: /(?:'unsafe-(?:allow-redirects|dynamic|eval|hash-attributes|hashed-attributes|hashes|inline)'|\*)/i,
 		alias: 'function'
 	}
-};
\ No newline at end of file
+};
diff --git a/components/prism-dot.js b/components/prism-dot.js
index 327a4b8..40bfd23 100644
--- a/components/prism-dot.js
+++ b/components/prism-dot.js
@@ -74,4 +74,3 @@
 	Prism.languages.gv = Prism.languages.dot;
 
 }(Prism));
-
diff --git a/components/prism-haxe.js b/components/prism-haxe.js
index 7cb6c37..7f9d83c 100644
--- a/components/prism-haxe.js
+++ b/components/prism-haxe.js
@@ -42,4 +42,4 @@ Prism.languages.insertBefore('haxe', 'keyword', {
 	}
 });
 Prism.languages.haxe['string'].inside['interpolation'].inside.rest = Prism.languages.haxe;
-delete Prism.languages.haxe['class-name'];
\ No newline at end of file
+delete Prism.languages.haxe['class-name'];
diff --git a/components/prism-icon.js b/components/prism-icon.js
index 4745f3c..e8df8db 100644
--- a/components/prism-icon.js
+++ b/components/prism-icon.js
@@ -17,4 +17,4 @@ Prism.languages.icon = {
 	'function': /(?!\d)\w+(?=\s*[({]|\s*!\s*\[)/,
 	'operator': /[+-]:(?!=)|(?:[\/?@^%&]|\+\+?|--?|==?=?|~==?=?|\*\*?|\|\|\|?|<(?:->?|<?=?)|>>?=?)(?::=)?|:(?:=:?)?|[!.\\|~]/,
 	'punctuation': /[\[\](){},;]/
-};
\ No newline at end of file
+};
diff --git a/components/prism-keyman.js b/components/prism-keyman.js
index 5a1df8b..5427737 100644
--- a/components/prism-keyman.js
+++ b/components/prism-keyman.js
@@ -11,4 +11,4 @@ Prism.languages.keyman = {
 	'number': /\b(?:U\+[\dA-F]+|d\d+|x[\da-f]+|\d+)\b/i, // U+####, x###, d### characters and numbers
 	'operator': /[+>\\,()]/,
 	'tag': /\$(?:keyman|kmfl|weaver|keymanweb|keymanonly):/i   // prefixes
-};
\ No newline at end of file
+};
diff --git a/components/prism-mizar.js b/components/prism-mizar.js
index 1c5d18b..a336946 100644
--- a/components/prism-mizar.js
+++ b/components/prism-mizar.js
@@ -9,4 +9,4 @@ Prism.languages.mizar = {
 	'number': /(?:\b|-)\d+\b/,
 	'operator': /\.\.\.|->|&|\.?=/,
 	'punctuation': /\(#|#\)|[,:;\[\](){}]/
-};
\ No newline at end of file
+};
diff --git a/components/prism-neon.js b/components/prism-neon.js
index 64a671a..0057c42 100644
--- a/components/prism-neon.js
+++ b/components/prism-neon.js
@@ -38,4 +38,3 @@ Prism.languages.neon = {
 	},
 	'punctuation': /[,:=[\]{}()-]/,
 };
-
diff --git a/components/prism-nim.js b/components/prism-nim.js
index 97990d9..33d00c0 100644
--- a/components/prism-nim.js
+++ b/components/prism-nim.js
@@ -30,4 +30,4 @@ Prism.languages.nim = {
 		lookbehind: true
 	},
 	'punctuation': /[({\[]\.|\.[)}\]]|[`(){}\[\],:]/
-};
\ No newline at end of file
+};
diff --git a/components/prism-php-extras.js b/components/prism-php-extras.js
index 370a02e..8c0662a 100644
--- a/components/prism-php-extras.js
+++ b/components/prism-php-extras.js
@@ -8,4 +8,4 @@ Prism.languages.insertBefore('php', 'variable', {
 			punctuation: /::|\\/
 		}
 	}
-});
\ No newline at end of file
+});
diff --git a/components/prism-powerquery.js b/components/prism-powerquery.js
index db885f1..c947727 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'];
diff --git a/components/prism-soy.js b/components/prism-soy.js
index 59080dc..d23e55f 100644
--- a/components/prism-soy.js
+++ b/components/prism-soy.js
@@ -93,4 +93,4 @@
 		Prism.languages['markup-templating'].tokenizePlaceholders(env, 'soy');
 	});
 
-}(Prism));
\ No newline at end of file
+}(Prism));
diff --git a/components/prism-stylus.js b/components/prism-stylus.js
index bc01153..1b858f6 100644
--- a/components/prism-stylus.js
+++ b/components/prism-stylus.js
@@ -117,7 +117,6 @@
 		},
 
 
-
 		// A selector can contain parentheses only as part of a pseudo-element
 		// It can span multiple lines.
 		// It must end with a comma or an accolade or have indented content.
diff --git a/components/prism-v.js b/components/prism-v.js
index e84095b..51b2b3a 100644
--- a/components/prism-v.js
+++ b/components/prism-v.js
@@ -76,4 +76,4 @@
 			}
 		}
 	});
-}(Prism));
\ No newline at end of file
+}(Prism));
diff --git a/components/prism-wasm.js b/components/prism-wasm.js
index 4dcd0fc..595a589 100644
--- a/components/prism-wasm.js
+++ b/components/prism-wasm.js
@@ -28,4 +28,4 @@ Prism.languages.wasm = {
 	'variable': /\$[\w!#$%&'*+\-./:<=>?@\\^_`|~]+/i,
 	'number': /[+-]?\b(?:\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:[eE][+-]?\d(?:_?\d)*)?|0x[\da-fA-F](?:_?[\da-fA-F])*(?:\.[\da-fA-F](?:_?[\da-fA-D])*)?(?:[pP][+-]?\d(?:_?\d)*)?)\b|\binf\b|\bnan(?::0x[\da-fA-F](?:_?[\da-fA-D])*)?\b/,
 	'punctuation': /[()]/
-};
\ No newline at end of file
+};
diff --git a/components/prism-xojo.js b/components/prism-xojo.js
index a1a514b..2dfd062 100644
--- a/components/prism-xojo.js
+++ b/components/prism-xojo.js
@@ -14,4 +14,4 @@ Prism.languages.xojo = {
 	'keyword': /\b(?:AddHandler|App|Array|As(?:signs)?|Auto|By(?:Ref|Val)|Boolean|Break|Byte|Call|Case|Catch|CFStringRef|CGFloat|Class|Color|Const|Continue|CString|Currency|CurrentMethodName|Declare|Delegate|Dim|Do(?:uble|wnTo)?|Each|Else(?:If)?|End|Enumeration|Event|Exception|Exit|Extends|False|Finally|For|Function|Get|GetTypeInfo|Global|GOTO|If|Implements|In|Inherits|Int(?:erface|eger|8|16|32|64)?|Lib|Loop|Me|Module|Next|Nil|Object|Optional|OSType|ParamArray|Private|Property|Protected|PString|Ptr|Raise(?:Event)?|ReDim|RemoveHandler|Return|Select(?:or)?|Self|Set|Single|Shared|Short|Soft|Static|Step|String|Sub|Super|Text|Then|To|True|Try|Ubound|UInt(?:eger|8|16|32|64)?|Until|Using|Var(?:iant)?|Wend|While|WindowPtr|WString)\b/i,
 	'operator': /<[=>]?|>=?|[+\-*\/\\^=]|\b(?:AddressOf|And|Ctype|IsA?|Mod|New|Not|Or|Xor|WeakAddressOf)\b/i,
 	'punctuation': /[.,;:()]/
-};
\ No newline at end of file
+};
diff --git a/tests/helper/util.js b/tests/helper/util.js
index 29208db..da3a18d 100644
--- a/tests/helper/util.js
+++ b/tests/helper/util.js
@@ -1,4 +1,3 @@
-
 const { RegExpParser } = require('regexpp');
 
 
diff --git a/tests/languages/asciidoc/entity_feature.js b/tests/languages/asciidoc/entity_feature.js
index 2e99cd1..22c9b3b 100644
--- a/tests/languages/asciidoc/entity_feature.js
+++ b/tests/languages/asciidoc/entity_feature.js
@@ -1,4 +1,4 @@
 module.exports = {
 	'&#x278a;': '<span class="token entity" title="&#x278a;">&amp;#x278a;</span>',
 	'&#182;': '<span class="token entity" title="&#182;">&amp;#182;</span>'
-};
\ No newline at end of file
+};
diff --git a/tests/languages/groovy/string-interpolation_feature.js b/tests/languages/groovy/string-interpolation_feature.js
index ddecdfd..5cb2acf 100644
--- a/tests/languages/groovy/string-interpolation_feature.js
+++ b/tests/languages/groovy/string-interpolation_feature.js
@@ -25,4 +25,4 @@ module.exports = {
 	'\'$foo ${42}\'': '<span class="token string">\'$foo ${42}\'</span>',
 	// Triple single quoted string: no interpolation
 	'\'\'\'$foo ${42}\'\'\'': '<span class="token string">\'\'\'$foo ${42}\'\'\'</span>'
-};
\ No newline at end of file
+};