debugger icon indicating copy to clipboard operation
debugger copied to clipboard

[Flow] add eslint-plugin-flowtype - require-valid-file-annotation

Open gregtatum opened this issue 8 years ago • 29 comments

It would be great to use this eslint rule to ensure that we don't mistakenly leave out // @flow headers.

Here are this list of files that are missing the header. Lets add the header and the minimal types needed to satisfy flow. It is okay to add a lot of loose types like any, Object, etc...

Example

here is an example patch that could be a PR

diff --git a/src/utils/ui.js b/src/utils/ui.js
index efc8b03..599989d 100644
--- a/src/utils/ui.js
+++ b/src/utils/ui.js
@@ -2,6 +2,8 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */

+// @flow
+
 /* Checks to see if the root element is available and
  * if the element is visible. We check the width of the element
  * because it is more reliable than either checking a focus state or
@@ -14,7 +16,7 @@ export function isVisible() {

 /* Gets the line numbers width in the code editor
  */
-export function getLineNumberWidth(editor) {
+export function getLineNumberWidth(editor: Object) {
   const gutters = editor.display.gutters;
   const lineNumbers = gutters.querySelector(".CodeMirror-linenumbers");
   return lineNumbers && lineNumbers.clientWidth;

Todo List

  • [ ] src/actions
    • [ ] ast/setInScopeLines.js
    • [ ] breakpoints/addBreakpoint.js
    • [ ] breakpoints/remapLocations.js
    • [ ] event-listeners.js
    • [ ] source-tree.js
    • [ ] utils/middleware/log.js
    • [ ] utils/middleware/timing.js
  • [ ] src/components
    • [ ] SecondaryPanes/Breakpoints/BreakpointsContextMenu.js
    • [ ] SecondaryPanes/Frames/types.js
  • [ ] src/reducers
    • [ ] /async-requests.js
    • [ ] src/reducers/event-listeners.js
    • [ ] src/reducers/index.js
    • [ ] src/reducers/quick-open.js
    • [x] src/reducers/types.js
  • [ ] src/selectors/
    • [ ] breakpointAtLocation.js
    • [ ] getCallStackFrames.js
    • [ ] isSelectedFrameVisible.js
    • [x] visibleBreakpoints.js
  • [ ] src/utils
    • [x] DevToolsUtils.js
    • [x] bootstrap.js
    • [x] clipboard.js
    • [x] dbg.js
    • [ ] editor/source-editor.js (started here #5897)
    • [x] function.js
    • [x] indentation.js
    • [ ] location.js
    • [ ] project-search.js
    • [ ] result-list.js
    • [ ] source-maps.js
    • [ ] source-queue.js
    • [x] sources-tree/index.js
    • [ ] sources-tree/sortTree.js
    • [x] task.js
    • [ ] timings.js
    • [x] ui.js
    • [ ] worker.js
  • [ ] src/global-types.js

gregtatum avatar Jan 16 '18 22:01 gregtatum

Oh great @twhite96. Welcome!

jasonLaster avatar Sep 24 '18 13:09 jasonLaster

/claim

ghost avatar Oct 15 '18 05:10 ghost

Thanks for claiming the issue! :wave:

!!! Please check your email and confirm the invitation

Here are some links for getting setup, contributing, and developing. We're always happy to answer questions in slack! If you become busy, feel free to /unclaim it.

:fox_face: Debugger team!

claim avatar Oct 15 '18 05:10 claim

/claim

src/actions

akashs09 avatar Oct 19 '18 01:10 akashs09

Thanks for claiming the issue! :wave:

Here are some links for getting setup, contributing, and developing. We're always happy to answer questions in slack! If you become busy, feel free to /unclaim it.

:fox_face: Debugger team!

claim avatar Oct 19 '18 01:10 claim

@AnshulMalik i think this issue should not be closed , the latest PR added Fixes #5120 due to that this issue is closed after merging that PR

ghost avatar Oct 23 '18 10:10 ghost

Ohh, my bad, the keywords :P

AnshulMalik avatar Oct 23 '18 13:10 AnshulMalik

Here is a new list

we should likely add "flowtype/require-valid-file-annotation": [2, "always"] to our eslintrc and then disable these specific files so we can incrementally add support and not add new files that are missing flow

actions/ast/setInScopeLines.js
actions/breakpoints/breakpointPositions.js
actions/tests/helpers/breakpoints.js
actions/tests/helpers/readFixture.js
actions/tests/helpers/threadClient.js
actions/utils/middleware/log.js
actions/utils/middleware/timing.js
components/Editor/ColumnBreakpoints.js
components/Editor/EditorMenu.js
components/Editor/EmptyLines.js
components/Editor/menus/source.js
components/ProjectSearch.js
components/SecondaryPanes/Frames/FrameIndent.js
components/SecondaryPanes/Frames/Group.js
components/SecondaryPanes/Frames/types.js
components/shared/Button/index.js
components/shared/Popover.js
reducers/async-requests.js
reducers/index.js
reducers/quick-open.js
selectors/breakpointAtLocation.js
selectors/getCallStackFrames.js
selectors/isSelectedFrameVisible.js
selectors/visibleBreakpoints.js
selectors/visiblePausePoints.js
test/__mocks__/request-animation-frame.js
test/__mocks__/styleMock.js
test/__mocks__/svgMock.js
test/shim.js
test/tests-setup.js
test/utils/history.js
utils/editor/source-editor.js
utils/editor/token-events.js
utils/sources-tree/sortTree.js
utils/sources-tree/tests/addToTree.spec.js
utils/task.js
utils/url.js
utils/worker.js
vendors.js
workers/parser/tests/helpers/index.js
workers/parser/utils/formatSymbols.js
workers/search/get-matches.js
workers/search/index.js
workers/search/project-search.js
workers/search/worker.js

jasonLaster avatar Jan 31 '19 20:01 jasonLaster

Great, I'll do the ones in Frames

Le jeu. 31 janv. 2019 à 21:16, Jason Laster [email protected] a écrit :

Here is a new list

we should likely add "flowtype/require-valid-file-annotation": [2, "always"] to our eslintrc and then disable these specific files so we can incrementally add support and not add new files that are missing flow

actions/ast/setInScopeLines.js actions/breakpoints/breakpointPositions.js actions/tests/helpers/breakpoints.js actions/tests/helpers/readFixture.js actions/tests/helpers/threadClient.js actions/utils/middleware/log.js actions/utils/middleware/timing.js components/Editor/ColumnBreakpoints.js components/Editor/EditorMenu.js components/Editor/EmptyLines.js components/Editor/menus/source.js components/ProjectSearch.js components/SecondaryPanes/Frames/FrameIndent.js components/SecondaryPanes/Frames/Group.js components/SecondaryPanes/Frames/types.js components/shared/Button/index.js components/shared/Popover.js reducers/async-requests.js reducers/index.js reducers/quick-open.js selectors/breakpointAtLocation.js selectors/getCallStackFrames.js selectors/isSelectedFrameVisible.js selectors/visibleBreakpoints.js selectors/visiblePausePoints.js test/mocks/request-animation-frame.js test/mocks/styleMock.js test/mocks/svgMock.js test/shim.js test/tests-setup.js test/utils/history.js utils/editor/source-editor.js utils/editor/token-events.js utils/sources-tree/sortTree.js utils/sources-tree/tests/addToTree.spec.js utils/task.js utils/url.js utils/worker.js vendors.js workers/parser/tests/helpers/index.js workers/parser/utils/formatSymbols.js workers/search/get-matches.js workers/search/index.js workers/search/project-search.js workers/search/worker.js

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/devtools-html/debugger.html/issues/5120#issuecomment-459489984, or mute the thread https://github.com/notifications/unsubscribe-auth/AAjSO9Gin6Bm5a4TJheuewnVYCpVf8wtks5vI08igaJpZM4RggYy .

nchevobbe avatar Jan 31 '19 20:01 nchevobbe