Skip to content

Commit f500ec6

Browse files
committed
Ignore invalid manifest version lint error
1 parent 7b40461 commit f500ec6

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

.addonslinterignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@
55
# Setting innerHTML in rester-dom-purify-frame.html should be fine because HTML
66
# is sanitized with DOMPurify.
77
site/scripts/bundle.js UNSAFE_VAR_ASSIGNMENT
8+
<no_file> JSON_INVALID "/manifest_version" must be <= 2

tools/scripts/lint-firefox-addon.mjs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import chalk from 'chalk';
1111
import logSymbols from 'log-symbols';
1212

1313
const ignoreFileName = '.addonslinterignore';
14+
const noFileToken = '<no_file>';
1415

1516
/**
1617
* Lints a Firefox addon.
@@ -47,8 +48,7 @@ async function lintFirefoxAddon(options) {
4748
result.count = 0;
4849
for (let list of lists) {
4950
result[list] = result[list].filter((message) => {
50-
const file = message.file ? resolvePath(message.file) : '<no file>';
51-
51+
const file = message.file ? resolvePath(message.file) : noFileToken;
5252
const ignoreEntry = ignoreList.find(
5353
(ignore) => ignore.file === file && ignore.code === message.code
5454
);
@@ -100,17 +100,18 @@ function getIgnoreList() {
100100
// <file> <code>
101101
let [file, code] = line.split(' ');
102102

103+
if (file !== noFileToken) {
104+
file = resolvePath(file);
105+
}
106+
103107
// Some codes sentences instead of short, uppercase names. In
104108
// this case the code should start with "_" in the ignore file
105109
// and all spaces should be replaced by "_".
106110
if (code.startsWith('_')) {
107111
code = code.substr(1).replace(/_/g, ' ');
108112
}
109113

110-
ignore.push({
111-
file: resolvePath(file),
112-
code,
113-
});
114+
ignore.push({ file, code });
114115
});
115116

116117
lineReader.on('close', () => {

0 commit comments

Comments
 (0)