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
177 stars 75 forks source link

Should we have prettier and formatting commands in generated non-azure projects #2700

Open jeremymeng opened 3 months ago

jeremymeng commented 3 months ago

We have the following now. The questions is whether we want to include "prettier" as a dev dependency and the two formatting scripts in non-AzureMonorepo packages.

If we almost always re-generate code, it then makes sense to let codegen format the generated code, without needing scripts that customer would run manually.

metadata/packageJson/buildAzureMonorepoPackage.ts:204:      'dev-tool run vendored prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \
"src/**/*.{ts,cts,mts}" "test/**/*.{ts,cts,mts}" "*.{js,cjs,mjs,json}"',
metadata/packageJson/buildAzureMonorepoPackage.ts:211:      'dev-tool run vendored prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore "src/**/*\
.{ts,cts,mts}" "test/**/*.{ts,cts,mts}" "*.{js,cjs,mjs,json}"',
metadata/packageJson/buildFlavorlessPackage.ts:43:      'prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore "src/**/*.ts" "*.{js,json}\
" ',
metadata/packageJson/buildAzureStandalonePackage.ts:85:      'prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore "src/**/*.ts" "*.{js,\
json}"  "test/**/*.ts" "samples-dev/**/*.ts"',
metadata/packageJson/buildAzureStandalonePackage.ts:89:      'prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore "src/**/*.ts" "*.{js,json}"  "\
test/**/*.ts" "samples-dev/**/*.ts"',
qiaozha commented 3 months ago

I think we prefer to not generate prettier for non azure.