@@ -13,7 +13,7 @@ export default index;
13
13
/* eslint-disable jsdoc/valid-types -- Bug */
14
14
/**
15
15
* @type {((
16
- * cfg?: {
16
+ * cfg?: import('eslint').Linter.Config & {
17
17
* mergeSettings?: boolean,
18
18
* config?: `flat/${import('./index-cjs.js').ConfigGroups}${import('./index-cjs.js').ConfigVariants}${import('./index-cjs.js').ErrorLevelVariants}`,
19
19
* settings?: Partial<import('./iterateJsdoc.js').Settings>,
@@ -29,19 +29,62 @@ export const jsdoc = function (cfg) {
29
29
jsdoc : index ,
30
30
} ,
31
31
} ;
32
- if (
33
- cfg ?. config
34
- ) {
35
- // @ts -expect-error Security check
36
- if ( cfg . config === '__proto__' ) {
37
- throw new TypeError ( 'Disallowed config value' ) ;
32
+
33
+ if ( cfg ) {
34
+ if ( cfg . config ) {
35
+ // @ts -expect-error Security check
36
+ if ( cfg . config === '__proto__' ) {
37
+ throw new TypeError ( 'Disallowed config value' ) ;
38
+ }
39
+
40
+ outputConfig = index . configs [ cfg . config ] ;
38
41
}
39
42
40
- outputConfig = index . configs [ cfg . config ] ;
41
- }
43
+ if ( cfg . rules ) {
44
+ outputConfig . rules = {
45
+ ...outputConfig . rules ,
46
+ ...cfg . rules ,
47
+ } ;
48
+ }
49
+
50
+ if ( cfg . plugins ) {
51
+ outputConfig . plugins = {
52
+ ...outputConfig . plugins ,
53
+ ...cfg . plugins ,
54
+ } ;
55
+ }
56
+
57
+ if ( cfg . name ) {
58
+ outputConfig . name = cfg . name ;
59
+ }
60
+
61
+ if ( cfg . basePath ) {
62
+ outputConfig . basePath = cfg . basePath ;
63
+ }
64
+
65
+ if ( cfg . files ) {
66
+ outputConfig . files = cfg . files ;
67
+ }
68
+
69
+ if ( cfg . ignores ) {
70
+ outputConfig . ignores = cfg . ignores ;
71
+ }
42
72
43
- if ( cfg ?. rules ) {
44
- outputConfig . rules = cfg . rules ;
73
+ if ( cfg . language ) {
74
+ outputConfig . language = cfg . language ;
75
+ }
76
+
77
+ if ( cfg . languageOptions ) {
78
+ outputConfig . languageOptions = cfg . languageOptions ;
79
+ }
80
+
81
+ if ( cfg . linterOptions ) {
82
+ outputConfig . linterOptions = cfg . linterOptions ;
83
+ }
84
+
85
+ if ( cfg . processor ) {
86
+ outputConfig . processor = cfg . processor ;
87
+ }
45
88
}
46
89
47
90
outputConfig . settings = {
@@ -78,3 +121,7 @@ export const jsdoc = function (cfg) {
78
121
79
122
return outputConfig ;
80
123
} ;
124
+
125
+ export {
126
+ getJsdocProcessorPlugin ,
127
+ } from './getJsdocProcessorPlugin.js' ;
0 commit comments