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

ExperimentalWarning: The fs.promises API is experimental #785

Closed
alexilyaev opened this issue Jan 30, 2020 · 2 comments · Fixed by #786
Closed

ExperimentalWarning: The fs.promises API is experimental #785

alexilyaev opened this issue Jan 30, 2020 · 2 comments · Fixed by #786
Labels

Comments

@alexilyaev
Copy link
Contributor

Description

Updated to latest lint-staged and seeing this in the output:

git commit -m "Some message here"

husky > pre-commit (node v10.16.1)
(node:56061) ExperimentalWarning: The fs.promises API is experimental
  ✔ Preparing...
  ✔ Running tasks...
  ✔ Applying modifications...
  ✔ Cleaning up...
[lint-staged-bug 0fc8320] Test lint-staged not applying git add
 1 file changed, 7 insertions(+), 4 deletions(-)

Steps to reproduce

  "lint-staged": {
    "*.js": [
      "eslint --ignore-path .gitignore --fix --max-warnings 0"
    ]
  },
  "husky": {
    "hooks": {
      "pre-commit": "lint-staged"
    }
  },

The maintainer of husky says it's not on their side:
typicode/husky#661

Debug Logs

expand to view
$ npx lint-staged -d
  lint-staged:bin Running `[email protected]` +0ms
  lint-staged:bin Options parsed from command-line: { allowEmpty: false,
  concurrent: true,
  configPath: undefined,
  debug: true,
  maxArgLength: 131072,
  quiet: false,
  relative: false,
  shell: false } +1ms
  lint-staged Loading config using `cosmiconfig` +0ms
(node:2870) ExperimentalWarning: The fs.promises API is experimental
  lint-staged Successfully loaded config from `/Users/alex/www/Node/test/package.json`:
  lint-staged { '*.js':
  lint-staged    [ 'npm run eslint:base -- --fix --max-warnings 0',
  lint-staged      'npm run prettier:base -- --write' ],
  lint-staged   '*.{json,md,mdx}': [ 'npm run prettier:base -- --write' ] } +8ms
  lint-staged:cfg Validating config +0ms
Running lint-staged with the following config:
{
  '*.js': [
    'npm run eslint:base -- --fix --max-warnings 0',
    'npm run prettier:base -- --write'
  ],
  '*.{json,md,mdx}': [
    'npm run prettier:base -- --write'
  ]
}
...

Environment

  • OS: macOS 10.14.6
  • Node.js: v10.16.1
  • lint-staged: v10.0.4
@iiroj
Copy link
Member

iiroj commented Jan 31, 2020

Hey, thanks for the report. This does come from lint-staged, since I refactored its file operations to use fs.promises.

I simply went by the 10.X LTS API docs which don’t mention it’s experimental, but it seems this warning was only removed in Node.ja v12:

nodejs/node#26581

Maybe it’s better to return to use the callback api via util.promisify to suppress this warning. Let me open a PR.

@okonet
Copy link
Collaborator

okonet commented Jan 31, 2020

🎉 This issue has been resolved in version 10.0.7 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3 participants