Bug 1497604 Comment 0 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

As part of rolling out ESLint across the tree, we should enable it for the dom/cache/ directory.

I'm happy to mentor this bug. There's background on our eslint setups here:

https://developer.mozilla.org/docs/ESLint

Please note: We want to end up with two separate commits. One with the automatic changes, the second with the manual changes. It helps with reviewing if these appear as a commit series in phabricator.

Here's some approximate steps:

- In .eslintignore, remove the `dom/cache/test/mochitest/**` and `dom/cache/test/xpcshell/**` lines.
- Copy .eslintrc.js files as follows:

caps/tests/unit/.eslintrc.js -> dom/cache/test/xpcshell/
caps/tests/mochitest/.eslintrc.js -> dom/cache/test/mochitest/

- Run eslint:

./mach eslint --fix dom/cache

This should fix most/all of the issues.

- Inspect the diff to make sure that the indentation of the lines surrounding the changes look ok.

- Create a commit of the work so far, e.g.

$ hg commit -m "Bug nnn - Enable ESLint for dom/cache (automatic changes)" dom/cache

- For the remaining issues, you'll need to fix them by hand. Most of those should be reasonably easy to understand, but there's more information on some specific bits (especially no-undef) here:

https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/ESLint#Common_issues_and_how_to_solve_them
http://eslint.org/docs/rules/

(you can just run `./mach eslint dom/cache` to check you've fixed them).

- Add the previously copied .eslintrc.js files to source control, e.g.

$ hg add dom/cache/test/xpcshell/.eslintrc.js dom/cache/test/mochitest/.eslintrc.js

- Create a second commit of the manual changes, e.g.

$ hg commit -m "Bug nnn - Enable ESLint for dom/cache (manual changes)

- Post the two commits via phabricator: https://moz-conduit.readthedocs.io/en/latest/phabricator-user.html
When you post, please request initial review from myself (`standard8`), I'll then redirect to the owners of the code if they look good.
As part of rolling out ESLint across the tree, we should enable it for the dom/cache/ directory.

I'm happy to mentor this bug. There's background on our eslint setups here:

https://developer.mozilla.org/docs/ESLint

Please note: We want to end up with two separate commits. One with the automatic changes, the second with the manual changes. It helps with reviewing if these appear as a commit series in phabricator.

Here's some approximate steps:

1. In .eslintignore, remove the `dom/cache/test/mochitest/**` and `dom/cache/test/xpcshell/**` lines.

2. Run eslint:

./mach eslint --fix dom/cache

This should fix most/all of the issues.

3. Inspect the diff to make sure that the indentation of the lines surrounding the changes look ok.

4. Create a commit of the work so far, e.g.

$ hg commit -m "Bug nnn - Enable ESLint for dom/cache (automatic changes)" dom/cache

5. For the remaining issues, you'll need to fix them by hand. Most of those should be reasonably easy to understand, but there's more information on some specific bits (especially no-undef) here:

https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/ESLint#Common_issues_and_how_to_solve_them
http://eslint.org/docs/rules/

(you can just run `./mach eslint dom/cache` to check you've fixed them).

6. Add the previously copied .eslintrc.js files to source control, e.g.

$ hg add dom/cache/test/xpcshell/.eslintrc.js dom/cache/test/mochitest/.eslintrc.js

7. Create a second commit of the manual changes, e.g.

$ hg commit -m "Bug nnn - Enable ESLint for dom/cache (manual changes)

8. Post the two commits via phabricator: https://moz-conduit.readthedocs.io/en/latest/phabricator-user.html
When you post, please request initial review from myself (`standard8`), I'll then redirect to the owners of the code if they look good.

Back to Bug 1497604 Comment 0