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

[core] Upgrade to @azure/eslint-plugin-azure-sdk@^3.0.0 #8345

Closed
4 tasks done
willmtemple opened this issue Apr 14, 2020 · 2 comments · Fixed by #8687
Closed
4 tasks done

[core] Upgrade to @azure/eslint-plugin-azure-sdk@^3.0.0 #8345

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

Comments

@willmtemple
Copy link
Contributor

willmtemple commented Apr 14, 2020

Core packages are still using version 2 of the eslint plugin. This issue is to track upgrading it to version 3. Instructions below.

Affected packages:

  • core-tracing
  • core-auth
  • core-amqp
  • core-http

--

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.

@sadasant
Copy link
Contributor

@willmtemple

Core-tracing, core-auth and core-amqp have this already, exactly as you describe it. Am I missing something?

@willmtemple
Copy link
Contributor Author

Nope, just http left.

@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
Azure.Core Client This issue points to a problem in the data-plane of the library.
Projects
None yet
4 participants