1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-22 18:00:18 +01:00
metamask-extension/test/e2e
Elliot Winkler 1e494f3004
Refactor ESLint config (#13482)
We would like to insert TypeScript into the ESLint configuration, and
because of the way that the current config is organized, that is not
easy to do.

Most files are assumed to be files that are suited for running in a
browser context. This isn't correct, as we should expect most files to
work in a Node context instead. This is because all browser-based files
will be run through a transpiler that is able to make use of
Node-specific variables anyway.

There are a couple of important ways we can categories files which our
ESLint config should be capable of handling well:

* Is the file a script or a module? In other words, does the file run
  procedurally or is the file intended to be brought into an existing
  file?
* If the file is a module, does it use the CommonJS syntax (`require()`)
  or does it use the ES syntax (`import`/`export`)?

When we introduce TypeScript, this set of questions will become:

* Is the file a script or a module?
* If the file is a module, is it a JavaScript module or a TypeScript
  module?
* If the file is a JavaScript module, does it use the CommonJS syntax
  (`require()`) or does it use the ES syntax (`import`/`export`)?

To represent these divisions, this commit removes global rules — so now
all of the rules are kept in `overrides` for explicitness — and sets up
rules for CommonJS- and ES-module-compatible files that intentionally do
not overlap with each other. This way TypeScript (which has its own set
of rules independent from JavaScript and therefore shouldn't overlap
with the other rules either) can be easily added later.

Finally, this commit splits up the ESLint config into separate files and
adds documentation to each section. This way sets of rules which are
connected to a particular plugin (`jsdoc`, `@babel`, etc.) can be easily
understood instead of being obscured.
2022-02-28 10:42:09 -07:00
..
fixtures implement event fragments for tx controller (#13331) 2022-01-20 10:26:39 -06:00
mock-3box Refactoring threebox.spec.js to use fixtures (#10849) 2021-04-08 19:53:18 -04:00
send-eth-with-private-key-test Adding support for EIP-1559 in E2E tests (#13282) 2022-01-19 04:38:41 +05:30
tests Refactor ESLint config (#13482) 2022-02-28 10:42:09 -07:00
webdriver E2e mocking (#13640) 2022-02-16 14:21:41 +00:00
benchmark.js Fix 'yarn setup' on M1 Macs (#11887) 2021-09-01 10:40:40 -06:00
fixture-server.js Add fixture server substitutions (#12476) 2021-10-25 12:33:53 -02:30
ganache.js E2e mocking (#13640) 2022-02-16 14:21:41 +00:00
helpers.js add e2e test for deterministic account address generation (#13668) 2022-02-23 11:27:13 -06:00
metamask-ui.spec.js Update "Forgot Password?" copy (#13493) 2022-02-22 10:45:19 -05:00
metrics.spec.js Adding support for EIP-1559 in E2E tests (#13282) 2022-01-19 04:38:41 +05:30
run-all.js Add run-e2e-test.js script (#11301) 2021-06-15 15:21:25 -02:30
run-e2e-test.js Simplify Mocha npm scripts (#12313) 2021-10-12 10:10:33 -02:30
x-server.js Fix 'yarn setup' on M1 Macs (#11887) 2021-09-01 10:40:40 -06:00