Skip to content

Commit fdd6f28

Browse files
committed
Add server imports check to legacy plugins
1 parent b75eb52 commit fdd6f28

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

.eslintrc.js

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -325,8 +325,23 @@ module.exports = {
325325
errorMessage: 'Plugins may only import from top-level public and server modules.',
326326
},
327327
{
328-
target: ['(src|x-pack)/plugins/**/*', '!(src|x-pack)/plugins/*/server/**/*'],
329-
from: ['src/core/server', 'src/core/server/**/*', '(src|x-pack)/plugins/*/server/**/*'],
328+
target: [
329+
'(src|x-pack)/plugins/**/*',
330+
'!(src|x-pack)/plugins/*/server/**/*',
331+
332+
'src/legacy/core_plugins/**/*',
333+
'!src/legacy/core_plugins/*/server/**/*',
334+
'!src/legacy/core_plugins/*/index.{js,ts,tsx}',
335+
336+
'x-pack/legacy/plugins/**/*',
337+
'!x-pack/legacy/plugins/*/server/**/*',
338+
'!x-pack/legacy/plugins/*/index.{js,ts,tsx}',
339+
],
340+
from: [
341+
'src/core/server',
342+
'src/core/server/**/*',
343+
'(src|x-pack)/plugins/*/server/**/*',
344+
],
330345
errorMessage:
331346
'Server modules cannot be imported into client modules or shared modules.',
332347
},

0 commit comments

Comments
 (0)