File tree Expand file tree Collapse file tree 7 files changed +3
-71
lines changed
packages/plugin-typescript Expand file tree Collapse file tree 7 files changed +3
-71
lines changed Original file line number Diff line number Diff line change 1515 "scripts" : {
1616 "prepare" : " husky install" ,
1717 "commit" : " git-cz" ,
18- "knip" : " knip" ,
19- "postinstall" : " npx nx run plugin-typescript:postinstall"
18+ "knip" : " knip"
2019 },
2120 "private" : true ,
2221 "engines" : {
Original file line number Diff line number Diff line change 3535 "options" : {
3636 "configFile" : " packages/plugin-typescript/vite.config.integration.ts"
3737 }
38- },
39- "postinstall" : {
40- "dependsOn" : [" build" ],
41- "command" : " npx tsx --tsconfig packages/plugin-typescript/tsconfig.lib.json packages/plugin-typescript/src/postinstall/create.bin.ts" ,
42- "cwd" : " "
4338 }
4439 },
4540 "tags" : [" scope:plugin" , " type:feature" , " publishable" ]
Original file line number Diff line number Diff line change @@ -11,4 +11,3 @@ export {
1111 type TypescriptPluginOptions ,
1212} from './lib/typescript-plugin.js' ;
1313export default typescriptPlugin ;
14- export { getTsDefaultsFilename } from './lib/runner/constants.js' ;
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 33 createProgram ,
44 getPreEmitDiagnostics ,
55} from 'typescript' ;
6- import { loadTargetConfig , validateDiagnostics } from './utils.js' ;
6+ import { loadTargetConfig } from './utils.js' ;
77
88export type DiagnosticsOptions = {
99 tsConfigPath : string ;
@@ -17,10 +17,7 @@ export async function getTypeScriptDiagnostics({
1717
1818 const program = createProgram ( fileNames , options ) ;
1919 // @TODO use more fine-grained helpers like getSemanticDiagnostics instead of getPreEmitDiagnostics
20- const diagnostics = getPreEmitDiagnostics ( program ) ;
21- validateDiagnostics ( diagnostics ) ;
22-
23- return diagnostics ;
20+ return getPreEmitDiagnostics ( program ) ;
2421 } catch ( error ) {
2522 throw new Error (
2623 `Can't create TS program in getDiagnostics. \n ${ ( error as Error ) . message } ` ,
Original file line number Diff line number Diff line change @@ -10,7 +10,6 @@ import {
1010} from 'typescript' ;
1111import type { Issue } from '@code-pushup/models' ;
1212import { readTextFile , truncateIssueMessage } from '@code-pushup/utils' ;
13- import { AUDIT_LOOKUP } from './constants.js' ;
1413import { TS_CODE_RANGE_NAMES } from './ts-error-codes.js' ;
1514import type { CodeRangeName } from './types.js' ;
1615
@@ -106,13 +105,3 @@ export async function loadTargetConfig(tsConfigPath: string) {
106105
107106 return parsedConfig ;
108107}
109-
110- export function validateDiagnostics ( diagnostics : readonly Diagnostic [ ] ) {
111- diagnostics
112- . filter ( ( { code } ) => ! AUDIT_LOOKUP . has ( code ) )
113- . forEach ( ( { code, messageText } ) => {
114- console . warn (
115- `Diagnostic Warning: The code ${ code } is not supported. ${ messageText } ` ,
116- ) ;
117- } ) ;
118- }
Original file line number Diff line number Diff line change @@ -4,37 +4,8 @@ import {
44 getIssueFromDiagnostic ,
55 getSeverity ,
66 tSCodeToAuditSlug ,
7- validateDiagnostics ,
87} from './utils.js' ;
98
10- describe ( 'validateDiagnostics' , ( ) => {
11- const consoleWarnSpy = vi . spyOn ( console , 'warn' ) ;
12-
13- it ( 'should not log for known error codes' , ( ) => {
14- expect ( ( ) =>
15- validateDiagnostics ( [
16- {
17- code : 7005 ,
18- messageText : 'strich checks error' ,
19- } as Diagnostic ,
20- ] ) ,
21- ) . not . toThrow ( ) ;
22- expect ( consoleWarnSpy ) . toHaveBeenCalledTimes ( 0 ) ;
23- } ) ;
24-
25- it . todo ( 'should log for known error codes' , ( ) => {
26- expect ( ( ) =>
27- validateDiagnostics ( [
28- {
29- code : 1337 ,
30- messageText : 'unknown error code' ,
31- } as Diagnostic ,
32- ] ) ,
33- ) . not . toThrow ( ) ;
34- expect ( consoleWarnSpy ) . toHaveBeenCalledTimes ( 1 ) ;
35- } ) ;
36- } ) ;
37-
389describe ( 'tSCodeToAuditSlug' , ( ) => {
3910 it ( 'should transform supported code to readable audit' , ( ) => {
4011 expect ( tSCodeToAuditSlug ( Number . parseInt ( '2345' , 10 ) ) ) . toBe (
You can’t perform that action at this time.
0 commit comments