Skip to content

Commit eca4416

Browse files
committed
refactor to code ranges
1 parent a31e15d commit eca4416

27 files changed

+331
-188
lines changed

code-pushup.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ export default mergeConfigs(
3939
await lighthouseCoreConfig(
4040
'https://github.com/code-pushup/cli?tab=readme-ov-file#code-pushup-cli/',
4141
),
42-
await eslintCoreConfigNx(),
4342
await typescriptPluginConfigNx({
4443
tsConfigPath:
4544
'packages/plugin-typescript/mocks/fixtures/basic-setup/tsconfig.json',
4645
}),
46+
await eslintCoreConfigNx(),
4747
);

code-pushup.preset.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,25 @@ export const typescriptPluginConfigNx = async (
148148
title: 'Typescript',
149149
refs: await getCategoryRefsFromGroups(opt),
150150
},
151+
{
152+
slug: 'bug-prevention',
153+
title: 'Bug prevention',
154+
refs: await getCategoryRefsFromGroups({
155+
onlyAudits: [
156+
'syntax-errors',
157+
'semantic-errors',
158+
'internal-errors',
159+
'configuration-errors',
160+
],
161+
}),
162+
},
163+
{
164+
slug: 'code-style',
165+
title: 'Code style',
166+
description:
167+
'TypeScript & Lint rules that promote **good practices** and consistency in your code.',
168+
refs: await getCategoryRefsFromGroups({ onlyAudits: ['suggestions'] }),
169+
},
151170
],
152171
};
153172
};
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export const t = 42;
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
// 2307 - Cannot find module.
2+
import { nonExistentModule } from './non-existent';
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
// 2683 - NoImplicitThis: 'this' implicitly has type 'any'.
2+
function noImplicitThisTS2683() {
3+
console.log(this.value); // Error 2683
4+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
// 7006 - NoImplicitAny: Parameter implicitly has an 'any' type.
2+
function noImplicitAny(param) {
3+
console.log(param);
4+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
// 2349 - Cannot call a value that is not callable.
2+
const notCallable = 42;
3+
notCallable();
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
// 2531 - StrictNullChecks: Object is possibly 'null'.
2+
const strictNullChecksTS2531: string = null;
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
2+
// 7027 - StrictPropertyInitialization: Property has no initializer.
3+
class NoInitializer {
4+
property: string;
5+
}

packages/plugin-typescript/mocks/fixtures/basic-setup/src/ts-2307-module-not-fount.ts

Lines changed: 0 additions & 6 deletions
This file was deleted.

0 commit comments

Comments
 (0)