Skip to content

Commit

Permalink
chore: Fix import order linting error
Browse files Browse the repository at this point in the history
I think this is failing because we do not observe a lockfile in the [integration-test project](https://github.com/guardian/cdk/blob/9b9a91bc03f507ba4d688024b4fc8059a617f9d0/integration-test/script/ci#L5-L8).
As `eslint-plugin-import`'s version includes `^`, we cannot guarantee what version gets used in CI.

We hadn't seen it locally as we don't do a fresh install. If you delete integration-test/node_modules and lint the integration-test project, the error can be seen.

Options:
  - Use pinned versions in the integration-test project (I'm not sure if dependabot works with pinned dependency versions)
  - Do not lint the integration-test project
  - Use a lockfile and install @guardian/cdk into the integration-test project with `--no-package-lock` (not sure if this is possible as @guardian/cdk will remain in `package.json`)

See:
  - import-js/eslint-plugin-import#2021
  - https://docs.npmjs.com/cli/v6/commands/npm-install#:~:text=--no-package-lock
  • Loading branch information
akash1810 committed May 19, 2021
1 parent d8fb59c commit cec95e6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion integration-test/src/integration-test-stack.ts
@@ -1,6 +1,6 @@
import { GuDistributionBucketParameter, GuStack } from "@guardian/cdk/lib/constructs/core";
import type { App } from "@aws-cdk/core";
import type { GuStackProps } from "@guardian/cdk/lib/constructs/core";
import { GuDistributionBucketParameter, GuStack } from "@guardian/cdk/lib/constructs/core";

export class IntegrationTestStack extends GuStack {
constructor(scope: App, id: string, props: GuStackProps) {
Expand Down

0 comments on commit cec95e6

Please sign in to comment.