@@ -14,7 +14,7 @@ const ESLINT_PLUGIN: PluginCodegenResult = {
1414 defaultImport : 'eslintPlugin' ,
1515 } ,
1616 ] ,
17- pluginInit : "await eslintPlugin({ patterns: '.' })" ,
17+ pluginInit : [ "await eslintPlugin({ patterns: '.' })," ] ,
1818} ;
1919
2020const ESLINT_CATEGORIES : CategoryConfig [ ] = [
@@ -58,7 +58,7 @@ describe('generateConfigSource', () => {
5858 defaultImport : 'eslintPlugin' ,
5959 } ,
6060 ] ,
61- pluginInit : 'await eslintPlugin()' ,
61+ pluginInit : [ 'await eslintPlugin(),' ] ,
6262 } ;
6363
6464 expect ( generateConfigSource ( [ plugin ] , 'ts' ) ) . toMatchInlineSnapshot ( `
@@ -83,8 +83,9 @@ describe('generateConfigSource', () => {
8383 namedImports : [ 'eslintConfigFromAllNxProjects' ] ,
8484 } ,
8585 ] ,
86- pluginInit :
87- 'await eslintPlugin({ eslintrc: eslintConfigFromAllNxProjects() })' ,
86+ pluginInit : [
87+ 'await eslintPlugin({ eslintrc: eslintConfigFromAllNxProjects() }),' ,
88+ ] ,
8889 } ;
8990
9091 expect ( generateConfigSource ( [ plugin ] , 'ts' ) ) . toMatchInlineSnapshot ( `
@@ -100,7 +101,7 @@ describe('generateConfigSource', () => {
100101 ` ) ;
101102 } ) ;
102103
103- it ( 'should generate config with multiple plugins' , ( ) => {
104+ it ( 'should generate config with multiple plugins including multiline ' , ( ) => {
104105 const plugins : PluginCodegenResult [ ] = [
105106 {
106107 imports : [
@@ -109,7 +110,7 @@ describe('generateConfigSource', () => {
109110 defaultImport : 'eslintPlugin' ,
110111 } ,
111112 ] ,
112- pluginInit : 'await eslintPlugin()' ,
113+ pluginInit : [ 'await eslintPlugin(),' ] ,
113114 } ,
114115 {
115116 imports : [
@@ -118,8 +119,11 @@ describe('generateConfigSource', () => {
118119 defaultImport : 'coveragePlugin' ,
119120 } ,
120121 ] ,
121- pluginInit :
122- "await coveragePlugin({ reports: [{ resultsPath: 'coverage/lcov.info', pathToProject: '' }] })" ,
122+ pluginInit : [
123+ 'await coveragePlugin({' ,
124+ " reports: ['coverage/lcov.info']," ,
125+ '}),' ,
126+ ] ,
123127 } ,
124128 ] ;
125129
@@ -131,7 +135,9 @@ describe('generateConfigSource', () => {
131135 export default {
132136 plugins: [
133137 await eslintPlugin(),
134- await coveragePlugin({ reports: [{ resultsPath: 'coverage/lcov.info', pathToProject: '' }] }),
138+ await coveragePlugin({
139+ reports: ['coverage/lcov.info'],
140+ }),
135141 ],
136142 } satisfies CoreConfig;
137143 "
@@ -160,7 +166,7 @@ describe('generateConfigSource', () => {
160166 defaultImport : 'eslintPlugin' ,
161167 } ,
162168 ] ,
163- pluginInit : 'await eslintPlugin()' ,
169+ pluginInit : [ 'await eslintPlugin(),' ] ,
164170 } ;
165171
166172 expect ( generateConfigSource ( [ plugin ] , 'js' ) ) . toMatchInlineSnapshot ( `
@@ -185,7 +191,7 @@ describe('generateConfigSource', () => {
185191 defaultImport : 'eslintPlugin' ,
186192 } ,
187193 ] ,
188- pluginInit : 'await eslintPlugin()' ,
194+ pluginInit : [ 'await eslintPlugin(),' ] ,
189195 } ,
190196 {
191197 imports : [
@@ -194,8 +200,9 @@ describe('generateConfigSource', () => {
194200 defaultImport : 'coveragePlugin' ,
195201 } ,
196202 ] ,
197- pluginInit :
198- "await coveragePlugin({ reports: [{ resultsPath: 'coverage/lcov.info', pathToProject: '' }] })" ,
203+ pluginInit : [
204+ "await coveragePlugin({ reports: [{ resultsPath: 'coverage/lcov.info', pathToProject: '' }] })," ,
205+ ] ,
199206 } ,
200207 ] ;
201208
@@ -266,7 +273,7 @@ describe('generateConfigSource', () => {
266273 defaultImport : 'coveragePlugin' ,
267274 } ,
268275 ] ,
269- pluginInit : 'await coveragePlugin()' ,
276+ pluginInit : [ 'await coveragePlugin(),' ] ,
270277 categories : [
271278 {
272279 slug : 'code-coverage' ,
0 commit comments