mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
use eslint-import-plugin/no-export-default instead of custom rule (#34285)
This commit is contained in:
parent
7198a1ffcd
commit
461289e05b
24 changed files with 22 additions and 52 deletions
|
@ -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',
|
||||
},
|
||||
},
|
||||
|
|
|
@ -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'),
|
||||
},
|
||||
|
|
|
@ -1,29 +0,0 @@
|
|||
/*
|
||||
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||
* license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright
|
||||
* ownership. Elasticsearch B.V. licenses this file to you under
|
||||
* the Apache License, Version 2.0 (the "License"); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
module.exports = {
|
||||
meta: {
|
||||
schema: [],
|
||||
},
|
||||
create: context => ({
|
||||
ExportDefaultDeclaration: node => {
|
||||
context.report(node, 'Default exports not allowed.');
|
||||
},
|
||||
}),
|
||||
};
|
|
@ -1,3 +1,3 @@
|
|||
rules:
|
||||
no-console: 2
|
||||
'@kbn/eslint/no-default-export': error
|
||||
'import/no-default-export': error
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
rules:
|
||||
no-console: 2
|
||||
'@kbn/eslint/no-default-export': error
|
||||
'import/no-default-export': error
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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')) {
|
||||
|
|
|
@ -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) {
|
||||
|
||||
/**
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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() {
|
||||
|
||||
/*
|
||||
|
|
|
@ -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() {
|
||||
|
||||
/*
|
||||
|
|
|
@ -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';
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue