Skip to content

fix(lint-staged): add missing types for possible config + fix typo#67862

Merged
typescript-bot merged 1 commit intoDefinitelyTyped:masterfrom
markfswe:master
Dec 16, 2023
Merged

fix(lint-staged): add missing types for possible config + fix typo#67862
typescript-bot merged 1 commit intoDefinitelyTyped:masterfrom
markfswe:master

Conversation

@markfswe
Copy link
Contributor

@markfswe markfswe commented Dec 11, 2023

This code change is not breaking, user's code that was utilizing old types should still compile without errors.
I added types for one more possible config which is not documented in examples, but implemented in the lint-staged.

I often use config file with format like this in complex projects:

export default {
    "*": ["echo hi", () => "echo hello"]
    // for example, if I want to ignore list of staged files in a second command
}

As source code of lint-staged states

Should be a string, a function, or an array of strings and functions.

Which means values of configuration object can contain array of mixed values of strings and functions. I included link to the source code containing this quote in the template below.

I did not added any tests, since all existing tests are taken from lint-staged readme example configurations and my configuration case is not included in the examples, so just let me know if you would like to add a test for this.


Template:

I am changing an existing definition:

@typescript-bot
Copy link
Contributor

typescript-bot commented Dec 11, 2023

@ZerdoX-x Thank you for submitting this PR! I see this is your first time submitting to DefinitelyTyped 👋 — I'm the local bot who will help you through the process of getting things through.

This is a live comment which I will keep updated.

1 package in this PR

Code Reviews

This PR can be merged once it's reviewed by a DT maintainer.

You can test the changes of this PR in the Playground.

Status

  • ✅ No merge conflicts
  • ✅ Continuous integration tests have passed
  • ✅ Only a DT maintainer can approve changes without tests

All of the items on the list are green. To merge, you need to post a comment including the string "Ready to merge" to bring in your changes.


Diagnostic Information: What the bot saw about this PR
{
  "type": "info",
  "now": "-",
  "pr_number": 67862,
  "author": "ZerdoX-x",
  "headCommitOid": "df492290b43cb66f61b5d9da35e847c5343e2892",
  "mergeBaseOid": "eb5412a9a2ee93c34b3c882918d2fb0bc87264ab",
  "lastPushDate": "2023-12-11T23:39:40.000Z",
  "lastActivityDate": "2023-12-16T11:32:01.000Z",
  "mergeOfferDate": "2023-12-15T21:13:22.000Z",
  "mergeRequestDate": "2023-12-16T11:32:01.000Z",
  "mergeRequestUser": "ZerdoX-x",
  "hasMergeConflict": false,
  "isFirstContribution": true,
  "tooManyFiles": false,
  "hugeChange": false,
  "popularityLevel": "Popular",
  "pkgInfo": [
    {
      "name": "lint-staged",
      "kind": "edit",
      "files": [
        {
          "path": "types/lint-staged/index.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/lint-staged/package.json",
          "kind": "package-meta-ok"
        }
      ],
      "owners": [
        "okonet",
        "saiichihashimoto"
      ],
      "addedOwners": [],
      "deletedOwners": [],
      "popularityLevel": "Popular"
    }
  ],
  "reviews": [
    {
      "type": "approved",
      "reviewer": "rbuckton",
      "date": "2023-12-15T21:12:35.000Z",
      "isMaintainer": true
    },
    {
      "type": "approved",
      "reviewer": "saiichihashimoto",
      "date": "2023-12-11T23:54:31.000Z",
      "isMaintainer": false
    }
  ],
  "mainBotCommentID": 1851069754,
  "ciResult": "pass"
}

@typescript-bot typescript-bot added Popular package This PR affects a popular package (as counted by NPM download counts). Untested Change This PR does not touch tests labels Dec 11, 2023
@typescript-bot
Copy link
Contributor

Hey @ZerdoX-x,

😒 Your PR doesn't modify any tests, so it's hard to know what's being fixed, and your changes might regress in the future. Please consider adding tests to cover the change you're making. Including tests allows this PR to be merged by yourself and the owners of this module.

This can potentially save days of time for you!

@typescript-bot
Copy link
Contributor

🔔 @okonet @saiichihashimoto — please review this PR in the next few days. Be sure to explicitly select Approve or Request Changes in the GitHub UI so I know what's going on.

@typescript-bot typescript-bot added the Owner Approved A listed owner of this package signed off on the pull request. label Dec 11, 2023
@markfswe
Copy link
Contributor Author

LMK if you would like to add test for undocumented configuration case :)

@typescript-bot typescript-bot added Maintainer Approved Self Merge This PR can now be self-merged by the PR author or an owner labels Dec 15, 2023
@typescript-bot
Copy link
Contributor

@ZerdoX-x: Everything looks good here. I am ready to merge this PR (at df49229) on your behalf whenever you think it's ready.

If you'd like that to happen, please post a comment saying:

Ready to merge

and I'll merge this PR almost instantly. Thanks for helping out! ❤️

(@okonet, @saiichihashimoto: you can do this too.)

@markfswe
Copy link
Contributor Author

Ready to merge

@typescript-bot typescript-bot merged commit 72e89ed into DefinitelyTyped:master Dec 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Maintainer Approved Owner Approved A listed owner of this package signed off on the pull request. Popular package This PR affects a popular package (as counted by NPM download counts). Self Merge This PR can now be self-merged by the PR author or an owner Untested Change This PR does not touch tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants