microsoftgraph / microsoft-graph-toolkit

Authentication Providers and UI components for Microsoft Graph 🦒
https://docs.microsoft.com/graph/toolkit/overview
Other
922 stars 285 forks source link

[BUG] `npm run lint` fails in Windows #3197

Closed zengin closed 2 weeks ago

zengin commented 3 weeks ago

Describe the bug npm run lint fails with the following error in Windows:

PS > npm run lint

> root@4.2.2 lint
> npm run lint:eslint && npm run lint:styles

> root@4.2.2 lint:eslint
> eslint -c .eslintrc.js --quiet 'packages/*/src/**/*.ts'

Oops! Something went wrong! :(

ESLint: 8.57.0

No files matching the pattern "'packages/*/src/**/*.ts'" were found.
Please check for typing mistakes in the pattern.

To Reproduce

  1. Check out the repo on a Windows machine
  2. Run npm run lint and observe the error

Expected behavior Linting works on a Windows machine.

Environment (please complete the following information):

Additional context cross-env npm package resolves this issue.

musale commented 2 weeks ago

Hello @zengin, thank you for raising this issue. By default, we encourage development on mgt to use yarn. From this https://github.com/microsoftgraph/microsoft-graph-toolkit/pull/2718, we leverage features of yarn like zero-install which improve collaboration by ensuring we have consistent dependencies, and you can easily switch between branches in development. Additional development level dependencies are discouraged. More information on development can be found here https://github.com/microsoftgraph/microsoft-graph-toolkit/wiki#setup-the-development-environment.

Lastly, I ran the project on Windows and ran yarn run lint. There was an error which I believe is because we are not escaping the \"path\to\files\" around file paths but using the single 'path\to\file' that works on Linux. I have put up a PR to fix this here https://github.com/microsoftgraph/microsoft-graph-toolkit/pull/3205