This repository is for active development of the Azure SDK for JavaScript (NodeJS & Browser). For consumers of the SDK we recommend visiting our public developer docs at https://docs.microsoft.com/javascript/azure/ or our versioned developer docs at https://azure.github.io/azure-sdk-for-js.
Перейти к файлу
Deyaaeldeen Almahallawi 18b3f30602
Use @this to satisfy ESLint's no-invalid-this (#14406)
# Problem

`no-invalid-this` makes sure uses of `this` are valid (see [docs](https://eslint.org/docs/rules/no-invalid-this) and [implementation](8984c91372/lib/rules/utils/ast-utils.js (L900))). However, uses of `this` are rampant in our test suites because this is how mocha unit tests are structured, the Mocha context can be accessed only through `this`. 

# Fix

So instead of disabling `no-invalid-this` in our test suites, this PR tags functions that reference `this` with `@this` and that satisfies the rule requirements (see [docs](https://eslint.org/docs/rules/no-invalid-this)).

# Discussion

It could be argued that this work just replaces one comment annotation with another so we did not really solve the underlying problem. However, the inherent problem lies in how mocha itself works and there is nothing we can do other than probably migrating to another framework that is more sane/type-safe. One minor improvement we get is we now have slightly less syntactic overhead because we need to tag just the function instead of individual lines in its body that violate the rule.

# Trade-offs

Pros:
- function tags are less than line tags

Cons:
- whitelisting one more tag with the tsdoc linter that our devs need to learn about
- still having rampant tags everywhere

Fixes https://github.com/Azure/azure-sdk-for-js/issues/11404
2021-03-23 00:51:54 +00:00
.devcontainer Fix codespaces container creation (#13338) 2021-01-22 08:52:15 -08:00
.github Adding sadasant on the code-owners of core-auth (#14321) 2021-03-16 17:40:41 -07:00
.scripts Regeneration and Other changes (#9711) 2020-06-25 22:11:17 -07:00
.vscode [Storage] azure-storage-file-datalake (#6337) 2019-12-05 10:58:26 +08:00
common [eng] Removed common/scripts/npm-run-project.js (#14414) 2021-03-22 17:21:28 -07:00
documentation Create how-to-use.md (#13972) 2021-02-25 16:42:22 +08:00
eng [eng] Removed common/scripts/npm-run-project.js (#14414) 2021-03-22 17:21:28 -07:00
samples Update new template with CORS instructions (#13631) 2021-02-08 11:26:47 -08:00
sdk Use @this to satisfy ESLint's no-invalid-this (#14406) 2021-03-23 00:51:54 +00:00
.gitattributes Use UNIX LF line endings everywhere, even on Windows (#10360) 2020-07-30 14:18:17 -07:00
.gitignore [KeyVault] - Enable node unit tests for KeyVault Administrator (#13230) 2021-01-19 07:40:51 -08:00
.prettierignore [Prettier] ignore recordings (#11297) 2020-09-16 14:17:52 -04:00
.prettierrc.json Standardize prettier configurations across the repo (#10416) 2020-08-04 16:31:27 -04:00
CONTRIBUTING.md [Git precommit hook] Deleted (#13982) 2021-03-16 21:22:45 +00:00
LICENSE Initial commit for copying files from azure-sdk-for-node 2018-08-27 13:58:16 -07:00
README.md Revert the formatting changes. (#11888) 2020-10-16 12:49:36 -07:00
SECURITY.md Replaced relative link with absolute links and remove locale (#11317) 2020-09-17 20:01:20 -07:00
dataplane.code-workspace [ContianerRegistry] Add local swagger file temporarily (#14173) 2021-03-16 13:19:37 -07:00
gulpfile.ts Clean unnecessary scripts to enable Node 12 (#3037) 2019-05-21 09:26:49 -07:00
package.json Delete redandunt packages and move to the right yaml (#12739) 2020-12-02 16:47:44 -08:00
rush.json [communication] new phone numbers library (#14012) 2021-03-08 10:35:05 -08:00
swagger_to_sdk_config.json bump autorest.typescript version (#12078) 2020-10-27 12:41:45 +08:00
tsconfig.json Use inlineSources to bundle source file contents inside map files (#7615) 2020-03-11 10:34:37 -07:00
tsconfig.package.json Update tsconfig for core packages (#6285) 2019-11-21 12:44:59 -08:00
tsdoc.json Use @this to satisfy ESLint's no-invalid-this (#14406) 2021-03-23 00:51:54 +00:00

README.md

Azure SDK for JavaScript

Packages Dependencies DependencyGraph

This repository is for active development of the Azure SDK for JavaScript (NodeJS & Browser). For consumers of the SDK we recommend visiting our public developer docs or our versioned developer docs.

Getting started

For your convenience, each service has a separate set of libraries that you can choose to use instead of one, large Azure package. To get started with a specific library, see the README.md file located in the library's project folder. You can find service libraries in the /sdk directory.

Each service might have a number of libraries available from each of the following categories:

Client: New Releases

New wave of packages that we are announcing as GA and several that are currently releasing in preview on npm. These libraries allow you to use and consume existing resources and interact with them. These libraries share a number of core functionalities found in the Azure Core package such as retries, logging, transport protocols, authentication protocols, etc. Learn more about these libraries by reading the guidelines that they follow.

You can find the most up to date list of all of the new packages on our page

NOTE: If you need to ensure your code is ready for production use one of the stable, non-preview libraries.

Client: Previous Versions

Last stable versions of packages that have been provided for usage with Azure and are production-ready. These libraries provide you with similar functionalities to the Preview ones as they allow you to use and consume existing resources and interact with them, for example: upload a blob. They might not implement the guidelines or have the same feature set as the Novemeber releases. They do however offer wider coverage of services.

Management

Libraries which enable you to provision specific resources. They are responsible for directly mirroring and consuming Azure service's REST endpoints. You can recognize these libraries by mgmt or arm in their package names.

Need help?

Reporting security issues and security bugs

Security issues and bugs should be reported privately, via email, to the Microsoft Security Response Center (MSRC) secure@microsoft.com. You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Further information, including the MSRC PGP key, can be found in the Security TechCenter.

Contributing

For details on contributing to this repository, see the contributing guide.

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com.

When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repositories using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.

Impressions