mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-05 00:25:27 +00:00
8c2aaa42cf
Adds a global .eslintrc file for all source files in /browser/devtools. This file defines a set of global variables that are commonly used in /browser/devtools code. The files that import modules with Cu.import will need to define their own globals as /* globals ... */ comments. This file also defines the configuration for all the rules we want to use. This also adds a set of .eslintrc files, one per test directory in /browser/devtools. Each of these files extend from one of 2 parent config files: .eslintrc.xpcshell or .eslintrc.mochitest. The parent config define the set of globals these types of tests have access to (test runner functions, assertion functions, etc.). Finally, this also adds .eslintrc files in /toolkit/devtools for code and tests, which just extend from their counterparts in /browser/devtools. --HG-- extra : rebase_source : d7b6f639634b64dc084d0835a5fb36c9720a87e7
50 lines
1.4 KiB
Plaintext
50 lines
1.4 KiB
Plaintext
// Parent config file for all devtools browser mochitest files.
|
|
{
|
|
"rules": {
|
|
// Only disallow non-global unused vars, so that things like the test
|
|
// function do not produce errors.
|
|
"no-unused-vars": [2, {"vars": "local"}],
|
|
// Allow using undefined variables so that tests can refer to functions
|
|
// and variables defined in head.js files, without having to maintain a
|
|
// list of globals in each .eslintrc file.
|
|
// Note that bug 1168340 will eventually help auto-registering globals
|
|
// from head.js files.
|
|
"no-undef": 0,
|
|
"block-scoped-var": 0
|
|
},
|
|
// All globals made available in the test environment.
|
|
"globals": {
|
|
"add_task": true,
|
|
"Assert": true,
|
|
"content": true,
|
|
"document": true,
|
|
"EventUtils": true,
|
|
"executeSoon": true,
|
|
"export_assertions": true,
|
|
"finish": true,
|
|
"gBrowser": true,
|
|
"gDevTools": true,
|
|
"getRootDirectory": true,
|
|
"getTestFilePath": true,
|
|
"gTestPath": true,
|
|
"info": true,
|
|
"is": true,
|
|
"isnot": true,
|
|
"navigator": true,
|
|
"ok": true,
|
|
"promise": true,
|
|
"registerCleanupFunction": true,
|
|
"requestLongerTimeout": true,
|
|
"setTimeout": true,
|
|
"SimpleTest": true,
|
|
"SpecialPowers": true,
|
|
"test": true,
|
|
"todo": true,
|
|
"todo_is": true,
|
|
"todo_isnot": true,
|
|
"waitForClipboard": true,
|
|
"waitForExplicitFinish": true,
|
|
"waitForFocus": true,
|
|
"window": true,
|
|
}
|
|
} |