Skip to content

Commit

Permalink
chore(ci): fix linter misconfiguration to allow Projen upgrade to suc…
Browse files Browse the repository at this point in the history
…ceed (#190)

As I was debugging the `upgrade-projen` workflow, the upgrade from
`0.88.0` => `0.91.6` was failing due to changes in the ESLint
configuration. While digging for workarounds, I found the following.

---------

Signed-off-by: team-tf-cdk <github-team-tf-cdk@hashicorp.com>
Co-authored-by: team-tf-cdk <github-team-tf-cdk@hashicorp.com>
  • Loading branch information
xiehan and team-tf-cdk authored Jan 21, 2025
1 parent f0c440b commit 75588db
Show file tree
Hide file tree
Showing 11 changed files with 23 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .projen/tasks.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .projenrc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,12 @@ const project = new JsiiProject({
typescriptVersion,
jsiiVersion: typescriptVersion,
pullRequestTemplate: false,
// Necessary due to this bug: https://github.com/projen/projen/issues/3950#issuecomment-2483442005
// If this bug gets fixed, the below `eslintOptions` section should be able to be removed
eslintOptions: {
fileExtensions: [],
dirs: ["src", "test", "projenrc", ".projenrc.ts"],
},
});
project.tsconfig?.exclude?.push("src/exampleCode/**");
project.tsconfig?.exclude?.push("example/**");
Expand Down
2 changes: 1 addition & 1 deletion examples/hybrid-module/.projen/tasks.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion examples/hybrid-module/src/__tests__/index-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ describe("MyConstruct", () => {
})
).toMatchSnapshot();
});
});
});
2 changes: 1 addition & 1 deletion examples/hybrid-module/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ export class MyConstruct extends Construct {
constructor(scope: Construct, id: string, public config: MyConstructOptions) {
super(scope, id);
}
}
}
6 changes: 3 additions & 3 deletions examples/hybrid-module/src/tfModules.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { TFModuleStack } from "@cdktf/tf-module-stack";
import { App } from "cdktf";
import { Construct } from "constructs";
import { TFModuleStack } from "@cdktf/tf-module-stack";
import { MyConstruct } from "./index";

class MyAwesomeModule extends TFModuleStack {
Expand All @@ -14,8 +14,8 @@ class MyAwesomeModule extends TFModuleStack {
}

const app = new App();
// This is the name the module can be found under.
// This is the name the module can be found under.
// We expect a "my-awesome-module.md" file in this directory.
// The README.md file will be generated from this file.
new MyAwesomeModule(app, "my-awesome-module");
app.synth();
app.synth();
2 changes: 1 addition & 1 deletion examples/terraform-module/.projen/tasks.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions examples/terraform-module/src/__tests__/index-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@

// To learn more about testing see cdk.tf/testing
describe("MyModule", () => {
it.todo("should be tested");
});
it.todo("should be tested")
});
2 changes: 1 addition & 1 deletion examples/terraform-module/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Re-Export module bindings
export * from "./terraformModules";

// Add your custom constructs here
// Add your custom constructs here
3 changes: 3 additions & 0 deletions src/hybrid-module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,9 @@ export class HybridModule extends JsiiProject {
...options,
eslintOptions: Object.assign({}, options.eslintOptions, {
lintProjenRc: false,
// Necessary due to this bug: https://github.com/projen/projen/issues/3950#issuecomment-2483442005
// If this bug gets fixed, the below line should be able to be removed
fileExtensions: [],
}),
postBuildSteps: [],
jsiiVersion: "~5.5.0",
Expand Down
3 changes: 3 additions & 0 deletions src/terraform-module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ export class TerraformModule extends ConstructLibrary {
...options,
eslintOptions: Object.assign({}, options.eslintOptions, {
lintProjenRc: false,
// Necessary due to this bug: https://github.com/projen/projen/issues/3950#issuecomment-2483442005
// If this bug gets fixed, the below line should be able to be removed
fileExtensions: [],
}),
postBuildSteps: [],
jsiiVersion: "~5.5.0",
Expand Down

0 comments on commit 75588db

Please sign in to comment.