1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-10-22 11:22:43 +02:00
metamask-extension/development
Mark Stacey 5ee1291662
Prevent accidental use of globals (#8340)
Previously all browser globals were allowed to be used anywhere by
ESLint because we had set the `env` property to `browser` in the ESLint
config. This has made it easy to accidentally use browser globals
(e.g. #8338), so it has been removed. Instead we now have a short list
of allowed globals.

All browser globals are now accessed as properties on `window`.

Unfortunately this change resulted in a few different confusing unit
test errors, as some of our unit tests setup assumed that a particular
global would be used via `window` or `global`. In particular,
`window.fetch` didn't work correctly because it wasn't patched by the
AbortController polyfill (only `global.fetch` was being patched).
The `jsdom-global` package we were using complicated matters by setting
all of the JSDOM `window` properties directly on `global`, overwriting
the `AbortController` for example.

The `helpers.js` test setup module has been simplified somewhat by
removing `jsdom-global` and constructing the JSDOM instance manually.
The JSDOM window is set on `window`, and a few properties are set on
`global` as well as needed by various dependencies. `node-fetch` and
the AbortController polyfill/patch now work as expected as well,
though `fetch` is only available on `window` now.
2020-04-15 14:23:27 -03:00
..
build Use @fortawesome/fontawesome-free npm package (#8256) 2020-03-30 20:05:51 -03:00
states Remove unused isPopup state (#8280) 2020-04-01 20:01:47 -03:00
announcer.js Build system refactor (#8140) 2020-03-09 08:55:02 +08:00
auto-changelog.sh Add shellcheck lint (#7392) 2019-11-19 10:46:10 -05:00
backGroundConnectionModifiers.js Check for unused function arguments (#6583) 2019-05-08 15:51:33 -04:00
generate-migration.sh Add tests around migration files (#7016) 2019-12-12 20:44:29 -03:30
genStates.js Migrate codebase to use ESM (#7730) 2020-01-09 00:04:58 -03:30
gource-viz.sh dev - move gource instructions from docs to development script 2019-09-10 22:05:16 +08:00
index.html development - fix ui dev 2017-09-29 11:50:24 -07:00
metamaskbot-build-announce.js Enable arrow-parens ESLint rule 2020-02-15 17:04:21 -03:30
mock-3box.js Prevent accidental use of globals (#8340) 2020-04-15 14:23:27 -03:00
mock-dev.js Use combineReducers for rootReducer (#7964) 2020-02-06 13:08:14 -03:30
README.md add READMEs to folders, re #3427 2018-03-14 15:33:22 +02:00
require-react-devtools.js Add React and Redux DevTools (#6793) 2019-07-11 12:27:06 -02:30
run-ganache Replace deprecated shell-parallel with concurrently (#6807) 2019-07-09 14:09:31 -02:30
selector.js Migrate codebase to use ESM (#7730) 2020-01-09 00:04:58 -03:30
sentry-publish.js Improve Sentry publish script (#7417) 2019-12-05 17:59:48 -04:00
sentry-upload-artifacts.sh Improve Sentry publish script (#7417) 2019-12-05 17:59:48 -04:00
shellcheck.sh Add lint:shellcheck:package (#7568) 2019-12-11 15:52:08 -05:00
show-deps-install-scripts.js Enable arrow-parens ESLint rule 2020-02-15 17:04:21 -03:30
source-map-explorer.sh ci - create source-map-explorer build-artifacts (#7141) 2019-09-11 23:35:30 +08:00
sourcemap-validator.js Enable arrow-parens ESLint rule 2020-02-15 17:04:21 -03:30
static-server.js Add support for one-click onboarding (#7017) 2019-11-22 13:03:51 -04:00
test.html tests - integration - get flat and mascara tests closer to compatible 2017-09-13 20:25:27 -07:00
verify-locale-strings.js Enable arrow-parens ESLint rule 2020-02-15 17:04:21 -03:30

Development

Several files which are needed for developing on(!) MetaMask.

Usually each files contains information about its scope / usage.