@@ -13,9 +13,14 @@ import jsPackagesPlugin from './packages/plugin-js-packages/src/index.js';
1313import lighthousePlugin , {
1414 lighthouseGroupRef ,
1515} from './packages/plugin-lighthouse/src/index.js' ;
16- import { typescriptPlugin } from './packages/plugin-typescript/src' ;
17- import { AUDITS } from './packages/plugin-typescript/src/lib/generated/audits' ;
18- import { TypescriptPluginOptions } from './packages/plugin-typescript/src/lib/typescript-plugin' ;
16+ import {
17+ type TypescriptPluginOptions ,
18+ typescriptPlugin ,
19+ } from './packages/plugin-typescript/src/index.js' ;
20+ import { SUPPORTED_TS_ERROR_CODES } from './packages/plugin-typescript/src/lib/constants.js' ;
21+ import { AUDITS } from './packages/plugin-typescript/src/lib/generated/audits.js' ;
22+ import { AuditSlug } from './packages/plugin-typescript/src/lib/types.js' ;
23+ import { filterAuditsBySlug } from './packages/plugin-typescript/src/lib/utils.js' ;
1924
2025export const jsPackagesCategories : CategoryConfig [ ] = [
2126 {
@@ -135,18 +140,25 @@ export const eslintCoreConfigNx = async (
135140export const typescriptPluginConfigNx = async (
136141 options : TypescriptPluginOptions ,
137142) : Promise < CoreConfig > => {
143+ const opt : TypescriptPluginOptions = {
144+ tsAudits : Object . values ( SUPPORTED_TS_ERROR_CODES ) as AuditSlug [ ] ,
145+ ...options ,
146+ } ;
147+
138148 return {
139- plugins : [ await typescriptPlugin ( options ) ] ,
149+ plugins : [ await typescriptPlugin ( opt ) ] ,
140150 categories : [
141151 {
142152 slug : 'typescript' ,
143153 title : 'Typescript' ,
144- refs : AUDITS . map ( ( { slug } ) => ( {
145- plugin : 'typescript' ,
146- type : 'audit' as const ,
147- slug,
148- weight : 1 ,
149- } ) ) ,
154+ refs : AUDITS . filter ( filterAuditsBySlug ( opt . tsAudits ) ) . map (
155+ ( { slug } ) => ( {
156+ plugin : 'typescript' ,
157+ type : 'audit' as const ,
158+ slug,
159+ weight : 1 ,
160+ } ) ,
161+ ) ,
150162 } ,
151163 ] ,
152164 } ;
0 commit comments