Azure / autorest.typescript

Extension for AutoRest (https://github.com/Azure/autorest) that generates TypeScript code. The transpiled javascript code is isomorphic. It can be run in browser and in node.js environment.
MIT License
178 stars 75 forks source link

Generated code should be linter error free #1210

Open ramya-rao-a opened 3 years ago

ramya-rao-a commented 3 years ago

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.

ramya-rao-a commented 3 years ago

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

"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",