Skip to content

Commit 7dc3f20

Browse files
authored
feat: enable MV3 by default in web-ext lint command (#2557)
1 parent fc843ac commit 7dc3f20

File tree

2 files changed

+9
-18
lines changed

2 files changed

+9
-18
lines changed

src/cmd/lint.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,14 +95,20 @@ export default function lint(
9595
selfHosted,
9696
shouldScanFile: (fileName) => fileFilter.wantFile(fileName),
9797
minManifestVersion: 2,
98-
maxManifestVersion: 2,
98+
maxManifestVersion: 3,
9999
// This mimics the first command line argument from yargs, which should be
100100
// the directory to the extension.
101101
_: [sourceDir],
102102
};
103103

104104
if (firefoxPreview.includes('mv3')) {
105-
config.maxManifestVersion = 3;
105+
log.warn(
106+
[
107+
'Manifest Version 3 is now officially supported and',
108+
'"--firefox-preview=mv3" is no longer needed.',
109+
'In addition, the "mv3" value will be removed in the future.',
110+
].join(' ')
111+
);
106112
}
107113

108114
log.debug(`Running addons-linter on ${sourceDir}`);

tests/unit/test-cmd/test.lint.js

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ describe('lint', () => {
143143
boring: true,
144144
selfHosted: true,
145145
minManifestVersion: 2,
146-
maxManifestVersion: 2,
146+
maxManifestVersion: 3,
147147
},
148148
});
149149
});
@@ -167,19 +167,4 @@ describe('lint', () => {
167167
sinon.assert.calledWith(fileFilter.wantFile, 'path/to/file');
168168
});
169169
});
170-
171-
describe('firefox-preview', () => {
172-
it('enables MV3 support in addons-linter', async () => {
173-
const { lint, createLinter } = setUp();
174-
175-
await lint({ firefoxPreview: ['mv3'] });
176-
177-
sinon.assert.calledWithMatch(createLinter, {
178-
config: {
179-
minManifestVersion: 2,
180-
maxManifestVersion: 3,
181-
},
182-
});
183-
});
184-
});
185170
});

0 commit comments

Comments
 (0)