sst / ion

SST v3
https://sst.dev
MIT License
1.95k stars 230 forks source link

Add ignore comments for auto generated files like sst-env.d.ts #336

Closed JanStevens closed 4 months ago

JanStevens commented 5 months ago

Hi,

Since everyone has a different preference regarding formatting and code style it would be better of the generated sst-env.d.ts file adds the following to the top of the file.

/* tslint:disable */
/* eslint-disable */

Right now we have every sst deploy that changes the file so our PR linter can then complain about wrong format being used (we use ' instead of ") 🙈

Regards

thdxr commented 5 months ago

i don't love the idea of having to maintain a potentially ever growing list here. can you ignore it with a pattern in your eslint config? i'll probably end up adding it just so it works for everyone out of the box but wish there was a better way

thdxr commented 5 months ago

fixed in v0.0.341

JanStevens commented 5 months ago

@thdxr I think you made a small error and didn't account for newlines since the generated file now looks like

/* tslint:disable *//* eslint-disable */import "sst"
declare module "sst" {
  export interface Resource {
    Account: {
      name: string
      type: "sst.aws.Dynamo"
    }
    Loyalty: {
      name: string
      type: "sst.aws.Dynamo"
    }
  }
}
export {}

Notice how they are all on one line and the import 'sst' is now also commented out