Skip to content

Commit

Permalink
use eslint-import-plugin/no-export-default instead of custom rule (#3…
Browse files Browse the repository at this point in the history
  • Loading branch information
mshustov authored Apr 2, 2019
1 parent decb5ee commit 8257078
Show file tree
Hide file tree
Showing 24 changed files with 22 additions and 52 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ module.exports = {
{
files: ['x-pack/test/functional/apps/**/*', 'x-pack/plugins/apm/**/*'],
rules: {
'@kbn/eslint/no-default-export': 'off',
'import/no-default-export': 'off',
'import/no-named-as-default': 'off',
},
},
Expand Down
1 change: 0 additions & 1 deletion packages/kbn-eslint-plugin-eslint/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ module.exports = {
rules: {
'require-license-header': require('./rules/require_license_header'),
'disallow-license-headers': require('./rules/disallow_license_headers'),
'no-default-export': require('./rules/no_default_export'),
'no-restricted-paths': require('./rules/no_restricted_paths'),
module_migration: require('./rules/module_migration'),
},
Expand Down
29 changes: 0 additions & 29 deletions packages/kbn-eslint-plugin-eslint/rules/no_default_export.js

This file was deleted.

2 changes: 1 addition & 1 deletion src/legacy/core_plugins/kibana/public/.eslintrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
rules:
no-console: 2
'@kbn/eslint/no-default-export': error
'import/no-default-export': error
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ const formatIds = [
'static_lookup'
];

// eslint-disable-next-line @kbn/eslint/no-default-export
// eslint-disable-next-line import/no-default-export
export default describe('conformance', function () {

const getConfig = (...args) => config.get(...args);
Expand Down
2 changes: 1 addition & 1 deletion src/legacy/ui/public/.eslintrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
rules:
no-console: 2
'@kbn/eslint/no-default-export': error
'import/no-default-export': error
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* under the License.
*/

// eslint-disable-next-line @kbn/eslint/no-default-export
// eslint-disable-next-line import/no-default-export
export default function (leaf) {
// walk up the branch for each parent
function walk(item, memo) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import { VisProvider } from '../../vis';
import { aggTypes } from '..';
import FixturesStubbedLogstashIndexPatternProvider from 'fixtures/stubbed_logstash_index_pattern';

// eslint-disable-next-line @kbn/eslint/no-default-export
// eslint-disable-next-line import/no-default-export
export default function AggParamWriterHelper(Private) {
const Vis = Private(VisProvider);
const stubbedLogstashIndexPattern = Private(FixturesStubbedLogstashIndexPatternProvider);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import expect from '@kbn/expect';
import { BaseParamType } from '../../param_types/base';
import { JsonParamType } from '../../param_types/json';

// eslint-disable-next-line @kbn/eslint/no-default-export
// eslint-disable-next-line import/no-default-export
export default describe('JSON', function () {
const paramName = 'json_test';
let aggParam;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import expect from '@kbn/expect';
import { BaseParamType } from '../../param_types/base';
import { StringParamType } from '../../param_types/string';

// eslint-disable-next-line @kbn/eslint/no-default-export
// eslint-disable-next-line import/no-default-export
export default describe('String', function () {
const paramName = 'json_test';
let aggParam;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ function ParamClassStub(parent, body) {
* @param {PrivateLoader} Private - The private module loader, inject by passing this function to ngMock.inject()
* @return {undefined}
*/
// eslint-disable-next-line @kbn/eslint/no-default-export
// eslint-disable-next-line import/no-default-export
export default function stubParamClasses(Private) {
const BaseAggParam = Private.stub(
BaseParamType,
Expand Down
2 changes: 1 addition & 1 deletion src/legacy/ui/public/chrome/api/apps.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import { clone, get } from 'lodash';
import { resolve } from 'url';

// eslint-disable-next-line @kbn/eslint/no-default-export
// eslint-disable-next-line import/no-default-export
export default function (chrome, internals) {

if (get(internals, 'app.navLink.url')) {
Expand Down
2 changes: 1 addition & 1 deletion src/legacy/ui/public/chrome/api/template.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* under the License.
*/

// eslint-disable-next-line @kbn/eslint/no-default-export
// eslint-disable-next-line import/no-default-export
export default function (chrome, internals) {

/**
Expand Down
2 changes: 1 addition & 1 deletion src/legacy/ui/public/chrome/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@

import { chrome } from './chrome';

// eslint-disable-next-line @kbn/eslint/no-default-export
// eslint-disable-next-line import/no-default-export
export default chrome;
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ function displayBanner() {
}, 15000);
}

// eslint-disable-next-line @kbn/eslint/no-default-export
// eslint-disable-next-line import/no-default-export
export default function (opts) {
opts = opts || {};
const whenMissingRedirectTo = opts.whenMissingRedirectTo || null;
Expand Down
2 changes: 1 addition & 1 deletion src/legacy/ui/public/routes/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@

import { uiRoutes } from './routes';

// eslint-disable-next-line @kbn/eslint/no-default-export
// eslint-disable-next-line import/no-default-export
export default uiRoutes;
2 changes: 1 addition & 1 deletion src/legacy/ui/public/routes/route_manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import { wrapRouteWithPrep } from './wrap_route_with_prep';
import { RouteSetupManager } from './route_setup_manager';
import { parsePathToBreadcrumbs } from './breadcrumbs';

// eslint-disable-next-line @kbn/eslint/no-default-export
// eslint-disable-next-line import/no-default-export
export default function RouteManager() {
const self = this;
const setup = new RouteSetupManager();
Expand Down
2 changes: 1 addition & 1 deletion src/legacy/ui/public/utils/ipv4_address.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ function isIntegerInRange(integer: number, min: number, max: number) {
);
}

// eslint-disable-next-line @kbn/eslint/no-default-export
// eslint-disable-next-line import/no-default-export
// tslint:disable:no-default-export
export default class Ipv4Address {
private value: number;
Expand Down
2 changes: 1 addition & 1 deletion src/legacy/ui/public/utils/mapping_setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import angular from 'angular';
import _ from 'lodash';

// eslint-disable-next-line @kbn/eslint/no-default-export
// eslint-disable-next-line import/no-default-export
export default function MappingSetupService() {
const mappingSetup = this;

Expand Down
2 changes: 1 addition & 1 deletion src/legacy/ui/public/vis/agg_config_result.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

import chrome from '../chrome';

// eslint-disable-next-line @kbn/eslint/no-default-export
// eslint-disable-next-line import/no-default-export
export default function AggConfigResult(aggConfig, parent, value, key, filters) {
this.key = key;
this.value = value;
Expand Down
2 changes: 1 addition & 1 deletion src/legacy/ui/public/vislib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@

import { VislibProvider } from './vislib';

// eslint-disable-next-line @kbn/eslint/no-default-export
// eslint-disable-next-line import/no-default-export
export default VislibProvider;
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

import d3 from 'd3';

// eslint-disable-next-line @kbn/eslint/no-default-export
// eslint-disable-next-line import/no-default-export
export default function ChartSplitFactory() {

/*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

import d3 from 'd3';

// eslint-disable-next-line @kbn/eslint/no-default-export
// eslint-disable-next-line import/no-default-export
export default function ChartTitleSplitFactory() {

/*
Expand Down
2 changes: 1 addition & 1 deletion x-pack/test/functional/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* you may not use this file except in compliance with the Elastic License.
*/

/* eslint-disable @kbn/eslint/no-default-export */
/* eslint-disable import/no-default-export */

import { resolve } from 'path';

Expand Down

0 comments on commit 8257078

Please sign in to comment.