Closed Bug 1549945 Opened 3 years ago Closed 2 years ago

[Automated review] "'<function>' is not defined. no-undef (eslint)" occurs when using "!" syntax in mochitest.ini

Categories

(Firefox Build System :: Lint and Formatting, defect, P3)

defect
Points:
2

Tracking

(firefox77 fixed)

RESOLVED FIXED
mozilla77
Iteration:
77.2 - Apr 20 - May 3
Tracking Status
firefox77 --- fixed

People

(Reporter: m_kato, Assigned: standard8)

Details

Attachments

(1 file)

Phabricator URL: https://phabricator.services.mozilla.com/D29153

mochitest's support-files supports "!" prefix to include other directory's file. When using this syntax, eslint doesn't load external file.

mochitest.ini

support-files =
  ...
  !/editor/libeditor/tests/spellcheck.js

[test_bug1418629.html]

test_bug1418629.html

...
<script src="/tests/editor/libeditor/tests/spellcheck.js"></script>
...
<script>
....
isSpellingCheckOk(SpecialPowers.wrap(input).editor, misspeltWords);

isSpellingCheckOk is defined in /tests/editor/libeditor/tests/spellcheck.js, but ./mach eslint says no-undef.

The priority flag is not set for this bug.
:sylvestre, could you have a look please?

For more information, please visit auto_nag documentation.

Flags: needinfo?(sledru)
Component: Source Code Analysis → Lint and Formatting
Flags: needinfo?(sledru)
Priority: -- → P3
Assignee: nobody → standard8
Status: NEW → ASSIGNED
Iteration: --- → 77.2 - Apr 20 - May 3
Points: --- → 2

When loading from /tests/ we can strip off the /tests/ part and find the file with the rest of the path.

Pushed by mbanner@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/e8ad04c95f25
Avoid the need for import-globals-from when (x)html files load scripts via /tests/. r=mossop
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla77
You need to log in before you can comment on or make changes to this bug.