Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking β€œSign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: typescript plugin poc implementation #902

Open
wants to merge 120 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
120 commits
Select commit Hold shift + click to select a range
da9891e
test(test-setup): add custom path matcher to vitest, add tests
BioPhoton Nov 19, 2024
d166627
format
BioPhoton Nov 19, 2024
332c963
fix build
BioPhoton Nov 19, 2024
dd21bfd
wip
BioPhoton Nov 19, 2024
9d2dcab
test: refactor typings
BioPhoton Nov 19, 2024
619a2bc
refactor: adjust types
BioPhoton Nov 22, 2024
13f9374
Merge branch 'main' into test-custom-matcher-paths-os-agnostic
BioPhoton Nov 22, 2024
b81df43
test(test-setup): fix custom path matchers type definitions
matejchalk Dec 10, 2024
7194c09
Merge branch 'main' into test-custom-matcher-paths-os-agnostic
matejchalk Dec 10, 2024
44aa3ab
Update vite.config.unit.ts
BioPhoton Dec 17, 2024
3703047
Update path.matcher.ts
BioPhoton Dec 17, 2024
1618c11
Update path.matcher.ts
BioPhoton Dec 17, 2024
499a67e
Update path.matcher.ts
BioPhoton Dec 17, 2024
e350aa6
Update path.matcher.ts
BioPhoton Dec 17, 2024
b896dab
wip
BioPhoton Dec 22, 2024
78d6c6c
wip
BioPhoton Dec 22, 2024
ebaebe1
Merge branch 'main' into test-custom-matcher-paths-os-agnostic
BioPhoton Dec 22, 2024
a1642c7
fix lint
BioPhoton Dec 22, 2024
0a75f47
feat: add TypeScript plugin
BioPhoton Dec 23, 2024
63a3129
wip
BioPhoton Dec 23, 2024
1606175
wip
BioPhoton Dec 23, 2024
eead92f
wip
BioPhoton Dec 23, 2024
a92c487
wip
BioPhoton Dec 23, 2024
7abace2
fix lint
BioPhoton Dec 23, 2024
84b0bc6
fix format
BioPhoton Dec 23, 2024
01d044e
wip
BioPhoton Dec 23, 2024
e3c0d48
add category
BioPhoton Dec 23, 2024
7683533
fix: adjust plugin options
BioPhoton Dec 24, 2024
c1cff7b
fix: adjust plugin options for audits
BioPhoton Dec 24, 2024
62e4ba0
wip
BioPhoton Dec 24, 2024
0a48be4
wip
BioPhoton Dec 24, 2024
381ffbb
wip
BioPhoton Dec 24, 2024
a32f9b2
wip
BioPhoton Dec 24, 2024
c7f2d3a
wip
BioPhoton Dec 24, 2024
ba00774
wip
BioPhoton Dec 24, 2024
73232cd
add groups
BioPhoton Dec 25, 2024
ce4daa6
refactor static ts error data
BioPhoton Dec 25, 2024
68f56c8
feat(plugin-typescript): new tests, docs, readme, remove unused async…
aramirezj Dec 25, 2024
7c67433
merge PR
BioPhoton Dec 25, 2024
7ecb376
wip
BioPhoton Dec 25, 2024
8bd94f6
wip
BioPhoton Dec 25, 2024
e229455
wip
BioPhoton Dec 25, 2024
1b4d4bb
feat: add ts config default generator
BioPhoton Dec 26, 2024
cee894f
wip
BioPhoton Dec 26, 2024
e8ab0e4
wip
BioPhoton Dec 26, 2024
9ee6857
wip
BioPhoton Dec 26, 2024
f02dd08
wip
BioPhoton Dec 26, 2024
26c12d0
cleanup config and imports
BioPhoton Dec 26, 2024
4c71a2b
wip
BioPhoton Dec 27, 2024
233fe92
wip
BioPhoton Dec 27, 2024
039ed97
wip
BioPhoton Dec 27, 2024
bea7105
wip
BioPhoton Dec 27, 2024
05b2504
wip
BioPhoton Dec 27, 2024
1f17b67
wip
BioPhoton Dec 27, 2024
64876ed
wip
BioPhoton Dec 27, 2024
6f702d7
wip
BioPhoton Dec 27, 2024
58bb4f8
wip
BioPhoton Dec 27, 2024
d7d797c
wip
BioPhoton Dec 27, 2024
eda1681
chore(plugin-typescript): wip (#906)
aramirezj Dec 27, 2024
06b39ca
feat: add postinstall to typescript plugin
BioPhoton Dec 27, 2024
f6b8f59
wip
BioPhoton Dec 27, 2024
4ceac7f
fix lint
BioPhoton Dec 27, 2024
396b761
refactor tests
BioPhoton Dec 28, 2024
4092fa0
refactor unit tests
BioPhoton Dec 28, 2024
21ee2fe
refactor unit tests
BioPhoton Dec 28, 2024
1b0a8f3
wip
BioPhoton Dec 28, 2024
e855d6f
Update package.json
BioPhoton Dec 28, 2024
c150de0
wip
BioPhoton Dec 28, 2024
b3a38b3
test: setup basic e2e
BioPhoton Dec 28, 2024
430186e
wip
BioPhoton Dec 28, 2024
55f4e2c
wip
BioPhoton Dec 28, 2024
137fe52
wip
BioPhoton Dec 28, 2024
350f971
fix unit and integration tests
BioPhoton Dec 28, 2024
8792092
wip
BioPhoton Dec 28, 2024
0cf36a8
wip
BioPhoton Dec 28, 2024
17ae3b1
wip
BioPhoton Dec 28, 2024
34ba6cc
wip
BioPhoton Dec 28, 2024
3d7ac94
wip
BioPhoton Dec 28, 2024
61a1623
wip
BioPhoton Dec 28, 2024
a87fc03
test: add basic e2e
BioPhoton Dec 29, 2024
a8c252e
wip
BioPhoton Dec 29, 2024
e812e3c
wip
BioPhoton Dec 29, 2024
17ea733
fix e2e
BioPhoton Dec 29, 2024
7bca00e
e2e
BioPhoton Dec 29, 2024
c4a3889
e2e
BioPhoton Dec 29, 2024
0938ffd
wip
BioPhoton Dec 29, 2024
d656b23
wip
BioPhoton Dec 29, 2024
0d06579
fix: refactor types
BioPhoton Dec 30, 2024
5a53391
wip
BioPhoton Dec 30, 2024
a31e15d
wip
BioPhoton Dec 30, 2024
eca4416
refactor to code ranges
BioPhoton Jan 1, 2025
5c80d53
fix tests for to code ranges
BioPhoton Jan 2, 2025
b947f5e
cleanup
BioPhoton Jan 2, 2025
ebd6e8b
cleanup
BioPhoton Jan 2, 2025
51ae9fe
cleanup
BioPhoton Jan 2, 2025
57e33f3
Merge branch 'main' into plugin-typescript
BioPhoton Jan 2, 2025
8146f93
Merge branch 'main' into test-custom-matcher-paths-os-agnostic
BioPhoton Jan 5, 2025
2db3010
wip
BioPhoton Jan 5, 2025
0870140
e2e issues 1
BioPhoton Jan 5, 2025
967280a
e2e issues 2
BioPhoton Jan 5, 2025
bbfeb57
e2e issues 3
BioPhoton Jan 5, 2025
71e0062
Merge branch 'test-custom-matcher-paths-os-agnostic' into plugin-type…
BioPhoton Jan 5, 2025
c85c44d
wip
BioPhoton Jan 5, 2025
5aacd8d
wip
BioPhoton Jan 5, 2025
4a687f7
wip
BioPhoton Jan 5, 2025
8f3dc47
timeout 1
BioPhoton Jan 5, 2025
9414f47
timeout 2
BioPhoton Jan 5, 2025
2a33c78
timeout 3
BioPhoton Jan 5, 2025
56531e9
Merge branch 'main' into plugin-typescript
BioPhoton Jan 6, 2025
80b1fbc
adjust ranges
BioPhoton Jan 10, 2025
2fd18c1
wip
BioPhoton Jan 10, 2025
47d4149
wip
BioPhoton Jan 10, 2025
a9f9c03
refactor e2e
BioPhoton Jan 10, 2025
51710a4
refactor docs
BioPhoton Jan 10, 2025
bae4eee
refactor types
BioPhoton Jan 10, 2025
4e05355
refactor categories
BioPhoton Jan 10, 2025
0fe38d1
wip
BioPhoton Jan 10, 2025
0b9c371
Merge branch 'main' into plugin-typescript
BioPhoton Feb 12, 2025
5ae687a
Merge branch 'main' into plugin-typescript
BioPhoton Feb 14, 2025
66d1fec
Merge branch 'main' into plugin-typescript
BioPhoton Mar 10, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix: adjust plugin options for audits
BioPhoton committed Dec 24, 2024
commit c1cff7b1dff9a7bec68c36efb175ee139d524023
1 change: 0 additions & 1 deletion code-pushup.config.ts
Original file line number Diff line number Diff line change
@@ -46,6 +46,5 @@ export default mergeConfigs(
await eslintCoreConfigNx(),
await typescriptPluginConfigNx({
tsConfigPath: 'packages/plugin-typescript/tsconfig.lib.json',
tsAudits: ['stris'],
}),
);
5 changes: 3 additions & 2 deletions code-pushup.preset.ts
Original file line number Diff line number Diff line change
@@ -141,7 +141,8 @@ export const typescriptPluginConfigNx = async (
options: TypescriptPluginOptions,
): Promise<CoreConfig> => {
const opt: TypescriptPluginOptions = {
tsAudits: Object.values(SUPPORTED_TS_ERROR_CODES) as AuditSlug[],
onlyAudits: Object.values(SUPPORTED_TS_ERROR_CODES) as (string &
AuditSlug)[],
...options,
};

@@ -151,7 +152,7 @@ export const typescriptPluginConfigNx = async (
{
slug: 'typescript',
title: 'Typescript',
refs: AUDITS.filter(filterAuditsBySlug(opt.tsAudits)).map(
refs: AUDITS.filter(filterAuditsBySlug(opt.onlyAudits)).map(
({ slug }) => ({
plugin: 'typescript',
type: 'audit' as const,
8 changes: 5 additions & 3 deletions packages/plugin-typescript/src/lib/config.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
import { z } from 'zod';
import { AUDITS } from './generated/audits.js';
import type { AuditSlug } from './types.js';

const auditSlugs = AUDITS.map(({ slug }) => slug) as [string, ...string[]];
export const typescriptPluginConfigSchema = z.object({
tsConfigPath: z.string().describe('Path to the TsConfig'),
tsAudits: z
.array(z.string())
onlyAudits: z
.enum(auditSlugs)
.optional()
.describe('Array with specific TsCodes to measure'),
});

export type TypescriptPluginOptions = z.infer<
typeof typescriptPluginConfigSchema
> & { tsAudits?: AuditSlug[] | undefined };
> & { onlyAudits?: AuditSlug[] | undefined };
7 changes: 3 additions & 4 deletions packages/plugin-typescript/src/lib/constants.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import type { AuditSlug } from './types.js';

export const TYPESCRIPT_PLUGIN_SLUG = 'typescript';

/* eslint-disable @typescript-eslint/no-magic-numbers */
@@ -62,11 +64,8 @@ export const SUPPORTED_TS_ERROR_CODES = {
1063: 'export-assignment-error',
1064: 'async-promise-type-error',
1066: 'constant-enum-initializer-required',
1085: 'syntax-error',
1086: 'no-accessor-in-ambient',
1089: 'invalid-constructor-modifier',
1090: 'invalid-param-modifier',
} as const;
} as const satisfies Record<string, AuditSlug>;

export const BASIC_CHECKES = [2322, 2345, 2531];
/* eslint-enable @typescript-eslint/no-magic-numbers */
Loading