pulumi / eslint-plugin-pulumi

Apache License 2.0
9 stars 4 forks source link

feat: treat OutputInstance in template literal as rule violation too #12

Closed blakegong closed 1 year ago

blakegong commented 1 year ago

OutputInstance should be treated the same as Output. Please check the tests.

Currently, this is "good code":

const myOutput: pulumi.OutputInstance<number> = pulumi.output([1, 2, 3])[0];
const myBadTemplate = `${myOutput}`

This PR would fix the above code into:

const myOutput: pulumi.OutputInstance<number> = pulumi.output([1, 2, 3])[0];
const myBadTemplate = pulumi.interpolate`${myOutput}`
github-actions[bot] commented 1 year ago

PR is now waiting for a maintainer to run the acceptance tests. This PR will only perform build and linting. Note for the maintainer: To run the acceptance tests, please comment /run-acceptance-tests on the PR

blakegong commented 1 year ago

@kpitzen could you help with a review? 🙏

kpitzen commented 1 year ago

Hi @blakegong ! Thank you so much for your contribution - my only request here would be to break these into two separate linting rules - I'm fine with duplicating existing code in order to make each individual linting failure more clear. Once that's done, I'm happy to get this merged in :) Thanks again!

github-actions[bot] commented 1 year ago

PR is now waiting for a maintainer to run the acceptance tests. This PR will only perform build and linting. Note for the maintainer: To run the acceptance tests, please comment /run-acceptance-tests on the PR

blakegong commented 1 year ago

@kpitzen no problem! It's in a new no-output-instance-in-template-literal rule now. Please have a look!

github-actions[bot] commented 1 year ago

PR is now waiting for a maintainer to run the acceptance tests. This PR will only perform build and linting. Note for the maintainer: To run the acceptance tests, please comment /run-acceptance-tests on the PR

kpitzen commented 1 year ago

This looks great @blakegong - thank you for your contribution! I'll get it merged and a new version released. :)

kpitzen commented 1 year ago

FYI @blakegong - this is now published in version 0.2.0. Thank you again!

blakegong commented 1 year ago

Thank you @kpitzen!