Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add and update ESLint tests for Mapbox GL JS API docs #10707

Merged
merged 41 commits into from
Jul 28, 2021
Merged

Conversation

HeyStenson
Copy link
Contributor

@HeyStenson HeyStenson commented May 25, 2021

Related to https://github.com/mapbox/mapbox-gl-js-docs/issues/574

This PR adds tests to improve the overall quality (consistency and completeness) of GL JS API reference docs.

  • changes some eslint tests from "warn" to "error" to increase rigor
  • adds new eslint tests
  • modifies API reference to pass tests

Launch Checklist

  • briefly describe the changes in this PR
  • write tests for all new functionality
  • apply changelog label ('bug', 'feature', 'docs', etc) or use the label 'skip changelog'

@domlet domlet added docs 📜 skip changelog Used for PRs that do not need a changelog entry labels Jul 13, 2021
@domlet domlet changed the title [wip] updates to tests for API docs [WIP] Add and update ESLint tests for Mapbox GL JS API docs Jul 13, 2021
Dom Brassey and others added 13 commits July 13, 2021 10:27
* Add a few examples

* Update src/geo/mercator_coordinate.js

Co-authored-by: Ansis Brammanis <ansis@mapbox.com>

Co-authored-by: Ansis Brammanis <ansis@mapbox.com>
* Add geojson source examples

* Add src/source/* inline examples

* Linter

* Lint

* Add camera examples

* Fixup

* Add camera examples

* Review comments

* Minor nit
* Last public facing examples

* Exclude private files from geo/ and promote require-example from warning to error
)

* Update doc comments to conform to eslint-complete-sentences rule

* Fix typo

* more detailed docs for return `this`

Extracted from Arindam's #10848

* Fix docs language

* Make complete-sentences an error

* Update eslintrc

* Cleanup

* Respond to feedback

Co-authored-by: Ansis Brammanis <ansis@mapbox.com>
* GL-JS --> Mapbox GL JS

* GL JS --> Mapbox GL JS

* remove e.g.

* remove i.e.

* Update src/ui/camera.js
* Adds 'resource type' prefix for related items in GL JS API docs (#10837)
Co-authored-by: Asheem Mamoowala <asheem.mamoowala@mapbox.com>
Co-authored-by: Heather Stenson <heather.stenson@mapbox.com>
Co-authored-by: Karim Naaji <karim.naaji@gmail.com>
Co-authored-by: Arindam Bose <arindam.bose@mapbox.com>
Co-authored-by: Aidan H <aidan.hendrickson@mapbox.com>
* `jsdoc/check-types` linting: `Object` -> `object`
* Back to `Object` :|
@domlet domlet marked this pull request as ready for review July 17, 2021 00:42
SnailBones and others added 3 commits July 26, 2021 11:55
)

* Merging

* Removed changes created by VSCode ESLint extension

* Update src/style/style_image.js

* object to Object and ryan's nits

* Update src/ui/events.js

Co-authored-by: Katy DeCorah <decorah@mapbox.com>

* Update src/style/style_image.js

Co-authored-by: Katy DeCorah <decorah@mapbox.com>

* Update src/style/style_image.js

Co-authored-by: Ricky Reusser <rreusser@users.noreply.github.com>

* Update src/ui/events.js

Co-authored-by: Ricky Reusser <rreusser@users.noreply.github.com>

* Update src/ui/events.js

Co-authored-by: Ricky Reusser <rreusser@users.noreply.github.com>

Co-authored-by: Dom Brassey <dom.brassey@mapbox.com>
Co-authored-by: Katy DeCorah <decorah@mapbox.com>
Co-authored-by: Ricky Reusser <rreusser@users.noreply.github.com>
@domlet domlet self-requested a review July 26, 2021 20:47
Copy link
Contributor

@domlet domlet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Magnifique! 🍾

* add map source sections, reorder some methods

* map sections fixes

* Fix @section causing `jsdoc/require-description-complete-sentence` to fail

* Cleanup reordered `events`

Co-authored-by: Arindam Bose <arindam.bose@mapbox.com>
src/geo/transform.js Outdated Show resolved Hide resolved
src/terrain/elevation.js Outdated Show resolved Hide resolved
src/ui/map.js Outdated Show resolved Hide resolved
src/ui/map.js Outdated Show resolved Hide resolved
src/ui/map.js Outdated Show resolved Hide resolved
src/ui/map.js Outdated Show resolved Hide resolved
@HeyStenson HeyStenson merged commit 36533f3 into main Jul 28, 2021
@HeyStenson HeyStenson deleted the testing-tests branch July 28, 2021 17:40
arindam1993 pushed a commit that referenced this pull request Jul 30, 2021
* mapeventdata --> mapdataevent

* added require-property

* change warns to fails

* update tests

* ALL THE TESTS

* restore events.js

* updates and upgrades

* increase rigor of tests

* fix eslint errors for jsdoc examples (#10847)

* Add a few more examples (#10850)

* Add a few examples

* Update src/geo/mercator_coordinate.js

Co-authored-by: Ansis Brammanis <ansis@mapbox.com>

Co-authored-by: Ansis Brammanis <ansis@mapbox.com>

* Add some docs example (#10859)

* `require-example` linting (#10855)

* Add geojson source examples

* Add src/source/* inline examples

* Linter

* Lint

* Add camera examples

* Fixup

* Add camera examples

* Review comments

* Minor nit

* Apply jsdoc eslint rules only to public API files (#10854)

* `require-example` linting  (#10862)

* Last public facing examples

* Exclude private files from geo/ and promote require-example from warning to error

* `jsdoc/newline-after-description` linting (#10863)

* Update doc comments to conform to eslint-complete-sentences rule (#10851)

* Update doc comments to conform to eslint-complete-sentences rule

* Fix typo

* more detailed docs for return `this`

Extracted from Arindam's #10848

* Fix docs language

* Make complete-sentences an error

* Update eslintrc

* Cleanup

* Respond to feedback

Co-authored-by: Ansis Brammanis <ansis@mapbox.com>

* Non-test content updates (#10868)

* GL-JS --> Mapbox GL JS

* GL JS --> Mapbox GL JS

* remove e.g.

* remove i.e.

* Update src/ui/camera.js

* Resolves  `eslint-plugin-jsdoc` test failures  (#10858)

* Adds 'resource type' prefix for related items in GL JS API docs (#10837)
Co-authored-by: Asheem Mamoowala <asheem.mamoowala@mapbox.com>
Co-authored-by: Heather Stenson <heather.stenson@mapbox.com>
Co-authored-by: Karim Naaji <karim.naaji@gmail.com>
Co-authored-by: Arindam Bose <arindam.bose@mapbox.com>
Co-authored-by: Aidan H <aidan.hendrickson@mapbox.com>

* `jsdoc/check-types` linting (#10864)

* `jsdoc/check-types` linting: `Object` -> `object`
* Back to `Object` :|

* remove tests: check-indentation, check-alignment, check-tag-names, no-bad-blocks, valid-types, require-throws

* fix check-line-alignment and turn almost all tests to error

* change require-param-type to warn and fix that pesky sentence

* `jsdoc/require-param-type` linting (#10867)

* `jsdoc/require-param-type` linting

* Switch `Callback` to `Function` as per other callbacks defined in map.js

* Pin chrome to version 91 (#10887)

* Pin to chrome version 91

* Pin chrome version for test-browser

Co-authored-by: Dom Brassey <dom.brassey@mapbox.com>

* Add default values to some map API methods (#10823)

* Add default values to map methods

* Add default style value

* Add customAttribution default

* Add default value for container

* do not represent container as optional with value null

* do not represent style as optional with value null

* capitalize first letter

Co-authored-by: Dom Brassey <dom.brassey@mapbox.com>
Co-authored-by: HeyStenson <heather.stenson@mapbox.com>

* "jsdoc/require-property-description" rule and fixes to events.js (#10870)

* Merging

* Removed changes created by VSCode ESLint extension

* Update src/style/style_image.js

* object to Object and ryan's nits

* Update src/ui/events.js

Co-authored-by: Katy DeCorah <decorah@mapbox.com>

* Update src/style/style_image.js

Co-authored-by: Katy DeCorah <decorah@mapbox.com>

* Update src/style/style_image.js

Co-authored-by: Ricky Reusser <rreusser@users.noreply.github.com>

* Update src/ui/events.js

Co-authored-by: Ricky Reusser <rreusser@users.noreply.github.com>

* Update src/ui/events.js

Co-authored-by: Ricky Reusser <rreusser@users.noreply.github.com>

Co-authored-by: Dom Brassey <dom.brassey@mapbox.com>
Co-authored-by: Katy DeCorah <decorah@mapbox.com>
Co-authored-by: Ricky Reusser <rreusser@users.noreply.github.com>

* remove straggler instance of @Property {MapTouchEvent} data

* change 2 tests from warn to error

* Break down map methods and events into sections for docs (#10844)

* add map source sections, reorder some methods

* map sections fixes

* Fix @section causing `jsdoc/require-description-complete-sentence` to fail

* Cleanup reordered `events`

Co-authored-by: Arindam Bose <arindam.bose@mapbox.com>

* Apply suggestions from code review

* Update src/ui/map.js

* Update src/ui/map.js

* Update src/ui/map.js

* Update src/ui/map.js

* Update src/source/vector_tile_source.js

Co-authored-by: Dan Swick <dan.swick@gmail.com>

* Update src/geo/transform.js

Co-authored-by: Aidan H <aidan.hendrickson@mapbox.com>

Co-authored-by: Dom Brassey <dom.brassey@mapbox.com>
Co-authored-by: Ansis Brammanis <ansis@mapbox.com>
Co-authored-by: Karim Naaji <karim.naaji@gmail.com>
Co-authored-by: Ryan Hamley <ryan.hamley@mapbox.com>
Co-authored-by: Arindam Bose <arindam.bose@mapbox.com>
Co-authored-by: Ricky Reusser <rreusser@users.noreply.github.com>
Co-authored-by: Aidan H <aidan.hendrickson@mapbox.com>
Co-authored-by: Katy DeCorah <decorah@mapbox.com>
Co-authored-by: Vladimir Agafonkin <agafonkin@gmail.com>
Co-authored-by: Dan Swick <dan.swick@gmail.com>
@SnailBones SnailBones added this to the v2.4.2 milestone Sep 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs 📜 skip changelog Used for PRs that do not need a changelog entry
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants