tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

.eslintrc.mjs (1391B)


      1 /* This Source Code Form is subject to the terms of the Mozilla Public
      2 * License, v. 2.0. If a copy of the MPL was not distributed with this
      3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
      4 
      5 import toolkitConfig from "../../../../toolkit/components/extensions/.eslintrc.mjs";
      6 import parentConfig from "../../../../toolkit/components/extensions/parent/.eslintrc.mjs";
      7 import childConfig from "../../../../toolkit/components/extensions/child/.eslintrc.mjs";
      8 
      9 export default [
     10  ...toolkitConfig,
     11  // Ideally mobile should also follow the convention of
     12  // parent/ext-*.js for parent scripts and
     13  // child/ext-*.js for child scripts,
     14  // but the current file structure predates the parent/ vs child/ separation.
     15  {
     16    files: ["ext-*.js"],
     17    ignores: ["ext-c-*.js"],
     18    languageOptions: {
     19      globals: {
     20        ...parentConfig[0].languageOptions.globals,
     21        // These globals are defined in ext-android.js and can only be used in
     22        // the extension files that run in the parent process.
     23        EventDispatcher: true,
     24        ExtensionError: true,
     25        makeGlobalEvent: true,
     26        TabContext: true,
     27        tabTracker: true,
     28        windowTracker: true,
     29      },
     30    },
     31  },
     32  {
     33    files: ["ext-c-*.js"],
     34    // If there were ever globals exported in ext-c-android.js for common
     35    // use, then they would appear here.
     36    ...childConfig[0],
     37  },
     38 ];