Bug 1602069 - Enable ESLint no-undef rule for accessible/test/mochitest js files. r=Jamie

Differential Revision: https://phabricator.services.mozilla.com/D56230

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Mark Banner 2019-12-08 23:52:15 +00:00
Родитель b1af3a7da0
Коммит fffa61b7b3
21 изменённых файлов: 83 добавлений и 4 удалений

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

@ -6,6 +6,15 @@ module.exports = {
// disabled here due to failures when initially implemented. They should be
// removed (and hence enabled) at some stage.
"no-nested-ternary": "off",
"no-undef": "off",
}
},
"overrides": [{
"files": [
"*.xhtml",
"*.html",
],
"rules": {
"no-undef": "off",
}
}]
};

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

@ -1,3 +1,6 @@
/* import-globals-from common.js */
/* import-globals-from events.js */
// //////////////////////////////////////////////////////////////////////////////
// Event constants

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

@ -1,3 +1,5 @@
/* import-globals-from common.js */
// //////////////////////////////////////////////////////////////////////////////
// Object attributes.
@ -268,6 +270,8 @@ function testTextAttrsWrongOffset(aID, aOffset) {
try {
var s = {},
e = {};
// Bug 1602031
// eslint-disable-next-line no-undef
var acc = getAccessible(ID, [nsIAccessibleText]);
acc.getTextAttributes(false, 157, s, e);
} catch (ex) {

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

@ -1,3 +1,5 @@
/* import-globals-from common.js */
var { AppConstants } = ChromeUtils.import(
"resource://gre/modules/AppConstants.jsm"
);

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

@ -1,3 +1,17 @@
// This file has circular dependencies that may require other files. Rather
// than use import-globals-from, we list the globals individually here to save
// confusing ESLint.
// actions.js
/* globals testActionNames */
// attributes.js
/* globals testAttrs, testAbsentAttrs, testTextAttrs */
// relations.js
/* globals testRelation */
// role.js
/* globals isRole */
// state.js
/* globals testStates */
// //////////////////////////////////////////////////////////////////////////////
// Interfaces

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

@ -1,3 +1,6 @@
/* import-globals-from ../common.js */
/* import-globals-from ../events.js */
/**
* Perform all editable text tests.
*/

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

@ -1,3 +1,7 @@
/* import-globals-from common.js */
/* import-globals-from states.js */
/* import-globals-from text.js */
// XXX Bug 1425371 - enable no-redeclare and fix the issues with the tests.
/* eslint-disable no-redeclare */

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

@ -1,3 +1,5 @@
/* import-globals-from common.js */
/**
* Create grid object based on HTML table.
*/

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

@ -1,3 +1,7 @@
/* import-globals-from ../common.js */
/* import-globals-from ../events.js */
/* import-globals-from ../states.js */
/**
* Focus hyperlink invoker.
*

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

@ -1,3 +1,5 @@
/* import-globals-from common.js */
/**
* Tests if the given child and grand child accessibles at the given point are
* expected.

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

@ -1,3 +1,5 @@
/* import-globals-from common.js */
/**
* Test accessible name for the given accessible identifier.
*/

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

@ -1,3 +1,8 @@
/* import-globals-from ../attributes.js */
/* import-globals-from ../common.js */
/* import-globals-from ../events.js */
/* import-globals-from ../name.js */
// //////////////////////////////////////////////////////////////////////////////
// Name tests described by "markuprules.xml" file.

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

@ -1,3 +1,9 @@
/* import-globals-from common.js */
/* import-globals-from events.js */
/* import-globals-from role.js */
/* import-globals-from states.js */
/* import-globals-from text.js */
ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
// //////////////////////////////////////////////////////////////////////////////

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

@ -1,3 +1,5 @@
/* import-globals-from common.js */
// //////////////////////////////////////////////////////////////////////////////
// Constants

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

@ -1,3 +1,5 @@
/* import-globals-from common.js */
// //////////////////////////////////////////////////////////////////////////////
// Role constants

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

@ -1,3 +1,6 @@
/* import-globals-from common.js */
/* import-globals-from states.js */
/**
* Test selection getter methods of nsIAccessibleSelectable.
*

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

@ -6,6 +6,8 @@
// role.js
//
// //////////////////////////////////////////////////////////////////////////////
/* import-globals-from common.js */
/* import-globals-from role.js */
// //////////////////////////////////////////////////////////////////////////////
// State constants

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

@ -7,6 +7,9 @@
* role.js
* states.js
*/
/* import-globals-from common.js */
/* import-globals-from role.js */
/* import-globals-from states.js */
/**
* Constants used to describe cells array.

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

@ -1,3 +1,5 @@
/* import-globals-from common.js */
// //////////////////////////////////////////////////////////////////////////////
// Public
@ -320,7 +322,7 @@ function testWordAt(aElement, aWordIndex, aText, aToDoFlag) {
var wordIdx = aWordIndex;
var startOffsetObj = { value: 0 },
endOffsetObj = { value: 0 };
for (offset = 0; offset < textLength; offset = endOffsetObj.value) {
for (let offset = 0; offset < textLength; offset = endOffsetObj.value) {
acc.getTextAtOffset(
offset,
BOUNDARY_WORD_START,
@ -375,7 +377,7 @@ function testWordAt(aElement, aWordIndex, aText, aToDoFlag) {
return;
}
text = acc.getText(startWordOffset, endWordOffset);
let text = acc.getText(startWordOffset, endWordOffset);
isFunc(
text,
aText,

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

@ -1,3 +1,6 @@
/* import-globals-from common.js */
/* import-globals-from events.js */
/**
* Helper method to start a single XUL tree test.
*/

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

@ -1,3 +1,5 @@
/* import-globals-from common.js */
// //////////////////////////////////////////////////////////////////////////////
// Public methods