зеркало из https://github.com/mozilla/gecko-dev.git
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:
Родитель
660f501442
Коммит
5e856096fc
|
@ -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",
|
||||
|
|
Загрузка…
Ссылка в новой задаче