autorest.typescript
autorest.typescript copied to clipboard
Generated code should be linter error free
The output for the lint script in the generated package.json file is echo skipped
as the generated code today is not linter error free.
This issue is to ensure that the generated code is indeed linter error free
The linter to use is the plugin @azure/eslint-plugin-azure-sdk
that can be found in https://github.com/Azure/azure-sdk-for-js/tree/main/common/tools/eslint-plugin-azure-sdk.
This can be done in 2 steps. First is to ensure the lint scripts are updated to use the eslint plugin and the second is to run the lint
script for any of the generated package and start fixing the causes for the resulting linter errors
The first step requires the below changes to each generated package
- Add devdependencies
- "@azure/eslint-plugin-azure-sdk": "^3.0.0"
- "eslint": "^7.15.0"
- Update the
lint
andlint:fix
scripts in the package.json file
"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 package-name-lintReport.html || exit 0",