biancadanforth / tracking-protection-shield-study

A Shield study to determine the optimal messaging, if any, for Tracking Protection in Firefox.
0 stars 3 forks source link

Fix ESLint JSDoc errors #95

Closed pdehaan closed 6 years ago

pdehaan commented 6 years ago

This should fix any invalid JSDoc comments or missing attributes. I did my best to guess at any missing data types, and everything should pass linting. For any missing descriptions, I marked them as "TODO" so it gets picked up by the ESLint "no-warning-comments" rule. If that adds too much noise (versus code TODOs), i can probably change the placeholder text to something else, and have ESLint conditionally ignore that string for now.

pdehaan commented 6 years ago

Current output:

$ npm run lint:eslint

> tracking-protection-messaging-study@1.0.1 lint:eslint /Users/pdehaan/dev/github/mozilla/tracking-protection-shield-study
> npm run eslint

> tracking-protection-messaging-study@1.0.1 eslint /Users/pdehaan/dev/github/mozilla/tracking-protection-shield-study
> eslint addon test --ext=js,jsm,json

/Users/pdehaan/dev/github/mozilla/tracking-protection-shield-study/addon/bootstrap.js
   32:3  warning  Unexpected 'needs_doc' comment  no-warning-comments
   90:7  warning  Unexpected 'todo' comment       no-warning-comments
   95:3  warning  Unexpected 'needs_doc' comment  no-warning-comments
  116:5  warning  Unexpected 'todo' comment       no-warning-comments
  120:3  warning  Unexpected 'needs_doc' comment  no-warning-comments
  134:3  warning  Unexpected 'needs_doc' comment  no-warning-comments
  168:3  warning  Unexpected 'needs_doc' comment  no-warning-comments
  204:3  warning  Unexpected 'needs_doc' comment  no-warning-comments

/Users/pdehaan/dev/github/mozilla/tracking-protection-shield-study/addon/lib/Config.jsm
   76:7  warning  Unexpected 'todo' comment  no-warning-comments
  110:3  warning  Unexpected 'todo' comment  no-warning-comments

/Users/pdehaan/dev/github/mozilla/tracking-protection-shield-study/addon/lib/Feature.jsm
   10:1  warning  Unexpected 'todo' comment       no-warning-comments
   54:3  warning  Unexpected 'needs_doc' comment  no-warning-comments
  194:3  warning  Unexpected 'needs_doc' comment  no-warning-comments
  346:3  warning  Unexpected 'needs_doc' comment  no-warning-comments
  426:3  warning  Unexpected 'needs_doc' comment  no-warning-comments
  473:3  warning  Unexpected 'todo' comment       no-warning-comments
  473:3  warning  Unexpected 'needs_doc' comment  no-warning-comments
  551:5  warning  Unexpected 'todo' comment       no-warning-comments
  716:3  warning  Unexpected 'needs_doc' comment  no-warning-comments
  728:5  warning  Unexpected 'todo' comment       no-warning-comments
  779:3  warning  Unexpected 'needs_doc' comment  no-warning-comments
  837:9  warning  Unexpected 'todo' comment       no-warning-comments
  917:3  warning  Unexpected 'needs_doc' comment  no-warning-comments

✖ 23 problems (0 errors, 23 warnings)

Current "TODO" comments:

$ git grep "TODO"

.eslintrc.js:    "mozilla/use-chromeutils-import": "off", // TODO: "warn"?
addon/bootstrap.js:      // TODO bdanforth: check if window is private before adding UI
addon/bootstrap.js:    // TODO bdanforth: patch studyUtils to setLoggingLevel as part of setup method
addon/lib/Canonicalize.jsm:  // including octal, hex, and TODO: fewer than four components
addon/lib/Config.jsm:      // TODO "onInvalid": "throw"  // invalid packet for schema?  throw||log
addon/lib/Config.jsm:  // TODO bdanforth: Finalize branches and weights
addon/lib/Feature.jsm: * What this Feature does: TODO bdanforth: complete
addon/lib/Feature.jsm:   * Note:  TODO bdanforth: Panel WILL NOT SHOW if the only window open is a private window.
addon/lib/Feature.jsm:    // TODO pass strings and values into this method to show up on the panel
addon/lib/Feature.jsm:    // TODO bdanforth: include a doc block with format/content for each
addon/lib/Feature.jsm:        // TODO bdanforth: improve effeciency of this algo
addon/lib/StudyUtils.jsm:  // TODO, glind, decide order of merge here
addon/lib/StudyUtils.jsm:  // TODO, use Object.assign, or ES7 spread
addon/lib/StudyUtils.jsm:    // TODO glind Answer: no.  see if you can merge the construtor and setup and export the class, rather than a singleton
addon/lib/StudyUtils.jsm:  // TODO glind, maybe this is getter / setter?
addon/lib/StudyUtils.jsm:    // TODO glind, think about reason vs fullname
addon/lib/StudyUtils.jsm:    // TODO glind, think about race conditions for endings, ensure only one exit
addon/lib/StudyUtils.jsm:        // unless we know better TODO grl
addon/lib/StudyUtils.jsm:    this.uninstall(); // TODO glind. should be controllable by arg?
addon/lib/StudyUtils.jsm:    // TODO glind, make this back breaking!
addon/test/browser/.eslintrc.yml:# TODO: re-enable
addon/test/browser/browser_tracking_protection_study_ui_check.js://   // TODO:
test/functional_tests.js:// TODO create new profile per test?
test/functional_tests.js:  // TODO glind, this is an incomplete set of tests
test/test_harness.js:      // TODO reject upon error?
test/test_harness.js:      // TODO reject upon error?
test/test_harness.js:    // TODO Promise.all() will reject upon a single error, is this an issue?
test/test_printer.py:## TODO glind, I believe this file is unused.
test/utils.js:  // TODO, allow 'actually send telemetry' here.
test/utils.js:  // TODO glind, allow config to re-use profile
test/utils.js:// TODO glind general wrapper for 'async with callback'?
test/utils.js:    // TODO glind fix this, I think this is supposed to prove it's dead.
test/utils.js:// TODO glind, this interface feels janky
test/utils.js:// TODO glind, specific to share-button-study but useful to demo patterns.
test/utils.js:// TODO glind, generalize, document, or destroy

Current "NEEDS_DOC" comments:

$ git grep "NEEDS_DOC"

addon/bootstrap.js:   * NEEDS_DOC
addon/bootstrap.js:   * @param   {string} reason    NEEDS_DOC
addon/bootstrap.js:   * @returns {Promise<void>}    NEEDS_DOC
addon/bootstrap.js:   * @returns {ConsoleAPI} NEEDS_DOC
addon/bootstrap.js:   * @returns {Object} NEEDS_DOC
addon/bootstrap.js:   * @param   {Array} weightedVariations NEEDS_DOC
addon/bootstrap.js:   * @returns {string} NEEDS_DOC
addon/bootstrap.js:   * @returns {boolean} NEEDS_DOC
addon/bootstrap.js:   * @param {Object} addonData NEEDS_DOC
addon/bootstrap.js:   * @param {string} reason    NEEDS_DOC
addon/bootstrap.js:   * @returns {void}           NEEDS_DOC
addon/lib/Feature.jsm:   * @returns {void}                    NEEDS_DOC
addon/lib/Feature.jsm:   * @param {string} logLevel NEEDS_DOC
addon/lib/Feature.jsm:   * @returns {ConsoleAPI}    NEEDS_DOC
addon/lib/Feature.jsm:   * @param {ChromeWindow} win NEEDS_DOC
addon/lib/Feature.jsm:   * @returns {void}           NEEDS_DOC
addon/lib/Feature.jsm:   * @param {Object} evt NEEDS_DOC
addon/lib/Feature.jsm:   * @returns {void} NEEDS_DOC
addon/lib/Feature.jsm:   * @param   {ChromeWindow}  win    NEEDS_DOC
addon/lib/Feature.jsm:   * @param   {string}  message      NEEDS_DOC
addon/lib/Feature.jsm:   * @param   {boolean} isIntroPanel NEEDS_DOC
addon/lib/Feature.jsm:   * @returns {void}                 NEEDS_DOC
addon/lib/Feature.jsm:   * NEEDS_DOC
addon/lib/Feature.jsm:   * @returns {void} NEEDS_DOC
addon/lib/Feature.jsm:   * @param {Object} details NEEDS_DOC
addon/lib/Feature.jsm:   * @returns {void}  NEEDS_DOC