Skip to content

Commit

Permalink
Disallow importing Joi client side (#55018)
Browse files Browse the repository at this point in the history
* Disallow importing Joi client side

* Move elasticsearch lib into server folder

* Add a comment about the 'joi' eslint rule

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
  • Loading branch information
jloleysens and elasticmachine authored Jan 24, 2020
1 parent b8f7748 commit f7c53b5
Show file tree
Hide file tree
Showing 15 changed files with 7 additions and 5 deletions.
2 changes: 2 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,8 @@ module.exports = {
'src/core/server/**/*',
'(src|x-pack)/plugins/*/server/**/*',
'examples/**/server/**/*',
// TODO: Remove the 'joi' eslint rule once IE11 support is dropped
'joi',
],
errorMessage:
'Server modules cannot be imported into client modules or shared modules.',
Expand Down
8 changes: 4 additions & 4 deletions src/legacy/core_plugins/elasticsearch/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
* under the License.
*/
import { first } from 'rxjs/operators';
import healthCheck from './lib/health_check';
import { Cluster } from './lib/cluster';
import { createProxy } from './lib/create_proxy';
import { handleESError } from './lib/handle_es_error';
import healthCheck from './server/lib/health_check';
import { Cluster } from './server/lib/cluster';
import { createProxy } from './server/lib/create_proxy';
import { handleESError } from './server/lib/handle_es_error';

export default function(kibana) {
let defaultVars;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* under the License.
*/

import { version as kibanaVersion } from '../../../../../package.json';
import { version as kibanaVersion } from '../../../../../../package.json';

export default {
// Make the version stubbable to improve testability.
Expand Down

0 comments on commit f7c53b5

Please sign in to comment.