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 more precise types in the JSDoc #818

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open

Commits on Apr 21, 2021

  1. Add more precise JSDoc for arrays

    This documents the value type for arrays of strings in arguments.
    stof committed Apr 21, 2021
    Configuration menu
    Copy the full SHA
    2570e4e View commit details
    Browse the repository at this point in the history
  2. Add more precise types for arguments forwarded to webpack

    webpack provides type definitions for their whole API, so we can
    reference their type rather than specifying a generic "object" type.
    Referencing the webpack types was already done for the returned
    configuration.
    stof committed Apr 21, 2021
    Configuration menu
    Copy the full SHA
    c5473a9 View commit details
    Browse the repository at this point in the history
  3. Add more precise JSDoc for the options callbacks

    Most of them are documented as receiving an object and returning an
    object or void. But some callbacks dealing with parts of the webpack
    configuration itself have a more precise type for the options object.
    stof committed Apr 21, 2021
    Configuration menu
    Copy the full SHA
    28e4634 View commit details
    Browse the repository at this point in the history
  4. Add more precise JSDoc for objects used as maps

    This documents that they are used in such a way, with the type of the
    values.
    stof committed Apr 21, 2021
    Configuration menu
    Copy the full SHA
    dfc6c80 View commit details
    Browse the repository at this point in the history
  5. Add more precise JSDoc for Encore options

    This brings the list of supported options in the type definitions with
    their type, which lets IDEs provide autocompletion for them.
    stof committed Apr 21, 2021
    Configuration menu
    Copy the full SHA
    e8ac09f View commit details
    Browse the repository at this point in the history
  6. Migrate to eslint-plugin-jsdoc

    The deprecated valid-jsdoc rule of eslint does not support using
    typescript syntax for types, while it allows being more precise about
    types in a much more readable way than using the older jsdoc syntax with
    separate typedef or callback definitions.
    The plugin also implements more rules than what valid-jsdoc does.
    stof committed Apr 21, 2021
    Configuration menu
    Copy the full SHA
    609fd3d View commit details
    Browse the repository at this point in the history