Skip to content

Commit

Permalink
RFC: Fix CI (#1398)
Browse files Browse the repository at this point in the history
* RFC: Fix CI

Prettier has gained support for honouring trailing comma configuration
in JSONC files and is applying this to our `tsconfig.json`s.

I'm not entirely convinced by this change, and could be persuaded to
mess with our Prettier adapter and toggle trailing commas off for
`tsconfig.json` in particular. Notably this is not affecting our
`tsconfig.build.json` which could appear inconsistent.

* More?

* Try something

* Even more

* Delete `tsconfig` configure module

This didn't support JSONC and I don't think it's worthwhile to rebuild.

* Placate our own lint

* Extend changesets

* Bump `@types/node`
  • Loading branch information
72636c authored Jan 20, 2024
1 parent 928741f commit fec5b79
Show file tree
Hide file tree
Showing 22 changed files with 74 additions and 402 deletions.
16 changes: 16 additions & 0 deletions .changeset/great-trains-doubt.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,20 @@

deps: Prettier 3.2

A notable change in this release is the application of trailing newlines to JSONC files, including `tsconfig.json`:

```diff
{
"compilerOptions": {
"lib": ["ES2022"],
"outDir": "lib",
- "target": "ES2022"
+ "target": "ES2022",
},
"exclude": ["lib*/**/*"],
- "extends": "skuba/config/tsconfig.json"
+ "extends": "skuba/config/tsconfig.json",
}
```

See the [release notes](https://prettier.io/blog/2024/01/12/3.2.0) for more information.
7 changes: 7 additions & 0 deletions .changeset/little-goats-chew.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'skuba': patch
---

build: Apply trailing newlines to `skuba/config/tsconfig.json`

This aligns with Prettier 3.2 formatting behaviour. If your project references this file in a non-standard manner outside of the `tsconfig.json#/extends` field, ensure that you are using a JSONC-compatible parser.
4 changes: 2 additions & 2 deletions config/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"moduleResolution": "node",
"resolveJsonModule": true,
"noUnusedLocals": false,
"noUnusedParameters": false
"noUnusedParameters": false,
},
"extends": "tsconfig-seek"
"extends": "tsconfig-seek",
}
4 changes: 2 additions & 2 deletions integration/base/fixable/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"incremental": true,
"moduleResolution": "node",
"outDir": "lib",
"skipLibCheck": true
"skipLibCheck": true,
},
"extends": "tsconfig-seek"
"extends": "tsconfig-seek",
}
4 changes: 2 additions & 2 deletions integration/base/ok/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"incremental": true,
"moduleResolution": "node",
"outDir": "lib",
"skipLibCheck": true
"skipLibCheck": true,
},
"extends": "tsconfig-seek"
"extends": "tsconfig-seek",
}
4 changes: 2 additions & 2 deletions integration/base/patch/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"incremental": true,
"moduleResolution": "node",
"outDir": "lib",
"skipLibCheck": true
"skipLibCheck": true,
},
"extends": "tsconfig-seek"
"extends": "tsconfig-seek",
}
4 changes: 2 additions & 2 deletions integration/base/unfixable/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"incremental": true,
"moduleResolution": "node",
"outDir": "lib",
"skipLibCheck": true
"skipLibCheck": true,
},
"extends": "tsconfig-seek"
"extends": "tsconfig-seek",
}
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@
"npm-run-path": "^4.0.1",
"npm-which": "^3.0.1",
"picomatch": "^3.0.0",
"prettier": "~3.2.0",
"prettier-plugin-packagejson": "^2.4.6",
"prettier": "~3.2.4",
"prettier-plugin-packagejson": "^2.4.9",
"read-pkg-up": "^7.0.1",
"semantic-release": "^21.0.0",
"serialize-error": "^8.0.1",
Expand Down
28 changes: 18 additions & 10 deletions pnpm-lock.yaml

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

26 changes: 0 additions & 26 deletions src/cli/configure/analysis/__snapshots__/project.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -145,32 +145,6 @@ export {};
"version": "0.0.0-semantically-released"
}
}
",
"operation": "A",
},
"tsconfig.build.json": {
"data": "{
"exclude": ["**/__mocks__/**/*", "**/*.test.ts", "src/testing/**/*"],
"extends": "./tsconfig.json",
"include": ["src/**/*"]
}
",
"operation": "A",
},
"tsconfig.json": {
"data": "{
"compilerOptions": {
"baseUrl": ".",
"lib": ["ES2022"],
"outDir": "lib",
"paths": {
"src": ["src"]
},
"target": "ES2022"
},
"exclude": ["lib*/**/*"],
"extends": "skuba/config/tsconfig.json"
}
",
"operation": "A",
},
Expand Down
2 changes: 0 additions & 2 deletions src/cli/configure/modules/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import { prettierModule } from './prettier';
import { renovateModule } from './renovate';
import { serverlessModule } from './serverless';
import { skubaDiveModule } from './skubaDive';
import { tsconfigModule } from './tsconfig';
import { tslintModule } from './tslint';

export const loadModules = (opts: Options): Promise<Module[]> =>
Expand All @@ -24,7 +23,6 @@ export const loadModules = (opts: Options): Promise<Module[]> =>
renovateModule,
serverlessModule,
skubaDiveModule,
tsconfigModule,
tslintModule,
].map((createModule) => createModule(opts)),
);
Loading

0 comments on commit fec5b79

Please sign in to comment.