Add type hints for the gettext functions and Underscore compatibility.

Review Request #13668 — Created March 25, 2024 and submitted

Information

babel-plugin-django-gettext
master

Reviewers

This introduces TypeScript type hints that cover the functions and
tagged template literals processed by this plugin. It also includes a
shim for Underscore that helps merge the definitions for Underscore's
_ object and the _ gettext alias.

Consumers will want to reference the types in individual files or in a
global.d.ts by including the line:

/// <reference types="babel-plugin-django-gettext"/>

Made use of these new definitions in Djblets and Review Board.

Unit tests pass.

Summary ID
Add type hints for the gettext functions and Underscore compatibility.
This introduces TypeScript type hints that cover the functions and tagged template literals processed by this plugin. It also includes a shim for Underscore that helps merge the definitions for Underscore's `_` object and the `_` gettext alias. Consumer will want to reference the types in individual files or in a `global.d.ts` by including the line: ``` /// <reference types="babel-plugin-django-gettext"/> ```
ce8476998da0b15f991f1a89700bc6802c343942
Description From Last Updated

Typo in description: Consumer -> Consumers

daviddavid

Missing semicolon. Column: 49 Error code: W033

reviewbotreviewbot

Missing semicolon. Column: 34 Error code: W033

reviewbotreviewbot

Super nit: shouldn't this be tagged as typescript?

daviddavid
Checks run (1 failed, 1 succeeded)
flake8 passed.
JSHint failed.

JSHint

chipx86
david
  1. 
      
  2. Typo in description: Consumer -> Consumers

  3. README.md (Diff revision 2)
     
     

    Super nit: shouldn't this be tagged as typescript?

    1. Yeah, I have no idea to be honest if that'll render right everywhere, but let's give it a shot.

  4. 
      
chipx86
chipx86
Review request changed

Status: Closed (submitted)

Change Summary:

Pushed to master (b5cd4b3)
Loading...