mirror of
https://github.com/CommunitySolidServer/CommunitySolidServer.git
synced 2024-10-03 14:55:10 +00:00
refactor: Replace linting configurations
The previous package was outdated, preventing us from updating TS. This one also lints YAML and JSON, and applies many more rules to the test files, explaining all the changes in this PR.
This commit is contained in:
@@ -18,8 +18,10 @@ import { version } from '../package.json';
|
||||
* and then pushes commit and tag.
|
||||
*/
|
||||
async function commitAndTag(): Promise<void> {
|
||||
// eslint-disable-next-line ts/naming-convention
|
||||
await simpleGit().commit([], 'CHANGELOG.md', { '--amend': null, '--no-edit': null, '--no-verify': null });
|
||||
await simpleGit().addAnnotatedTag(`v${version}`, `Release Version ${version}`);
|
||||
// eslint-disable-next-line ts/naming-convention
|
||||
await simpleGit().push({ '--follow-tags': null });
|
||||
}
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
{
|
||||
"extends": "../tsconfig.json",
|
||||
"include": [
|
||||
"."
|
||||
],
|
||||
"compilerOptions": {
|
||||
"resolveJsonModule": true
|
||||
}
|
||||
},
|
||||
"include": [
|
||||
"."
|
||||
]
|
||||
}
|
||||
|
||||
@@ -60,16 +60,16 @@ async function getFilePaths(path: string, regex: RegExp): Promise<string[]> {
|
||||
* that file are included in the release commit).
|
||||
*/
|
||||
async function upgradeConfig(): Promise<void> {
|
||||
const pkg = await readPackageJson();
|
||||
const major = pkg.version.split('.')[0];
|
||||
const pkg = await readPackageJson() as Record<string, unknown>;
|
||||
const major = (pkg.version as string).split('.')[0];
|
||||
|
||||
console.log(`Changing ${pkg['lsd:module']} references to ${major}.0.0\n`);
|
||||
console.log(`Changing ${pkg['lsd:module'] as string} references to ${major}.0.0\n`);
|
||||
|
||||
const configs = await getFilePaths('config/', /.+\.json/u);
|
||||
configs.push(...await getFilePaths('test/integration/config/', /.+\.json/u));
|
||||
configs.push(...await getFilePaths('templates/config/', /.+\.json/u));
|
||||
|
||||
const escapedName = escapeStringRegexp(pkg['lsd:module']);
|
||||
const escapedName = escapeStringRegexp(pkg['lsd:module'] as string);
|
||||
const regex = new RegExp(`(${escapedName}/)${/\^\d+\.\d+\.\d+/u.source}`, 'gmu');
|
||||
|
||||
for (const config of configs) {
|
||||
@@ -77,6 +77,7 @@ async function upgradeConfig(): Promise<void> {
|
||||
}
|
||||
await replaceComponentVersion('package.json', regex, `${major}.0.0`);
|
||||
|
||||
// eslint-disable-next-line ts/naming-convention
|
||||
await simpleGit().commit(`chore(release): Update configs to v${major}.0.0`, configs, { '--no-verify': null });
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user