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

[keyvault-certificates] Upgrade to @azure/eslint-plugin-azure-sdk@^3.0.0 #8346

Closed
willmtemple opened this issue Apr 14, 2020 · 0 comments · Fixed by #8520
Closed

[keyvault-certificates] Upgrade to @azure/eslint-plugin-azure-sdk@^3.0.0 #8346

willmtemple opened this issue Apr 14, 2020 · 0 comments · Fixed by #8520
Assignees
Labels
Client This issue points to a problem in the data-plane of the library. KeyVault
Milestone

Comments

@willmtemple
Copy link
Contributor

Keyvault is still using version 2 of the eslint plugin. This issue is to track upgrading it to version 3. Instructions below,

See also #7147 #7148

--

The gist of how this works is to basically do the following steps in the package directory:

  1. Add a dependency on the new version (3.0.0) of the plugin to your devDepdendencies:

"@azure/eslint-plugin-azure-sdk": "^3.0.0"

you also need to make sure the following are also devDependencies (due to how eslint resolves plugins, you need all plugins that are used by the configuration as direct devDependencies):

"@typescript-eslint/eslint-plugin": "^2.0.0"
"@typescript-eslint/parser": "^2.0.0"
"eslint": "^6.1.0"
"eslint-plugin-no-null": "^1.0.2"
"eslint-plugin-no-only-tests": "^2.3.0"
"eslint-plugin-promise": "^4.1.1"

  1. Create .eslintrc.json with these contents:
{
  "plugins": ["@azure/azure-sdk"],
  "extends": ["plugin:@azure/azure-sdk/azure-sdk-base"]
}
  1. Change the lint and lint:fix commands in the package.json file to the following:
    "lint:fix": "eslint package.json api-extractor.json src test --ext .ts --fix --fix-type [problem,suggestion]",
    "lint": "eslint package.json api-extractor.json src test --ext .ts -f html -o search-lintReport.html || exit 0",
  1. Make sure the eslint plugin is built. A safe way is to build the tree of your package's dependencies again:
rush update
rush build -t @azure/<package-name>

Make sure it says it built @azure/eslint-plugin-azure-sdk in the process.

  1. Run the linter and check the output:

rushx lint

then open the lint report HTML file in the package directory.

--

You might find that you need to disable some of the rules temporarily while we can work out fixes for them. Just log an issue with the eslint-plugin tag for any that you find.

@willmtemple willmtemple added Client This issue points to a problem in the data-plane of the library. KeyVault labels Apr 14, 2020
@willmtemple willmtemple changed the title [keyvault-keys] Upgrade to @azure/eslint-plugin-azure-sdk@^3.0.0 [keyvault-certificates] Upgrade to @azure/eslint-plugin-azure-sdk@^3.0.0 Apr 20, 2020
@ramya-rao-a ramya-rao-a added this to the [2020] May milestone Apr 20, 2020
@github-actions github-actions bot locked and limited conversation to collaborators Apr 12, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Client This issue points to a problem in the data-plane of the library. KeyVault
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants