Bug 1736022 - For ESLint, mark 'handleRequest' as a used variable for sjs files. r=Gijs

Depends on D128594

Differential Revision: https://phabricator.services.mozilla.com/D128595
This commit is contained in:
Mark Banner 2021-10-18 14:28:26 +00:00
Родитель 660f501442
Коммит 5e856096fc
4 изменённых файлов: 15 добавлений и 2 удалений

Просмотреть файл

@ -706,6 +706,15 @@ module.exports = {
return !!this.getTestType(scope);
},
/*
* Check if this is an .sjs file.
*/
getIsSjs(scope) {
let filepath = this.cleanUpPath(scope.getFilename());
return path.extname(filepath) == ".sjs";
},
/**
* Gets the type of test or null if this isn't a test.
*

Просмотреть файл

@ -32,6 +32,10 @@ module.exports = function(context) {
if (testType == "xpcshell") {
context.markVariableAsUsed("run_test");
}
if (helpers.getIsSjs(context)) {
context.markVariableAsUsed("handleRequest");
}
},
};
};

Просмотреть файл

@ -1,6 +1,6 @@
{
"name": "eslint-plugin-mozilla",
"version": "2.11.1",
"version": "2.11.2",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

Просмотреть файл

@ -1,6 +1,6 @@
{
"name": "eslint-plugin-mozilla",
"version": "2.11.1",
"version": "2.11.2",
"description": "A collection of rules that help enforce JavaScript coding standard in the Mozilla project.",
"keywords": [
"eslint",