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

Document usage with glint additionalSpecialForms config #204

Open
bwbuchanan opened this issue Feb 19, 2024 · 1 comment
Open

Document usage with glint additionalSpecialForms config #204

bwbuchanan opened this issue Feb 19, 2024 · 1 comment

Comments

@bwbuchanan
Copy link

bwbuchanan commented Feb 19, 2024

glint requires some additional hints to correctly handle discriminated unions when using ember-truth-helpers.

See:

Note that for the ember-template-imports case in the example configs given above, an additional entry for the new named exports should be added, so it should look something like this in tsconfig.json:

"glint": {
  "environment": {
    "ember-loose": {
      "additionalSpecialForms": {
        "globals": {
          "eq": "===",
          "not-eq": "!==",
          "and": "&&",
          "or": "||",
          "not": "!"
        }
      }
    },
    "ember-template-imports": {
      "additionalSpecialForms": {
        "imports": {
          "ember-truth-helpers/helpers/eq": { "default": "===" },
          "ember-truth-helpers/helpers/not-eq": { "default": "!==" },
          "ember-truth-helpers/helpers/and": { "default": "&&" },
          "ember-truth-helpers/helpers/or": { "default": "||" },
          "ember-truth-helpers/helpers/not": { "default": "!" }
          "ember-truth-helpers": {
            "eq": "===",
            "notEq": "!==",
            "and": "&&",
            "or": "||",
            "not": "!"
          }
        }
      }
    }
  }
}
@SergeAstapov
Copy link
Collaborator

@bwbuchanan would you to open PR to propose those changes in readme?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants