kibana/.eslintrc.js

1014 lines
32 KiB
JavaScript
Raw Normal View History

/*
* 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.
*/
2018-04-20 21:13:37 +02:00
const { readdirSync } = require('fs');
Migrate from tslint (#33826) * chore(NA): remove tslint dependencies, configs and enable eslint typescript parser. * fix(NA): apply recommend eslint typescript rule.s * chore(NA): upgrade eslint package versions. * chore(NA): split javascript eslint config in an override section. * chore(NA): split all eslint configs with overrides. * chore(NA): remove missing console.log. * chore(NA): change eslint splits and overrides order. * chore(NA): replace tslint disable comments with eslint ones. * chore(NA): solve eslint typescript errors for elastic/kibana-custom/no-default-export * chore(NA): fixed multiple eslint typescript rule failures. * chore(NA): add tarfet folder to the eslint ignore. * chore(NA): apply prettier rule to ts type file. * chore(NA): remove last mentions to tslint * chore(NA): add old defined rules * chore(NA): missing port rules website * chore(na): ordered rules * chore(NA): solved eslint typescript problems. * chore(NA): fix spaced comment problems. * chore(NA): fix some more eslint typescript rules: import/order no-empty-interface * chore(NA): fix last rules and comment out what are the ones still failing. * chore(NA): comment out camelcase rule. * chore(NA): regenerate kbn pm dist. * chore(NA): updated snapshots. * chore(NA): updated snapshots. * chore(NA): disabled sort-keys rule. * chore(NA): remove rule prefer-arrow/prefer-arrow-functions. * chore(NA): fix for @typescript-eslint/no-var-requires rule. * chore(NA): fixes for @typescript-eslint/camelcase rule. * chore(NA): fix typo on eslint config kibana typescript. Co-Authored-By: mistic <tiagoffcc@hotmail.com> * chore(NA): remove legacy note after the intellij upgrade to 2019.1 * fix(NA): import order plugin. * chore(NA): fix ts ignore positions after auto fix. * fix(NA): performance issue with typescript eslint. * refact(NA): eslint configs organization. * chore(NA): apply resticted paths to ts files too. * chore(NA): split comment from eslint ignore.
2019-04-05 18:45:23 +02:00
const { resolve } = require('path');
const APACHE_2_0_LICENSE_HEADER = `
/*
* 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.
*/
`;
const ELASTIC_LICENSE_HEADER = `
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/
`;
const allMochaRulesOff = {};
Object.keys(require('eslint-plugin-mocha').rules).forEach(k => {
allMochaRulesOff['mocha/' + k] = 'off';
});
module.exports = {
2019-09-03 22:57:09 +02:00
root: true,
extends: ['@elastic/eslint-config-kibana', 'plugin:@elastic/eui/recommended'],
overrides: [
/**
* Temporarily disable some react rules for specific plugins, remove in separate PRs
*/
{
files: ['packages/kbn-ui-framework/**/*.{js,ts,tsx}'],
rules: {
'jsx-a11y/no-onchange': 'off',
},
},
{
files: ['src/plugins/es_ui_shared/**/*.{js,ts,tsx}'],
rules: {
'react-hooks/exhaustive-deps': 'off',
},
},
{
files: ['src/plugins/kibana_react/**/*.{js,ts,tsx}'],
rules: {
'react-hooks/rules-of-hooks': 'off',
'react-hooks/exhaustive-deps': 'off',
},
},
{
files: ['src/plugins/kibana_utils/**/*.{js,ts,tsx}'],
rules: {
'react-hooks/exhaustive-deps': 'off',
},
},
{
files: ['x-pack/plugins/canvas/**/*.{js,ts,tsx}'],
rules: {
'react-hooks/exhaustive-deps': 'off',
'jsx-a11y/click-events-have-key-events': 'off',
},
},
{
files: ['x-pack/plugins/cross_cluster_replication/**/*.{js,ts,tsx}'],
rules: {
'jsx-a11y/click-events-have-key-events': 'off',
},
},
{
files: ['x-pack/legacy/plugins/index_management/**/*.{js,ts,tsx}'],
rules: {
'react-hooks/exhaustive-deps': 'off',
'react-hooks/rules-of-hooks': 'off',
},
},
{
files: ['x-pack/plugins/lens/**/*.{js,ts,tsx}'],
rules: {
'react-hooks/exhaustive-deps': 'off',
},
},
{
files: ['x-pack/plugins/ml/**/*.{js,ts,tsx}'],
rules: {
'react-hooks/exhaustive-deps': 'off',
},
},
{
files: ['x-pack/legacy/plugins/snapshot_restore/**/*.{js,ts,tsx}'],
rules: {
'react-hooks/exhaustive-deps': 'off',
},
},
Migrate from tslint (#33826) * chore(NA): remove tslint dependencies, configs and enable eslint typescript parser. * fix(NA): apply recommend eslint typescript rule.s * chore(NA): upgrade eslint package versions. * chore(NA): split javascript eslint config in an override section. * chore(NA): split all eslint configs with overrides. * chore(NA): remove missing console.log. * chore(NA): change eslint splits and overrides order. * chore(NA): replace tslint disable comments with eslint ones. * chore(NA): solve eslint typescript errors for elastic/kibana-custom/no-default-export * chore(NA): fixed multiple eslint typescript rule failures. * chore(NA): add tarfet folder to the eslint ignore. * chore(NA): apply prettier rule to ts type file. * chore(NA): remove last mentions to tslint * chore(NA): add old defined rules * chore(NA): missing port rules website * chore(na): ordered rules * chore(NA): solved eslint typescript problems. * chore(NA): fix spaced comment problems. * chore(NA): fix some more eslint typescript rules: import/order no-empty-interface * chore(NA): fix last rules and comment out what are the ones still failing. * chore(NA): comment out camelcase rule. * chore(NA): regenerate kbn pm dist. * chore(NA): updated snapshots. * chore(NA): updated snapshots. * chore(NA): disabled sort-keys rule. * chore(NA): remove rule prefer-arrow/prefer-arrow-functions. * chore(NA): fix for @typescript-eslint/no-var-requires rule. * chore(NA): fixes for @typescript-eslint/camelcase rule. * chore(NA): fix typo on eslint config kibana typescript. Co-Authored-By: mistic <tiagoffcc@hotmail.com> * chore(NA): remove legacy note after the intellij upgrade to 2019.1 * fix(NA): import order plugin. * chore(NA): fix ts ignore positions after auto fix. * fix(NA): performance issue with typescript eslint. * refact(NA): eslint configs organization. * chore(NA): apply resticted paths to ts files too. * chore(NA): split comment from eslint ignore.
2019-04-05 18:45:23 +02:00
/**
* Files that require Apache 2.0 headers, settings
* are overridden below for files that require Elastic
* Licence headers
*/
{
files: ['**/*.{js,ts,tsx}', '!plugins/**/*'],
Migrate from tslint (#33826) * chore(NA): remove tslint dependencies, configs and enable eslint typescript parser. * fix(NA): apply recommend eslint typescript rule.s * chore(NA): upgrade eslint package versions. * chore(NA): split javascript eslint config in an override section. * chore(NA): split all eslint configs with overrides. * chore(NA): remove missing console.log. * chore(NA): change eslint splits and overrides order. * chore(NA): replace tslint disable comments with eslint ones. * chore(NA): solve eslint typescript errors for elastic/kibana-custom/no-default-export * chore(NA): fixed multiple eslint typescript rule failures. * chore(NA): add tarfet folder to the eslint ignore. * chore(NA): apply prettier rule to ts type file. * chore(NA): remove last mentions to tslint * chore(NA): add old defined rules * chore(NA): missing port rules website * chore(na): ordered rules * chore(NA): solved eslint typescript problems. * chore(NA): fix spaced comment problems. * chore(NA): fix some more eslint typescript rules: import/order no-empty-interface * chore(NA): fix last rules and comment out what are the ones still failing. * chore(NA): comment out camelcase rule. * chore(NA): regenerate kbn pm dist. * chore(NA): updated snapshots. * chore(NA): updated snapshots. * chore(NA): disabled sort-keys rule. * chore(NA): remove rule prefer-arrow/prefer-arrow-functions. * chore(NA): fix for @typescript-eslint/no-var-requires rule. * chore(NA): fixes for @typescript-eslint/camelcase rule. * chore(NA): fix typo on eslint config kibana typescript. Co-Authored-By: mistic <tiagoffcc@hotmail.com> * chore(NA): remove legacy note after the intellij upgrade to 2019.1 * fix(NA): import order plugin. * chore(NA): fix ts ignore positions after auto fix. * fix(NA): performance issue with typescript eslint. * refact(NA): eslint configs organization. * chore(NA): apply resticted paths to ts files too. * chore(NA): split comment from eslint ignore.
2019-04-05 18:45:23 +02:00
rules: {
'@kbn/eslint/require-license-header': [
'error',
{
license: APACHE_2_0_LICENSE_HEADER,
},
],
'@kbn/eslint/disallow-license-headers': [
'error',
{
licenses: [ELASTIC_LICENSE_HEADER],
},
],
},
},
/**
* New Platform client-side
*/
{
files: ['{src,x-pack}/plugins/*/public/**/*.{js,ts,tsx}'],
rules: {
'import/no-commonjs': 'error',
},
},
Migrate from tslint (#33826) * chore(NA): remove tslint dependencies, configs and enable eslint typescript parser. * fix(NA): apply recommend eslint typescript rule.s * chore(NA): upgrade eslint package versions. * chore(NA): split javascript eslint config in an override section. * chore(NA): split all eslint configs with overrides. * chore(NA): remove missing console.log. * chore(NA): change eslint splits and overrides order. * chore(NA): replace tslint disable comments with eslint ones. * chore(NA): solve eslint typescript errors for elastic/kibana-custom/no-default-export * chore(NA): fixed multiple eslint typescript rule failures. * chore(NA): add tarfet folder to the eslint ignore. * chore(NA): apply prettier rule to ts type file. * chore(NA): remove last mentions to tslint * chore(NA): add old defined rules * chore(NA): missing port rules website * chore(na): ordered rules * chore(NA): solved eslint typescript problems. * chore(NA): fix spaced comment problems. * chore(NA): fix some more eslint typescript rules: import/order no-empty-interface * chore(NA): fix last rules and comment out what are the ones still failing. * chore(NA): comment out camelcase rule. * chore(NA): regenerate kbn pm dist. * chore(NA): updated snapshots. * chore(NA): updated snapshots. * chore(NA): disabled sort-keys rule. * chore(NA): remove rule prefer-arrow/prefer-arrow-functions. * chore(NA): fix for @typescript-eslint/no-var-requires rule. * chore(NA): fixes for @typescript-eslint/camelcase rule. * chore(NA): fix typo on eslint config kibana typescript. Co-Authored-By: mistic <tiagoffcc@hotmail.com> * chore(NA): remove legacy note after the intellij upgrade to 2019.1 * fix(NA): import order plugin. * chore(NA): fix ts ignore positions after auto fix. * fix(NA): performance issue with typescript eslint. * refact(NA): eslint configs organization. * chore(NA): apply resticted paths to ts files too. * chore(NA): split comment from eslint ignore.
2019-04-05 18:45:23 +02:00
/**
* Files that require Elastic license headers instead of Apache 2.0 header
*/
{
files: ['x-pack/**/*.{js,ts,tsx}'],
rules: {
'@kbn/eslint/require-license-header': [
'error',
{
license: ELASTIC_LICENSE_HEADER,
},
],
'@kbn/eslint/disallow-license-headers': [
'error',
{
licenses: [APACHE_2_0_LICENSE_HEADER],
},
],
},
},
/**
* Restricted paths
*/
{
files: ['**/*.{js,ts,tsx}'],
rules: {
'@kbn/eslint/no-restricted-paths': [
'error',
{
basePath: __dirname,
zones: [
{
target: ['(src|x-pack)/**/*', '!src/core/**/*'],
from: ['src/core/utils/**/*'],
errorMessage: `Plugins may only import from src/core/server and src/core/public.`,
},
Migrate from tslint (#33826) * chore(NA): remove tslint dependencies, configs and enable eslint typescript parser. * fix(NA): apply recommend eslint typescript rule.s * chore(NA): upgrade eslint package versions. * chore(NA): split javascript eslint config in an override section. * chore(NA): split all eslint configs with overrides. * chore(NA): remove missing console.log. * chore(NA): change eslint splits and overrides order. * chore(NA): replace tslint disable comments with eslint ones. * chore(NA): solve eslint typescript errors for elastic/kibana-custom/no-default-export * chore(NA): fixed multiple eslint typescript rule failures. * chore(NA): add tarfet folder to the eslint ignore. * chore(NA): apply prettier rule to ts type file. * chore(NA): remove last mentions to tslint * chore(NA): add old defined rules * chore(NA): missing port rules website * chore(na): ordered rules * chore(NA): solved eslint typescript problems. * chore(NA): fix spaced comment problems. * chore(NA): fix some more eslint typescript rules: import/order no-empty-interface * chore(NA): fix last rules and comment out what are the ones still failing. * chore(NA): comment out camelcase rule. * chore(NA): regenerate kbn pm dist. * chore(NA): updated snapshots. * chore(NA): updated snapshots. * chore(NA): disabled sort-keys rule. * chore(NA): remove rule prefer-arrow/prefer-arrow-functions. * chore(NA): fix for @typescript-eslint/no-var-requires rule. * chore(NA): fixes for @typescript-eslint/camelcase rule. * chore(NA): fix typo on eslint config kibana typescript. Co-Authored-By: mistic <tiagoffcc@hotmail.com> * chore(NA): remove legacy note after the intellij upgrade to 2019.1 * fix(NA): import order plugin. * chore(NA): fix ts ignore positions after auto fix. * fix(NA): performance issue with typescript eslint. * refact(NA): eslint configs organization. * chore(NA): apply resticted paths to ts files too. * chore(NA): split comment from eslint ignore.
2019-04-05 18:45:23 +02:00
{
target: [
'(src|x-pack)/legacy/**/*',
'(src|x-pack)/plugins/**/(public|server)/**/*',
'examples/**/*',
Migrate from tslint (#33826) * chore(NA): remove tslint dependencies, configs and enable eslint typescript parser. * fix(NA): apply recommend eslint typescript rule.s * chore(NA): upgrade eslint package versions. * chore(NA): split javascript eslint config in an override section. * chore(NA): split all eslint configs with overrides. * chore(NA): remove missing console.log. * chore(NA): change eslint splits and overrides order. * chore(NA): replace tslint disable comments with eslint ones. * chore(NA): solve eslint typescript errors for elastic/kibana-custom/no-default-export * chore(NA): fixed multiple eslint typescript rule failures. * chore(NA): add tarfet folder to the eslint ignore. * chore(NA): apply prettier rule to ts type file. * chore(NA): remove last mentions to tslint * chore(NA): add old defined rules * chore(NA): missing port rules website * chore(na): ordered rules * chore(NA): solved eslint typescript problems. * chore(NA): fix spaced comment problems. * chore(NA): fix some more eslint typescript rules: import/order no-empty-interface * chore(NA): fix last rules and comment out what are the ones still failing. * chore(NA): comment out camelcase rule. * chore(NA): regenerate kbn pm dist. * chore(NA): updated snapshots. * chore(NA): updated snapshots. * chore(NA): disabled sort-keys rule. * chore(NA): remove rule prefer-arrow/prefer-arrow-functions. * chore(NA): fix for @typescript-eslint/no-var-requires rule. * chore(NA): fixes for @typescript-eslint/camelcase rule. * chore(NA): fix typo on eslint config kibana typescript. Co-Authored-By: mistic <tiagoffcc@hotmail.com> * chore(NA): remove legacy note after the intellij upgrade to 2019.1 * fix(NA): import order plugin. * chore(NA): fix ts ignore positions after auto fix. * fix(NA): performance issue with typescript eslint. * refact(NA): eslint configs organization. * chore(NA): apply resticted paths to ts files too. * chore(NA): split comment from eslint ignore.
2019-04-05 18:45:23 +02:00
],
from: [
'src/core/public/**/*',
'!src/core/public/index.ts', // relative import
'!src/core/public/mocks{,.ts}',
'!src/core/server/types{,.ts}',
Migrate from tslint (#33826) * chore(NA): remove tslint dependencies, configs and enable eslint typescript parser. * fix(NA): apply recommend eslint typescript rule.s * chore(NA): upgrade eslint package versions. * chore(NA): split javascript eslint config in an override section. * chore(NA): split all eslint configs with overrides. * chore(NA): remove missing console.log. * chore(NA): change eslint splits and overrides order. * chore(NA): replace tslint disable comments with eslint ones. * chore(NA): solve eslint typescript errors for elastic/kibana-custom/no-default-export * chore(NA): fixed multiple eslint typescript rule failures. * chore(NA): add tarfet folder to the eslint ignore. * chore(NA): apply prettier rule to ts type file. * chore(NA): remove last mentions to tslint * chore(NA): add old defined rules * chore(NA): missing port rules website * chore(na): ordered rules * chore(NA): solved eslint typescript problems. * chore(NA): fix spaced comment problems. * chore(NA): fix some more eslint typescript rules: import/order no-empty-interface * chore(NA): fix last rules and comment out what are the ones still failing. * chore(NA): comment out camelcase rule. * chore(NA): regenerate kbn pm dist. * chore(NA): updated snapshots. * chore(NA): updated snapshots. * chore(NA): disabled sort-keys rule. * chore(NA): remove rule prefer-arrow/prefer-arrow-functions. * chore(NA): fix for @typescript-eslint/no-var-requires rule. * chore(NA): fixes for @typescript-eslint/camelcase rule. * chore(NA): fix typo on eslint config kibana typescript. Co-Authored-By: mistic <tiagoffcc@hotmail.com> * chore(NA): remove legacy note after the intellij upgrade to 2019.1 * fix(NA): import order plugin. * chore(NA): fix ts ignore positions after auto fix. * fix(NA): performance issue with typescript eslint. * refact(NA): eslint configs organization. * chore(NA): apply resticted paths to ts files too. * chore(NA): split comment from eslint ignore.
2019-04-05 18:45:23 +02:00
'!src/core/public/utils/**/*',
'!src/core/public/*.test.mocks{,.ts}',
Migrate from tslint (#33826) * chore(NA): remove tslint dependencies, configs and enable eslint typescript parser. * fix(NA): apply recommend eslint typescript rule.s * chore(NA): upgrade eslint package versions. * chore(NA): split javascript eslint config in an override section. * chore(NA): split all eslint configs with overrides. * chore(NA): remove missing console.log. * chore(NA): change eslint splits and overrides order. * chore(NA): replace tslint disable comments with eslint ones. * chore(NA): solve eslint typescript errors for elastic/kibana-custom/no-default-export * chore(NA): fixed multiple eslint typescript rule failures. * chore(NA): add tarfet folder to the eslint ignore. * chore(NA): apply prettier rule to ts type file. * chore(NA): remove last mentions to tslint * chore(NA): add old defined rules * chore(NA): missing port rules website * chore(na): ordered rules * chore(NA): solved eslint typescript problems. * chore(NA): fix spaced comment problems. * chore(NA): fix some more eslint typescript rules: import/order no-empty-interface * chore(NA): fix last rules and comment out what are the ones still failing. * chore(NA): comment out camelcase rule. * chore(NA): regenerate kbn pm dist. * chore(NA): updated snapshots. * chore(NA): updated snapshots. * chore(NA): disabled sort-keys rule. * chore(NA): remove rule prefer-arrow/prefer-arrow-functions. * chore(NA): fix for @typescript-eslint/no-var-requires rule. * chore(NA): fixes for @typescript-eslint/camelcase rule. * chore(NA): fix typo on eslint config kibana typescript. Co-Authored-By: mistic <tiagoffcc@hotmail.com> * chore(NA): remove legacy note after the intellij upgrade to 2019.1 * fix(NA): import order plugin. * chore(NA): fix ts ignore positions after auto fix. * fix(NA): performance issue with typescript eslint. * refact(NA): eslint configs organization. * chore(NA): apply resticted paths to ts files too. * chore(NA): split comment from eslint ignore.
2019-04-05 18:45:23 +02:00
'src/core/server/**/*',
'!src/core/server/index.ts', // relative import
'!src/core/server/mocks{,.ts}',
'!src/core/server/types{,.ts}',
'!src/core/server/test_utils',
// for absolute imports until fixed in
// https://github.com/elastic/kibana/issues/36096
'!src/core/server/*.test.mocks{,.ts}',
],
allowSameFolder: true,
errorMessage:
'Plugins may only import from top-level public and server modules in core.',
},
{
target: [
'(src|x-pack)/legacy/**/*',
'(src|x-pack)/plugins/**/(public|server)/**/*',
'examples/**/*',
'!(src|x-pack)/**/*.test.*',
'!(x-pack/)?test/**/*',
// next folder contains legacy browser tests which can't be migrated to jest
// which import np files
'!src/legacy/core_plugins/kibana/public/__tests__/**/*',
],
from: [
'(src|x-pack)/plugins/**/(public|server)/**/*',
'!(src|x-pack)/plugins/**/(public|server)/mocks/index.{js,ts}',
'!(src|x-pack)/plugins/**/(public|server)/(index|mocks).{js,ts,tsx}',
Migrate from tslint (#33826) * chore(NA): remove tslint dependencies, configs and enable eslint typescript parser. * fix(NA): apply recommend eslint typescript rule.s * chore(NA): upgrade eslint package versions. * chore(NA): split javascript eslint config in an override section. * chore(NA): split all eslint configs with overrides. * chore(NA): remove missing console.log. * chore(NA): change eslint splits and overrides order. * chore(NA): replace tslint disable comments with eslint ones. * chore(NA): solve eslint typescript errors for elastic/kibana-custom/no-default-export * chore(NA): fixed multiple eslint typescript rule failures. * chore(NA): add tarfet folder to the eslint ignore. * chore(NA): apply prettier rule to ts type file. * chore(NA): remove last mentions to tslint * chore(NA): add old defined rules * chore(NA): missing port rules website * chore(na): ordered rules * chore(NA): solved eslint typescript problems. * chore(NA): fix spaced comment problems. * chore(NA): fix some more eslint typescript rules: import/order no-empty-interface * chore(NA): fix last rules and comment out what are the ones still failing. * chore(NA): comment out camelcase rule. * chore(NA): regenerate kbn pm dist. * chore(NA): updated snapshots. * chore(NA): updated snapshots. * chore(NA): disabled sort-keys rule. * chore(NA): remove rule prefer-arrow/prefer-arrow-functions. * chore(NA): fix for @typescript-eslint/no-var-requires rule. * chore(NA): fixes for @typescript-eslint/camelcase rule. * chore(NA): fix typo on eslint config kibana typescript. Co-Authored-By: mistic <tiagoffcc@hotmail.com> * chore(NA): remove legacy note after the intellij upgrade to 2019.1 * fix(NA): import order plugin. * chore(NA): fix ts ignore positions after auto fix. * fix(NA): performance issue with typescript eslint. * refact(NA): eslint configs organization. * chore(NA): apply resticted paths to ts files too. * chore(NA): split comment from eslint ignore.
2019-04-05 18:45:23 +02:00
],
allowSameFolder: true,
errorMessage: 'Plugins may only import from top-level public and server modules.',
},
{
target: [
'(src|x-pack)/plugins/**/*',
'!(src|x-pack)/plugins/**/server/**/*',
'src/legacy/core_plugins/**/*',
'!src/legacy/core_plugins/**/server/**/*',
'!src/legacy/core_plugins/**/index.{js,ts,tsx}',
'x-pack/legacy/plugins/**/*',
'!x-pack/legacy/plugins/**/server/**/*',
'!x-pack/legacy/plugins/**/index.{js,ts,tsx}',
'examples/**/*',
'!examples/**/server/**/*',
],
from: [
'src/core/server',
'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.',
Migrate from tslint (#33826) * chore(NA): remove tslint dependencies, configs and enable eslint typescript parser. * fix(NA): apply recommend eslint typescript rule.s * chore(NA): upgrade eslint package versions. * chore(NA): split javascript eslint config in an override section. * chore(NA): split all eslint configs with overrides. * chore(NA): remove missing console.log. * chore(NA): change eslint splits and overrides order. * chore(NA): replace tslint disable comments with eslint ones. * chore(NA): solve eslint typescript errors for elastic/kibana-custom/no-default-export * chore(NA): fixed multiple eslint typescript rule failures. * chore(NA): add tarfet folder to the eslint ignore. * chore(NA): apply prettier rule to ts type file. * chore(NA): remove last mentions to tslint * chore(NA): add old defined rules * chore(NA): missing port rules website * chore(na): ordered rules * chore(NA): solved eslint typescript problems. * chore(NA): fix spaced comment problems. * chore(NA): fix some more eslint typescript rules: import/order no-empty-interface * chore(NA): fix last rules and comment out what are the ones still failing. * chore(NA): comment out camelcase rule. * chore(NA): regenerate kbn pm dist. * chore(NA): updated snapshots. * chore(NA): updated snapshots. * chore(NA): disabled sort-keys rule. * chore(NA): remove rule prefer-arrow/prefer-arrow-functions. * chore(NA): fix for @typescript-eslint/no-var-requires rule. * chore(NA): fixes for @typescript-eslint/camelcase rule. * chore(NA): fix typo on eslint config kibana typescript. Co-Authored-By: mistic <tiagoffcc@hotmail.com> * chore(NA): remove legacy note after the intellij upgrade to 2019.1 * fix(NA): import order plugin. * chore(NA): fix ts ignore positions after auto fix. * fix(NA): performance issue with typescript eslint. * refact(NA): eslint configs organization. * chore(NA): apply resticted paths to ts files too. * chore(NA): split comment from eslint ignore.
2019-04-05 18:45:23 +02:00
},
{
target: ['src/**/*'],
from: ['x-pack/**/*'],
errorMessage: 'OSS cannot import x-pack files.',
},
{
target: ['src/core/**/*'],
from: [
'plugins/**/*',
'src/plugins/**/*',
'src/legacy/core_plugins/**/*',
'src/legacy/ui/**/*',
],
errorMessage: 'The core cannot depend on any plugins.',
},
{
target: ['(src|x-pack)/plugins/*/public/**/*'],
from: ['ui/**/*', 'uiExports/**/*'],
errorMessage: 'Plugins cannot import legacy UI code.',
},
{
from: ['src/legacy/ui/**/*', 'ui/**/*'],
target: [
'test/plugin_functional/plugins/**/public/np_ready/**/*',
'test/plugin_functional/plugins/**/server/np_ready/**/*',
'src/legacy/core_plugins/**/public/np_ready/**/*',
'src/legacy/core_plugins/vis_type_*/public/**/*',
'!src/legacy/core_plugins/vis_type_*/public/legacy*',
'src/legacy/core_plugins/**/server/np_ready/**/*',
'x-pack/legacy/plugins/**/public/np_ready/**/*',
'x-pack/legacy/plugins/**/server/np_ready/**/*',
],
allowSameFolder: true,
errorMessage:
'NP-ready code should not import from /src/legacy/ui/** folder. ' +
'Instead of importing from /src/legacy/ui/** deeply within a np_ready folder, ' +
'import those things once at the top level of your plugin and pass those down, just ' +
'like you pass down `core` and `plugins` objects.',
},
Migrate from tslint (#33826) * chore(NA): remove tslint dependencies, configs and enable eslint typescript parser. * fix(NA): apply recommend eslint typescript rule.s * chore(NA): upgrade eslint package versions. * chore(NA): split javascript eslint config in an override section. * chore(NA): split all eslint configs with overrides. * chore(NA): remove missing console.log. * chore(NA): change eslint splits and overrides order. * chore(NA): replace tslint disable comments with eslint ones. * chore(NA): solve eslint typescript errors for elastic/kibana-custom/no-default-export * chore(NA): fixed multiple eslint typescript rule failures. * chore(NA): add tarfet folder to the eslint ignore. * chore(NA): apply prettier rule to ts type file. * chore(NA): remove last mentions to tslint * chore(NA): add old defined rules * chore(NA): missing port rules website * chore(na): ordered rules * chore(NA): solved eslint typescript problems. * chore(NA): fix spaced comment problems. * chore(NA): fix some more eslint typescript rules: import/order no-empty-interface * chore(NA): fix last rules and comment out what are the ones still failing. * chore(NA): comment out camelcase rule. * chore(NA): regenerate kbn pm dist. * chore(NA): updated snapshots. * chore(NA): updated snapshots. * chore(NA): disabled sort-keys rule. * chore(NA): remove rule prefer-arrow/prefer-arrow-functions. * chore(NA): fix for @typescript-eslint/no-var-requires rule. * chore(NA): fixes for @typescript-eslint/camelcase rule. * chore(NA): fix typo on eslint config kibana typescript. Co-Authored-By: mistic <tiagoffcc@hotmail.com> * chore(NA): remove legacy note after the intellij upgrade to 2019.1 * fix(NA): import order plugin. * chore(NA): fix ts ignore positions after auto fix. * fix(NA): performance issue with typescript eslint. * refact(NA): eslint configs organization. * chore(NA): apply resticted paths to ts files too. * chore(NA): split comment from eslint ignore.
2019-04-05 18:45:23 +02:00
],
},
],
},
},
2018-04-20 21:13:37 +02:00
/**
* Allow default exports
*/
{
[WIP] FTR Percy changes (#36897) * [ftr/percy] integrate percy with functional test runner * execute ftr within `percy exec` * share PERCY_BIN and GRUNT_BIN vars in setup * [license] whitelist `(Unlicense OR Apache-2.0)` * [percy] include pr/parallel info in env * echo the actual variable value * destructure required modules * [ci] calculate percy env in a script * remove outdated eslint overrides * oops, nonce should be the same for each build * take snapshots in context tests * add percy snapshots to some dashboard tests * account for extra execution of PERCY_BIN * remove usage of percy service * rename service to `visualTesting` * write a simple test * switch left-over percy test to visualTesting * set log level for percy agent * trigger ci * try using the system chrome install instead of downloading one * fix export definition * Don't skip chromium download * Add Spencer's fix to point to chrome installation * Attempting to split tests into own ci job and test files * Renumber job * Add tag to decorations file * Try new files with existing CI job * Try again to create a new CI job * Fix eslint problem with space * eslint updates * fix console test * make test names unique * Update ci group names * Try old name again * save * add separate visual_regression ci job * add visual regression ci job * add new job to jobs.yml * update path to take_percy_snapshot script * use fixed percy job total * fix common services import * move visual_create_and_add_embeddables to visual_regression project * finish moving create_and_add_embeddables * add x-pack visual regression job * migrate dashboard_snapshots tests to visual_regression * remove references to removed test files * restore some unnecessary changes * reimplement the login page tests * yarn.lock update * fix test * remove old CI_GROUP 100 block * update failed_tests trap * reduce yarn.lock changes * disable debug logging * disable visual-regression tests for now, we can enable them in specific prs
2019-06-14 18:35:23 +02:00
files: [
'x-pack/test/functional/apps/**/*.js',
'x-pack/plugins/apm/**/*.js',
[WIP] FTR Percy changes (#36897) * [ftr/percy] integrate percy with functional test runner * execute ftr within `percy exec` * share PERCY_BIN and GRUNT_BIN vars in setup * [license] whitelist `(Unlicense OR Apache-2.0)` * [percy] include pr/parallel info in env * echo the actual variable value * destructure required modules * [ci] calculate percy env in a script * remove outdated eslint overrides * oops, nonce should be the same for each build * take snapshots in context tests * add percy snapshots to some dashboard tests * account for extra execution of PERCY_BIN * remove usage of percy service * rename service to `visualTesting` * write a simple test * switch left-over percy test to visualTesting * set log level for percy agent * trigger ci * try using the system chrome install instead of downloading one * fix export definition * Don't skip chromium download * Add Spencer's fix to point to chrome installation * Attempting to split tests into own ci job and test files * Renumber job * Add tag to decorations file * Try new files with existing CI job * Try again to create a new CI job * Fix eslint problem with space * eslint updates * fix console test * make test names unique * Update ci group names * Try old name again * save * add separate visual_regression ci job * add visual regression ci job * add new job to jobs.yml * update path to take_percy_snapshot script * use fixed percy job total * fix common services import * move visual_create_and_add_embeddables to visual_regression project * finish moving create_and_add_embeddables * add x-pack visual regression job * migrate dashboard_snapshots tests to visual_regression * remove references to removed test files * restore some unnecessary changes * reimplement the login page tests * yarn.lock update * fix test * remove old CI_GROUP 100 block * update failed_tests trap * reduce yarn.lock changes * disable debug logging * disable visual-regression tests for now, we can enable them in specific prs
2019-06-14 18:35:23 +02:00
'test/*/config.ts',
'test/*/config_open.ts',
'test/*/{tests,test_suites,apis,apps}/**/*',
[WIP] FTR Percy changes (#36897) * [ftr/percy] integrate percy with functional test runner * execute ftr within `percy exec` * share PERCY_BIN and GRUNT_BIN vars in setup * [license] whitelist `(Unlicense OR Apache-2.0)` * [percy] include pr/parallel info in env * echo the actual variable value * destructure required modules * [ci] calculate percy env in a script * remove outdated eslint overrides * oops, nonce should be the same for each build * take snapshots in context tests * add percy snapshots to some dashboard tests * account for extra execution of PERCY_BIN * remove usage of percy service * rename service to `visualTesting` * write a simple test * switch left-over percy test to visualTesting * set log level for percy agent * trigger ci * try using the system chrome install instead of downloading one * fix export definition * Don't skip chromium download * Add Spencer's fix to point to chrome installation * Attempting to split tests into own ci job and test files * Renumber job * Add tag to decorations file * Try new files with existing CI job * Try again to create a new CI job * Fix eslint problem with space * eslint updates * fix console test * make test names unique * Update ci group names * Try old name again * save * add separate visual_regression ci job * add visual regression ci job * add new job to jobs.yml * update path to take_percy_snapshot script * use fixed percy job total * fix common services import * move visual_create_and_add_embeddables to visual_regression project * finish moving create_and_add_embeddables * add x-pack visual regression job * migrate dashboard_snapshots tests to visual_regression * remove references to removed test files * restore some unnecessary changes * reimplement the login page tests * yarn.lock update * fix test * remove old CI_GROUP 100 block * update failed_tests trap * reduce yarn.lock changes * disable debug logging * disable visual-regression tests for now, we can enable them in specific prs
2019-06-14 18:35:23 +02:00
'test/visual_regression/tests/**/*',
'x-pack/test/*/{tests,test_suites,apis,apps}/**/*',
'x-pack/test/*/*config.*ts',
'x-pack/test/saved_object_api_integration/*/apis/**/*',
'x-pack/test/ui_capabilities/*/tests/**/*',
[WIP] FTR Percy changes (#36897) * [ftr/percy] integrate percy with functional test runner * execute ftr within `percy exec` * share PERCY_BIN and GRUNT_BIN vars in setup * [license] whitelist `(Unlicense OR Apache-2.0)` * [percy] include pr/parallel info in env * echo the actual variable value * destructure required modules * [ci] calculate percy env in a script * remove outdated eslint overrides * oops, nonce should be the same for each build * take snapshots in context tests * add percy snapshots to some dashboard tests * account for extra execution of PERCY_BIN * remove usage of percy service * rename service to `visualTesting` * write a simple test * switch left-over percy test to visualTesting * set log level for percy agent * trigger ci * try using the system chrome install instead of downloading one * fix export definition * Don't skip chromium download * Add Spencer's fix to point to chrome installation * Attempting to split tests into own ci job and test files * Renumber job * Add tag to decorations file * Try new files with existing CI job * Try again to create a new CI job * Fix eslint problem with space * eslint updates * fix console test * make test names unique * Update ci group names * Try old name again * save * add separate visual_regression ci job * add visual regression ci job * add new job to jobs.yml * update path to take_percy_snapshot script * use fixed percy job total * fix common services import * move visual_create_and_add_embeddables to visual_regression project * finish moving create_and_add_embeddables * add x-pack visual regression job * migrate dashboard_snapshots tests to visual_regression * remove references to removed test files * restore some unnecessary changes * reimplement the login page tests * yarn.lock update * fix test * remove old CI_GROUP 100 block * update failed_tests trap * reduce yarn.lock changes * disable debug logging * disable visual-regression tests for now, we can enable them in specific prs
2019-06-14 18:35:23 +02:00
],
rules: {
'import/no-default-export': 'off',
2018-04-20 21:13:37 +02:00
'import/no-named-as-default': 'off',
},
},
2018-04-20 21:13:37 +02:00
/**
* Files that are allowed to import webpack-specific stuff
*/
{
2018-04-20 21:13:37 +02:00
files: [
Migrate from tslint (#33826) * chore(NA): remove tslint dependencies, configs and enable eslint typescript parser. * fix(NA): apply recommend eslint typescript rule.s * chore(NA): upgrade eslint package versions. * chore(NA): split javascript eslint config in an override section. * chore(NA): split all eslint configs with overrides. * chore(NA): remove missing console.log. * chore(NA): change eslint splits and overrides order. * chore(NA): replace tslint disable comments with eslint ones. * chore(NA): solve eslint typescript errors for elastic/kibana-custom/no-default-export * chore(NA): fixed multiple eslint typescript rule failures. * chore(NA): add tarfet folder to the eslint ignore. * chore(NA): apply prettier rule to ts type file. * chore(NA): remove last mentions to tslint * chore(NA): add old defined rules * chore(NA): missing port rules website * chore(na): ordered rules * chore(NA): solved eslint typescript problems. * chore(NA): fix spaced comment problems. * chore(NA): fix some more eslint typescript rules: import/order no-empty-interface * chore(NA): fix last rules and comment out what are the ones still failing. * chore(NA): comment out camelcase rule. * chore(NA): regenerate kbn pm dist. * chore(NA): updated snapshots. * chore(NA): updated snapshots. * chore(NA): disabled sort-keys rule. * chore(NA): remove rule prefer-arrow/prefer-arrow-functions. * chore(NA): fix for @typescript-eslint/no-var-requires rule. * chore(NA): fixes for @typescript-eslint/camelcase rule. * chore(NA): fix typo on eslint config kibana typescript. Co-Authored-By: mistic <tiagoffcc@hotmail.com> * chore(NA): remove legacy note after the intellij upgrade to 2019.1 * fix(NA): import order plugin. * chore(NA): fix ts ignore positions after auto fix. * fix(NA): performance issue with typescript eslint. * refact(NA): eslint configs organization. * chore(NA): apply resticted paths to ts files too. * chore(NA): split comment from eslint ignore.
2019-04-05 18:45:23 +02:00
'**/public/**/*.js',
'**/webpackShims/**/*.js',
'packages/kbn-ui-framework/doc_site/src/**/*.js',
'src/fixtures/**/*.js', // TODO: this directory needs to be more obviously "public" (or go away)
],
2018-04-20 21:13:37 +02:00
settings: {
// instructs import/no-extraneous-dependencies to treat certain modules
// as core modules, even if they aren't listed in package.json
'import/core-modules': ['plugins', 'legacy/ui', 'uiExports'],
2018-04-20 21:13:37 +02:00
'import/resolver': {
'@kbn/eslint-import-resolver-kibana': {
forceNode: false,
2018-04-20 21:13:37 +02:00
rootPackageName: 'kibana',
kibanaPath: '.',
pluginMap: readdirSync(resolve(__dirname, 'x-pack/legacy/plugins')).reduce(
(acc, name) => {
if (!name.startsWith('_')) {
acc[name] = `x-pack/legacy/plugins/${name}`;
}
return acc;
},
{}
),
2018-04-20 21:13:37 +02:00
},
},
},
},
/**
Validate current node version (#19154) * feat(12976): node version validation at runtime. * refact(12976): move the code into a static utilities class. * test(12976): added first test case using jest. * test(12976): added test cases for node_version. * feat(12976): create setup env node to bootstrap babel, ts-node and node version validator. * refact(12976): migrated node version code from es6 to es5. * feat(12976): node version validation at runtime. * refact(12976): move the code into a static utilities class. * test(12976): added first test case using jest. * test(12976): added test cases for node_version. * feat(12976): create setup env node to bootstrap babel, ts-node and node version validator. * refact(12976): migrated node version code from es6 to es5. * fix(12976): remove one level from ts node register cache directory link. * chore(12976): added caret to semver dependecy in order to support minor versions. * refact(12976): small change from named import to default import on node version validator. * refact(12976): removed ts_node_register and add the code to babel_register. * feat(12976): split eslint config in order to properly support files built to run before and after node version validator. refact(12976): convert script files to es5 code. refact(12976): delete inline eslint configs from node version check related files. * refact(12976): remove ts node register file. * refact(12976): completely port setup_node_env to es5. * refact(12976): remove babel_register invokation from external dependencies in scripts. * refact(12976): move node_version code directly into node_version_validator inside setup_node_env folder. * refact(12976): only node version validator for kbn script.
2018-05-25 19:43:01 +02:00
* Files that ARE NOT allowed to use devDependencies
2018-04-20 21:13:37 +02:00
*/
{
Migrate from tslint (#33826) * chore(NA): remove tslint dependencies, configs and enable eslint typescript parser. * fix(NA): apply recommend eslint typescript rule.s * chore(NA): upgrade eslint package versions. * chore(NA): split javascript eslint config in an override section. * chore(NA): split all eslint configs with overrides. * chore(NA): remove missing console.log. * chore(NA): change eslint splits and overrides order. * chore(NA): replace tslint disable comments with eslint ones. * chore(NA): solve eslint typescript errors for elastic/kibana-custom/no-default-export * chore(NA): fixed multiple eslint typescript rule failures. * chore(NA): add tarfet folder to the eslint ignore. * chore(NA): apply prettier rule to ts type file. * chore(NA): remove last mentions to tslint * chore(NA): add old defined rules * chore(NA): missing port rules website * chore(na): ordered rules * chore(NA): solved eslint typescript problems. * chore(NA): fix spaced comment problems. * chore(NA): fix some more eslint typescript rules: import/order no-empty-interface * chore(NA): fix last rules and comment out what are the ones still failing. * chore(NA): comment out camelcase rule. * chore(NA): regenerate kbn pm dist. * chore(NA): updated snapshots. * chore(NA): updated snapshots. * chore(NA): disabled sort-keys rule. * chore(NA): remove rule prefer-arrow/prefer-arrow-functions. * chore(NA): fix for @typescript-eslint/no-var-requires rule. * chore(NA): fixes for @typescript-eslint/camelcase rule. * chore(NA): fix typo on eslint config kibana typescript. Co-Authored-By: mistic <tiagoffcc@hotmail.com> * chore(NA): remove legacy note after the intellij upgrade to 2019.1 * fix(NA): import order plugin. * chore(NA): fix ts ignore positions after auto fix. * fix(NA): performance issue with typescript eslint. * refact(NA): eslint configs organization. * chore(NA): apply resticted paths to ts files too. * chore(NA): split comment from eslint ignore.
2019-04-05 18:45:23 +02:00
files: [
'packages/kbn-ui-framework/**/*.js',
'x-pack/**/*.js',
'packages/kbn-interpreter/**/*.js',
],
rules: {
'import/no-extraneous-dependencies': [
'error',
{
devDependencies: false,
peerDependencies: true,
},
],
},
},
2018-04-20 21:13:37 +02:00
/**
Validate current node version (#19154) * feat(12976): node version validation at runtime. * refact(12976): move the code into a static utilities class. * test(12976): added first test case using jest. * test(12976): added test cases for node_version. * feat(12976): create setup env node to bootstrap babel, ts-node and node version validator. * refact(12976): migrated node version code from es6 to es5. * feat(12976): node version validation at runtime. * refact(12976): move the code into a static utilities class. * test(12976): added first test case using jest. * test(12976): added test cases for node_version. * feat(12976): create setup env node to bootstrap babel, ts-node and node version validator. * refact(12976): migrated node version code from es6 to es5. * fix(12976): remove one level from ts node register cache directory link. * chore(12976): added caret to semver dependecy in order to support minor versions. * refact(12976): small change from named import to default import on node version validator. * refact(12976): removed ts_node_register and add the code to babel_register. * feat(12976): split eslint config in order to properly support files built to run before and after node version validator. refact(12976): convert script files to es5 code. refact(12976): delete inline eslint configs from node version check related files. * refact(12976): remove ts node register file. * refact(12976): completely port setup_node_env to es5. * refact(12976): remove babel_register invokation from external dependencies in scripts. * refact(12976): move node_version code directly into node_version_validator inside setup_node_env folder. * refact(12976): only node version validator for kbn script.
2018-05-25 19:43:01 +02:00
* Files that ARE allowed to use devDependencies
2018-04-20 21:13:37 +02:00
*/
{
files: [
'packages/kbn-ui-framework/**/*.test.js',
Migrate from tslint (#33826) * chore(NA): remove tslint dependencies, configs and enable eslint typescript parser. * fix(NA): apply recommend eslint typescript rule.s * chore(NA): upgrade eslint package versions. * chore(NA): split javascript eslint config in an override section. * chore(NA): split all eslint configs with overrides. * chore(NA): remove missing console.log. * chore(NA): change eslint splits and overrides order. * chore(NA): replace tslint disable comments with eslint ones. * chore(NA): solve eslint typescript errors for elastic/kibana-custom/no-default-export * chore(NA): fixed multiple eslint typescript rule failures. * chore(NA): add tarfet folder to the eslint ignore. * chore(NA): apply prettier rule to ts type file. * chore(NA): remove last mentions to tslint * chore(NA): add old defined rules * chore(NA): missing port rules website * chore(na): ordered rules * chore(NA): solved eslint typescript problems. * chore(NA): fix spaced comment problems. * chore(NA): fix some more eslint typescript rules: import/order no-empty-interface * chore(NA): fix last rules and comment out what are the ones still failing. * chore(NA): comment out camelcase rule. * chore(NA): regenerate kbn pm dist. * chore(NA): updated snapshots. * chore(NA): updated snapshots. * chore(NA): disabled sort-keys rule. * chore(NA): remove rule prefer-arrow/prefer-arrow-functions. * chore(NA): fix for @typescript-eslint/no-var-requires rule. * chore(NA): fixes for @typescript-eslint/camelcase rule. * chore(NA): fix typo on eslint config kibana typescript. Co-Authored-By: mistic <tiagoffcc@hotmail.com> * chore(NA): remove legacy note after the intellij upgrade to 2019.1 * fix(NA): import order plugin. * chore(NA): fix ts ignore positions after auto fix. * fix(NA): performance issue with typescript eslint. * refact(NA): eslint configs organization. * chore(NA): apply resticted paths to ts files too. * chore(NA): split comment from eslint ignore.
2019-04-05 18:45:23 +02:00
'packages/kbn-ui-framework/doc_site/**/*.js',
'packages/kbn-ui-framework/generator-kui/**/*.js',
'packages/kbn-ui-framework/Gruntfile.js',
Migrate from tslint (#33826) * chore(NA): remove tslint dependencies, configs and enable eslint typescript parser. * fix(NA): apply recommend eslint typescript rule.s * chore(NA): upgrade eslint package versions. * chore(NA): split javascript eslint config in an override section. * chore(NA): split all eslint configs with overrides. * chore(NA): remove missing console.log. * chore(NA): change eslint splits and overrides order. * chore(NA): replace tslint disable comments with eslint ones. * chore(NA): solve eslint typescript errors for elastic/kibana-custom/no-default-export * chore(NA): fixed multiple eslint typescript rule failures. * chore(NA): add tarfet folder to the eslint ignore. * chore(NA): apply prettier rule to ts type file. * chore(NA): remove last mentions to tslint * chore(NA): add old defined rules * chore(NA): missing port rules website * chore(na): ordered rules * chore(NA): solved eslint typescript problems. * chore(NA): fix spaced comment problems. * chore(NA): fix some more eslint typescript rules: import/order no-empty-interface * chore(NA): fix last rules and comment out what are the ones still failing. * chore(NA): comment out camelcase rule. * chore(NA): regenerate kbn pm dist. * chore(NA): updated snapshots. * chore(NA): updated snapshots. * chore(NA): disabled sort-keys rule. * chore(NA): remove rule prefer-arrow/prefer-arrow-functions. * chore(NA): fix for @typescript-eslint/no-var-requires rule. * chore(NA): fixes for @typescript-eslint/camelcase rule. * chore(NA): fix typo on eslint config kibana typescript. Co-Authored-By: mistic <tiagoffcc@hotmail.com> * chore(NA): remove legacy note after the intellij upgrade to 2019.1 * fix(NA): import order plugin. * chore(NA): fix ts ignore positions after auto fix. * fix(NA): performance issue with typescript eslint. * refact(NA): eslint configs organization. * chore(NA): apply resticted paths to ts files too. * chore(NA): split comment from eslint ignore.
2019-04-05 18:45:23 +02:00
'packages/kbn-es/src/**/*.js',
'packages/kbn-interpreter/tasks/**/*.js',
'packages/kbn-interpreter/src/plugin/**/*.js',
'x-pack/{dev-tools,tasks,scripts,test,build_chromium}/**/*.js',
'x-pack/**/{__tests__,__test__,__jest__,__fixtures__,__mocks__}/**/*.js',
2018-04-20 21:13:37 +02:00
'x-pack/**/*.test.js',
'x-pack/test_utils/**/*',
2018-04-20 21:13:37 +02:00
'x-pack/gulpfile.js',
'x-pack/plugins/apm/public/utils/testHelpers.js',
],
rules: {
'import/no-extraneous-dependencies': [
'error',
{
devDependencies: true,
peerDependencies: true,
},
],
},
},
2018-04-20 21:13:37 +02:00
/**
Validate current node version (#19154) * feat(12976): node version validation at runtime. * refact(12976): move the code into a static utilities class. * test(12976): added first test case using jest. * test(12976): added test cases for node_version. * feat(12976): create setup env node to bootstrap babel, ts-node and node version validator. * refact(12976): migrated node version code from es6 to es5. * feat(12976): node version validation at runtime. * refact(12976): move the code into a static utilities class. * test(12976): added first test case using jest. * test(12976): added test cases for node_version. * feat(12976): create setup env node to bootstrap babel, ts-node and node version validator. * refact(12976): migrated node version code from es6 to es5. * fix(12976): remove one level from ts node register cache directory link. * chore(12976): added caret to semver dependecy in order to support minor versions. * refact(12976): small change from named import to default import on node version validator. * refact(12976): removed ts_node_register and add the code to babel_register. * feat(12976): split eslint config in order to properly support files built to run before and after node version validator. refact(12976): convert script files to es5 code. refact(12976): delete inline eslint configs from node version check related files. * refact(12976): remove ts node register file. * refact(12976): completely port setup_node_env to es5. * refact(12976): remove babel_register invokation from external dependencies in scripts. * refact(12976): move node_version code directly into node_version_validator inside setup_node_env folder. * refact(12976): only node version validator for kbn script.
2018-05-25 19:43:01 +02:00
* Files that run BEFORE node version check
*/
{
Migrate from tslint (#33826) * chore(NA): remove tslint dependencies, configs and enable eslint typescript parser. * fix(NA): apply recommend eslint typescript rule.s * chore(NA): upgrade eslint package versions. * chore(NA): split javascript eslint config in an override section. * chore(NA): split all eslint configs with overrides. * chore(NA): remove missing console.log. * chore(NA): change eslint splits and overrides order. * chore(NA): replace tslint disable comments with eslint ones. * chore(NA): solve eslint typescript errors for elastic/kibana-custom/no-default-export * chore(NA): fixed multiple eslint typescript rule failures. * chore(NA): add tarfet folder to the eslint ignore. * chore(NA): apply prettier rule to ts type file. * chore(NA): remove last mentions to tslint * chore(NA): add old defined rules * chore(NA): missing port rules website * chore(na): ordered rules * chore(NA): solved eslint typescript problems. * chore(NA): fix spaced comment problems. * chore(NA): fix some more eslint typescript rules: import/order no-empty-interface * chore(NA): fix last rules and comment out what are the ones still failing. * chore(NA): comment out camelcase rule. * chore(NA): regenerate kbn pm dist. * chore(NA): updated snapshots. * chore(NA): updated snapshots. * chore(NA): disabled sort-keys rule. * chore(NA): remove rule prefer-arrow/prefer-arrow-functions. * chore(NA): fix for @typescript-eslint/no-var-requires rule. * chore(NA): fixes for @typescript-eslint/camelcase rule. * chore(NA): fix typo on eslint config kibana typescript. Co-Authored-By: mistic <tiagoffcc@hotmail.com> * chore(NA): remove legacy note after the intellij upgrade to 2019.1 * fix(NA): import order plugin. * chore(NA): fix ts ignore positions after auto fix. * fix(NA): performance issue with typescript eslint. * refact(NA): eslint configs organization. * chore(NA): apply resticted paths to ts files too. * chore(NA): split comment from eslint ignore.
2019-04-05 18:45:23 +02:00
files: ['scripts/**/*.js', 'src/setup_node_env/**/*.js'],
Validate current node version (#19154) * feat(12976): node version validation at runtime. * refact(12976): move the code into a static utilities class. * test(12976): added first test case using jest. * test(12976): added test cases for node_version. * feat(12976): create setup env node to bootstrap babel, ts-node and node version validator. * refact(12976): migrated node version code from es6 to es5. * feat(12976): node version validation at runtime. * refact(12976): move the code into a static utilities class. * test(12976): added first test case using jest. * test(12976): added test cases for node_version. * feat(12976): create setup env node to bootstrap babel, ts-node and node version validator. * refact(12976): migrated node version code from es6 to es5. * fix(12976): remove one level from ts node register cache directory link. * chore(12976): added caret to semver dependecy in order to support minor versions. * refact(12976): small change from named import to default import on node version validator. * refact(12976): removed ts_node_register and add the code to babel_register. * feat(12976): split eslint config in order to properly support files built to run before and after node version validator. refact(12976): convert script files to es5 code. refact(12976): delete inline eslint configs from node version check related files. * refact(12976): remove ts node register file. * refact(12976): completely port setup_node_env to es5. * refact(12976): remove babel_register invokation from external dependencies in scripts. * refact(12976): move node_version code directly into node_version_validator inside setup_node_env folder. * refact(12976): only node version validator for kbn script.
2018-05-25 19:43:01 +02:00
rules: {
'import/no-commonjs': 'off',
'prefer-object-spread/prefer-object-spread': 'off',
'no-var': 'off',
'prefer-const': 'off',
'prefer-destructuring': 'off',
'no-restricted-syntax': [
'error',
'ImportDeclaration',
'ExportNamedDeclaration',
'ExportDefaultDeclaration',
'ExportAllDeclaration',
'ArrowFunctionExpression',
'AwaitExpression',
'ClassDeclaration',
'RestElement',
'SpreadElement',
'YieldExpression',
'VariableDeclaration[kind="const"]',
'VariableDeclaration[kind="let"]',
'VariableDeclarator[id.type="ArrayPattern"]',
'VariableDeclarator[id.type="ObjectPattern"]',
],
},
},
/**
* Files that run in the browser with only node-level transpilation
*/
{
files: [
'test/functional/services/lib/web_element_wrapper/scroll_into_view_if_necessary.js',
Migrate from tslint (#33826) * chore(NA): remove tslint dependencies, configs and enable eslint typescript parser. * fix(NA): apply recommend eslint typescript rule.s * chore(NA): upgrade eslint package versions. * chore(NA): split javascript eslint config in an override section. * chore(NA): split all eslint configs with overrides. * chore(NA): remove missing console.log. * chore(NA): change eslint splits and overrides order. * chore(NA): replace tslint disable comments with eslint ones. * chore(NA): solve eslint typescript errors for elastic/kibana-custom/no-default-export * chore(NA): fixed multiple eslint typescript rule failures. * chore(NA): add tarfet folder to the eslint ignore. * chore(NA): apply prettier rule to ts type file. * chore(NA): remove last mentions to tslint * chore(NA): add old defined rules * chore(NA): missing port rules website * chore(na): ordered rules * chore(NA): solved eslint typescript problems. * chore(NA): fix spaced comment problems. * chore(NA): fix some more eslint typescript rules: import/order no-empty-interface * chore(NA): fix last rules and comment out what are the ones still failing. * chore(NA): comment out camelcase rule. * chore(NA): regenerate kbn pm dist. * chore(NA): updated snapshots. * chore(NA): updated snapshots. * chore(NA): disabled sort-keys rule. * chore(NA): remove rule prefer-arrow/prefer-arrow-functions. * chore(NA): fix for @typescript-eslint/no-var-requires rule. * chore(NA): fixes for @typescript-eslint/camelcase rule. * chore(NA): fix typo on eslint config kibana typescript. Co-Authored-By: mistic <tiagoffcc@hotmail.com> * chore(NA): remove legacy note after the intellij upgrade to 2019.1 * fix(NA): import order plugin. * chore(NA): fix ts ignore positions after auto fix. * fix(NA): performance issue with typescript eslint. * refact(NA): eslint configs organization. * chore(NA): apply resticted paths to ts files too. * chore(NA): split comment from eslint ignore.
2019-04-05 18:45:23 +02:00
'**/browser_exec_scripts/**/*.js',
],
rules: {
'prefer-object-spread/prefer-object-spread': 'off',
'no-var': 'off',
'prefer-const': 'off',
'prefer-destructuring': 'off',
'no-restricted-syntax': [
'error',
'ArrowFunctionExpression',
'AwaitExpression',
'ClassDeclaration',
'ImportDeclaration',
'RestElement',
'SpreadElement',
'YieldExpression',
'VariableDeclaration[kind="const"]',
'VariableDeclaration[kind="let"]',
'VariableDeclarator[id.type="ArrayPattern"]',
'VariableDeclarator[id.type="ObjectPattern"]',
],
},
},
Validate current node version (#19154) * feat(12976): node version validation at runtime. * refact(12976): move the code into a static utilities class. * test(12976): added first test case using jest. * test(12976): added test cases for node_version. * feat(12976): create setup env node to bootstrap babel, ts-node and node version validator. * refact(12976): migrated node version code from es6 to es5. * feat(12976): node version validation at runtime. * refact(12976): move the code into a static utilities class. * test(12976): added first test case using jest. * test(12976): added test cases for node_version. * feat(12976): create setup env node to bootstrap babel, ts-node and node version validator. * refact(12976): migrated node version code from es6 to es5. * fix(12976): remove one level from ts node register cache directory link. * chore(12976): added caret to semver dependecy in order to support minor versions. * refact(12976): small change from named import to default import on node version validator. * refact(12976): removed ts_node_register and add the code to babel_register. * feat(12976): split eslint config in order to properly support files built to run before and after node version validator. refact(12976): convert script files to es5 code. refact(12976): delete inline eslint configs from node version check related files. * refact(12976): remove ts node register file. * refact(12976): completely port setup_node_env to es5. * refact(12976): remove babel_register invokation from external dependencies in scripts. * refact(12976): move node_version code directly into node_version_validator inside setup_node_env folder. * refact(12976): only node version validator for kbn script.
2018-05-25 19:43:01 +02:00
/**
* Files that run AFTER node version check
* and are not also transpiled with babel
2018-04-20 21:13:37 +02:00
*/
{
files: [
'.eslintrc.js',
Migrate from tslint (#33826) * chore(NA): remove tslint dependencies, configs and enable eslint typescript parser. * fix(NA): apply recommend eslint typescript rule.s * chore(NA): upgrade eslint package versions. * chore(NA): split javascript eslint config in an override section. * chore(NA): split all eslint configs with overrides. * chore(NA): remove missing console.log. * chore(NA): change eslint splits and overrides order. * chore(NA): replace tslint disable comments with eslint ones. * chore(NA): solve eslint typescript errors for elastic/kibana-custom/no-default-export * chore(NA): fixed multiple eslint typescript rule failures. * chore(NA): add tarfet folder to the eslint ignore. * chore(NA): apply prettier rule to ts type file. * chore(NA): remove last mentions to tslint * chore(NA): add old defined rules * chore(NA): missing port rules website * chore(na): ordered rules * chore(NA): solved eslint typescript problems. * chore(NA): fix spaced comment problems. * chore(NA): fix some more eslint typescript rules: import/order no-empty-interface * chore(NA): fix last rules and comment out what are the ones still failing. * chore(NA): comment out camelcase rule. * chore(NA): regenerate kbn pm dist. * chore(NA): updated snapshots. * chore(NA): updated snapshots. * chore(NA): disabled sort-keys rule. * chore(NA): remove rule prefer-arrow/prefer-arrow-functions. * chore(NA): fix for @typescript-eslint/no-var-requires rule. * chore(NA): fixes for @typescript-eslint/camelcase rule. * chore(NA): fix typo on eslint config kibana typescript. Co-Authored-By: mistic <tiagoffcc@hotmail.com> * chore(NA): remove legacy note after the intellij upgrade to 2019.1 * fix(NA): import order plugin. * chore(NA): fix ts ignore positions after auto fix. * fix(NA): performance issue with typescript eslint. * refact(NA): eslint configs organization. * chore(NA): apply resticted paths to ts files too. * chore(NA): split comment from eslint ignore.
2019-04-05 18:45:23 +02:00
'**/webpackShims/**/*.js',
'packages/kbn-plugin-generator/**/*.js',
'packages/kbn-plugin-helpers/**/*.js',
'packages/kbn-eslint-import-resolver-kibana/**/*.js',
'packages/kbn-eslint-plugin-eslint/**/*',
2018-04-20 21:13:37 +02:00
'x-pack/gulpfile.js',
'x-pack/dev-tools/mocha/setup_mocha.js',
Migrate from tslint (#33826) * chore(NA): remove tslint dependencies, configs and enable eslint typescript parser. * fix(NA): apply recommend eslint typescript rule.s * chore(NA): upgrade eslint package versions. * chore(NA): split javascript eslint config in an override section. * chore(NA): split all eslint configs with overrides. * chore(NA): remove missing console.log. * chore(NA): change eslint splits and overrides order. * chore(NA): replace tslint disable comments with eslint ones. * chore(NA): solve eslint typescript errors for elastic/kibana-custom/no-default-export * chore(NA): fixed multiple eslint typescript rule failures. * chore(NA): add tarfet folder to the eslint ignore. * chore(NA): apply prettier rule to ts type file. * chore(NA): remove last mentions to tslint * chore(NA): add old defined rules * chore(NA): missing port rules website * chore(na): ordered rules * chore(NA): solved eslint typescript problems. * chore(NA): fix spaced comment problems. * chore(NA): fix some more eslint typescript rules: import/order no-empty-interface * chore(NA): fix last rules and comment out what are the ones still failing. * chore(NA): comment out camelcase rule. * chore(NA): regenerate kbn pm dist. * chore(NA): updated snapshots. * chore(NA): updated snapshots. * chore(NA): disabled sort-keys rule. * chore(NA): remove rule prefer-arrow/prefer-arrow-functions. * chore(NA): fix for @typescript-eslint/no-var-requires rule. * chore(NA): fixes for @typescript-eslint/camelcase rule. * chore(NA): fix typo on eslint config kibana typescript. Co-Authored-By: mistic <tiagoffcc@hotmail.com> * chore(NA): remove legacy note after the intellij upgrade to 2019.1 * fix(NA): import order plugin. * chore(NA): fix ts ignore positions after auto fix. * fix(NA): performance issue with typescript eslint. * refact(NA): eslint configs organization. * chore(NA): apply resticted paths to ts files too. * chore(NA): split comment from eslint ignore.
2019-04-05 18:45:23 +02:00
'x-pack/scripts/*.js',
2018-04-20 21:13:37 +02:00
],
excludedFiles: ['**/integration_tests/**/*'],
2018-04-20 21:13:37 +02:00
rules: {
'import/no-commonjs': 'off',
'prefer-object-spread/prefer-object-spread': 'off',
'no-restricted-syntax': [
'error',
'ImportDeclaration',
'ExportNamedDeclaration',
'ExportDefaultDeclaration',
'ExportAllDeclaration',
],
},
},
/**
* Jest specific rules
*/
{
files: ['**/*.test.{js,ts,tsx}'],
rules: {
'jest/valid-describe': 'error',
},
},
/**
* Harden specific rules
*/
{
files: ['test/harden/*.js'],
rules: allMochaRulesOff,
},
2018-04-20 21:13:37 +02:00
/**
* APM overrides
*/
{
files: ['x-pack/plugins/apm/**/*.js'],
2018-04-20 21:13:37 +02:00
rules: {
'no-unused-vars': ['error', { ignoreRestSiblings: true }],
'no-console': ['warn', { allow: ['error'] }],
},
},
{
plugins: ['react-hooks'],
files: ['x-pack/plugins/apm/**/*.{ts,tsx}'],
rules: {
'react-hooks/rules-of-hooks': 'error', // Checks rules of Hooks
'react-hooks/exhaustive-deps': ['error', { additionalHooks: '^useFetcher$' }],
},
},
2018-04-20 21:13:37 +02:00
/**
* GIS overrides
*/
{
files: ['x-pack/legacy/plugins/maps/**/*.js'],
rules: {
'react/prefer-stateless-function': [0, { ignorePureComponents: false }],
},
},
2018-04-20 21:13:37 +02:00
/**
* ML overrides
*/
{
files: ['x-pack/plugins/ml/**/*.js'],
2018-04-20 21:13:37 +02:00
rules: {
'no-shadow': 'error',
'import/no-extraneous-dependencies': [
'error',
{
packageDir: './x-pack',
},
],
2018-04-20 21:13:37 +02:00
},
},
/**
* SIEM overrides
*/
{
[SIEM] Low impact linter rules to start with (#37137) ## Summary Low impact linter rules to help catch bugs for back-porting as well as moving into the future. We will slowly turn the warns into errors and fix the errors as we go along. This helps us avoid a "big bang" switch over approach to avoid back-port issues as we are porting bugs aggressively at the beginning. Added a custom pattern detection rule for determining if the UI is trying to import anything from the server backend since that would cause web-pack front to pull in backend code. Also forbid the use of NodeJS imports on the front end. Double checked that I was not duplicating rules from: * https://github.com/elastic/kibana/blob/master/packages/eslint-config-kibana/typescript.js * https://github.com/elastic/kibana/blob/master/packages/eslint-config-kibana/javascript.js ### Checklist Use ~~strikethroughs~~ to remove checklist items you don't feel are applicable to this PR. ~- [ ] This was checked for cross-browser compatibility, [including a check against IE11](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#cross-browser-compatibility)~ ~- [ ] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/master/packages/kbn-i18n/README.md)~ ~- [ ] [Documentation](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#writing-documentation) was added for features that require explanation or tutorials~ ~- [ ] [Unit or functional tests](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#cross-browser-compatibility) were updated or added to match the most common scenarios~ ~- [ ] This was checked for [keyboard-only and screenreader accessibility](https://developer.mozilla.org/en-US/docs/Learn/Tools_and_testing/Cross_browser_testing/Accessibility#Accessibility_testing_checklist)~ ### For maintainers ~- [ ] This was checked for breaking API changes and was [labeled appropriately](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#release-notes-process)~ ~- [ ] This includes a feature addition or change that requires a release note and was [labeled appropriately](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#release-notes-process)~
2019-05-28 19:14:17 +02:00
// front end typescript and javascript files only
[SIEM] Client NP Cutover (#64251) * Move SIEM public/ folder to NP plugin This is solely renames; fixes come next. * Update relative imports in our API tests * Fix linter errors following move to NP folder These paths got a little shorter, so some lines could be collapsed. * Move client dependencies to NP package.json I'm removing the @types/js-yaml for now because I'm not sure we need it; I'll add it back later if we do. * Fix relative imports to other plugins * Fix errant uses of ui/chrome * Remove legacy plugin shim * Move feature registration into plugin This previously had to be part of legacy bootstrapping due to an order of operations issue. * Disconnect legacy plugin The index file should now be redundant with what's in the plugin: * app registration * feature registration * Move public gitattributes * Remove references to legacy embeddables We can now use the NP API. Maps embeddable will not work here until their work is merged, but this should prevent us from importing legacy code and thus breaking the build. * Add our frontend dependencies to kibana.json These are all required for now, because that's how they're typed. If they _should_ be optional (and I think several should), we need to update the type and handle the null case within the app. * Replace use of ui/new_platform mocks in embeddable utils * Fix remaining jest tests * Replace build-breaking ui/new_platform mocks with equivalents in core proper * Remove unnecessary mocks of ui/new_platform * Remove references to legacy SIEM folder * I left the reference in CODEOWNERS in case someone tries to sneak something back * I left the .gitignore reference for the same reason * Fix mocks of relative paths These were not caught by typescript and were causing test failures. * Export our client plugin contracts They're empty for now. * Move from deprecated appmount API The new one dropped a param we weren't using. * Add missing mock causing test failures * Don't re-export core types from our plugin Import them from core where we need them, instead * Move Actions UI registry outside of mount This is already imported, there's no benefit (and potential timing issues) with doing this inside the mount. * Add security's setup contract to our StartServices This doesn't change what's used, only how we're typing it. The types are now a little more truthful as: * our StartPlugins don't include setup contracts * our StartServices includes everything we use at Start time, including the one setup plugin. * Add order and icon back to the sidebar link * Replace plugin class properties with constants These are shared, and should be consistent. * Enable our UI on NP * Add missed plugin dependencies We're not using their contracts, but we are importing code from them. * Revert use of constant in translation Can't do that, whoops * i18n our feature catalogue entry * Remove unnecessary array from single element * Remove unused keys These were the legacy translations used... well, I don't know where they were used. * Ignore circular dependencies in external plugins * Normalize exclusions * Add undeclared dependencies to kibana.json We import our maps embeddable from maps, and we pass inspector to the embeddable. I just missed these in my audit. This was causing errors in the map embeddable. * Await our call to setLayerList This is an async call that we need to complete before we can render. * Reduce siem plugin size When we load our initial plugin (before our app is loaded), were were implicitly importing all of kibana_react with this import. While a global module prevents this from affecting our bundle size currently, that could change in the future. Since we only need a reference to our class, we just import that instead.
2020-04-28 00:59:21 +02:00
files: ['x-pack/plugins/siem/public/**/*.{js,ts,tsx}'],
rules: {
[SIEM] Low impact linter rules to start with (#37137) ## Summary Low impact linter rules to help catch bugs for back-porting as well as moving into the future. We will slowly turn the warns into errors and fix the errors as we go along. This helps us avoid a "big bang" switch over approach to avoid back-port issues as we are porting bugs aggressively at the beginning. Added a custom pattern detection rule for determining if the UI is trying to import anything from the server backend since that would cause web-pack front to pull in backend code. Also forbid the use of NodeJS imports on the front end. Double checked that I was not duplicating rules from: * https://github.com/elastic/kibana/blob/master/packages/eslint-config-kibana/typescript.js * https://github.com/elastic/kibana/blob/master/packages/eslint-config-kibana/javascript.js ### Checklist Use ~~strikethroughs~~ to remove checklist items you don't feel are applicable to this PR. ~- [ ] This was checked for cross-browser compatibility, [including a check against IE11](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#cross-browser-compatibility)~ ~- [ ] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/master/packages/kbn-i18n/README.md)~ ~- [ ] [Documentation](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#writing-documentation) was added for features that require explanation or tutorials~ ~- [ ] [Unit or functional tests](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#cross-browser-compatibility) were updated or added to match the most common scenarios~ ~- [ ] This was checked for [keyboard-only and screenreader accessibility](https://developer.mozilla.org/en-US/docs/Learn/Tools_and_testing/Cross_browser_testing/Accessibility#Accessibility_testing_checklist)~ ### For maintainers ~- [ ] This was checked for breaking API changes and was [labeled appropriately](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#release-notes-process)~ ~- [ ] This includes a feature addition or change that requires a release note and was [labeled appropriately](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#release-notes-process)~
2019-05-28 19:14:17 +02:00
'import/no-nodejs-modules': 'error',
'no-restricted-imports': [
'error',
{
// prevents UI code from importing server side code and then webpack including it when doing builds
patterns: ['**/server/*'],
},
],
},
},
{
// typescript only for front and back end
[SIEM] Server cutover to New Platform (#63430) * Move server code into NP folder * NP config is not yet used * Relative imports are somewhat broken * Move common folder into NP * Move cypress folder into NP * Move scripts folder into NP * Move misc. config into NP folder A few of these were moved into the cypress folder as they're cypress-specific. I tried to update all the relative paths but some are likely broken. I'm not going to know until other stuff is fixed, though. * Move value for siem index pattern into common/constants The other default values live in there, this is no different. * Update paths following file move If this was referencing the full project, it now references both paths (legacy for UI, and NP for server). * Fix typescript errors related to module resolution These are mostly updating imports to the common/ folder on the UI side (since things changed relative to those files). * Replace Legacy Config with NP Config * Updates plugin to use NP config * defines new config previously coming from savedObjects config * cleans up legacy types Conflicts: x-pack/plugins/siem/server/lib/detection_engine/routes/rules/export_rules_route.ts x-pack/plugins/siem/server/lib/detection_engine/routes/rules/import_rules_route.ts x-pack/plugins/siem/server/lib/detection_engine/rules/types.ts x-pack/plugins/siem/server/plugin.ts x-pack/plugins/siem/server/routes/index.ts x-pack/plugins/siem/server/types.ts * Remove local SIEM tsconfig This was originally added to address an issue with tsserver, but that issue is no longer relevant. The presence of this file confuses typescript into thinking that siem is a separate TS project. * Update kibana.json to declare our dependencies These are not necessarily correct in terms of what's required/optional, but this is what's declared in our types. * Remove legacy plugin instantiation * Removes legacy instantiation of server plugin, which is now handled by NP * Loosens legacy config spec so we no longer have to duplicate config types * Update tests with NP config These were written against the old Hapi config function; now, we just have a POJO. * Update es_archiver helpers' paths I'm not quite sure if these are working yet, but they're no longer throwing errors. * Ignore restricted path on script This was cribbed from infra, who has made a similar change. * Ignore restricted path on temporary savedObject mappings import This will be changed subsequently when we switch to the NP form of savedObject type registration. * Add symlink to lockfile * Fix paths on circular deps script * Add separate config for Rule and Timeline saved objects We had previously used the savedObjects' config, but those are not currently exposed to us on New Platform. For now, we're going to split this into two sets of values for the SOs we deal with importing/exporting within the SIEM app, with the same defaults as savedObjects. * Fixing relative paths within cypress These are strings that wouldn't be caught by typescript.
2020-04-17 19:31:54 +02:00
files: ['x-pack/{,legacy/}plugins/siem/**/*.{ts,tsx}'],
[SIEM] Low impact linter rules to start with (#37137) ## Summary Low impact linter rules to help catch bugs for back-porting as well as moving into the future. We will slowly turn the warns into errors and fix the errors as we go along. This helps us avoid a "big bang" switch over approach to avoid back-port issues as we are porting bugs aggressively at the beginning. Added a custom pattern detection rule for determining if the UI is trying to import anything from the server backend since that would cause web-pack front to pull in backend code. Also forbid the use of NodeJS imports on the front end. Double checked that I was not duplicating rules from: * https://github.com/elastic/kibana/blob/master/packages/eslint-config-kibana/typescript.js * https://github.com/elastic/kibana/blob/master/packages/eslint-config-kibana/javascript.js ### Checklist Use ~~strikethroughs~~ to remove checklist items you don't feel are applicable to this PR. ~- [ ] This was checked for cross-browser compatibility, [including a check against IE11](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#cross-browser-compatibility)~ ~- [ ] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/master/packages/kbn-i18n/README.md)~ ~- [ ] [Documentation](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#writing-documentation) was added for features that require explanation or tutorials~ ~- [ ] [Unit or functional tests](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#cross-browser-compatibility) were updated or added to match the most common scenarios~ ~- [ ] This was checked for [keyboard-only and screenreader accessibility](https://developer.mozilla.org/en-US/docs/Learn/Tools_and_testing/Cross_browser_testing/Accessibility#Accessibility_testing_checklist)~ ### For maintainers ~- [ ] This was checked for breaking API changes and was [labeled appropriately](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#release-notes-process)~ ~- [ ] This includes a feature addition or change that requires a release note and was [labeled appropriately](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#release-notes-process)~
2019-05-28 19:14:17 +02:00
rules: {
// This will be turned on after bug fixes are complete
// '@typescript-eslint/explicit-member-accessibility': 'warn',
'@typescript-eslint/no-this-alias': 'error',
'@typescript-eslint/no-explicit-any': 'error',
[SIEM] Low impact linter rules to start with (#37137) ## Summary Low impact linter rules to help catch bugs for back-porting as well as moving into the future. We will slowly turn the warns into errors and fix the errors as we go along. This helps us avoid a "big bang" switch over approach to avoid back-port issues as we are porting bugs aggressively at the beginning. Added a custom pattern detection rule for determining if the UI is trying to import anything from the server backend since that would cause web-pack front to pull in backend code. Also forbid the use of NodeJS imports on the front end. Double checked that I was not duplicating rules from: * https://github.com/elastic/kibana/blob/master/packages/eslint-config-kibana/typescript.js * https://github.com/elastic/kibana/blob/master/packages/eslint-config-kibana/javascript.js ### Checklist Use ~~strikethroughs~~ to remove checklist items you don't feel are applicable to this PR. ~- [ ] This was checked for cross-browser compatibility, [including a check against IE11](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#cross-browser-compatibility)~ ~- [ ] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/master/packages/kbn-i18n/README.md)~ ~- [ ] [Documentation](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#writing-documentation) was added for features that require explanation or tutorials~ ~- [ ] [Unit or functional tests](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#cross-browser-compatibility) were updated or added to match the most common scenarios~ ~- [ ] This was checked for [keyboard-only and screenreader accessibility](https://developer.mozilla.org/en-US/docs/Learn/Tools_and_testing/Cross_browser_testing/Accessibility#Accessibility_testing_checklist)~ ### For maintainers ~- [ ] This was checked for breaking API changes and was [labeled appropriately](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#release-notes-process)~ ~- [ ] This includes a feature addition or change that requires a release note and was [labeled appropriately](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#release-notes-process)~
2019-05-28 19:14:17 +02:00
'@typescript-eslint/no-useless-constructor': 'error',
// This will be turned on after bug fixes are complete
// '@typescript-eslint/no-object-literal-type-assertion': 'warn',
'@typescript-eslint/unified-signatures': 'error',
// eventually we want this to be a warn and then an error since this is a recommended linter rule
// for now, keeping it commented out to avoid too much IDE noise until the other linter issues
// are fixed in the next release or two
// '@typescript-eslint/explicit-function-return-type': 'warn',
// these rules cannot be turned on and tested at the moment until this issue is resolved:
// https://github.com/prettier/prettier-eslint/issues/201
// '@typescript-eslint/await-thenable': 'error',
// '@typescript-eslint/no-non-null-assertion': 'error'
// '@typescript-eslint/no-unnecessary-type-assertion': 'error',
// '@typescript-eslint/no-unused-vars': 'error',
// '@typescript-eslint/prefer-includes': 'error',
// '@typescript-eslint/prefer-string-starts-ends-with': 'error',
// '@typescript-eslint/promise-function-async': 'error',
// '@typescript-eslint/prefer-regexp-exec': 'error',
// '@typescript-eslint/promise-function-async': 'error',
// '@typescript-eslint/require-array-sort-compare': 'error',
// '@typescript-eslint/restrict-plus-operands': 'error',
// '@typescript-eslint/unbound-method': 'error',
},
},
// {
// // will introduced after the other warns are fixed
// // typescript and javascript for front end react performance
[SIEM] Client NP Cutover (#64251) * Move SIEM public/ folder to NP plugin This is solely renames; fixes come next. * Update relative imports in our API tests * Fix linter errors following move to NP folder These paths got a little shorter, so some lines could be collapsed. * Move client dependencies to NP package.json I'm removing the @types/js-yaml for now because I'm not sure we need it; I'll add it back later if we do. * Fix relative imports to other plugins * Fix errant uses of ui/chrome * Remove legacy plugin shim * Move feature registration into plugin This previously had to be part of legacy bootstrapping due to an order of operations issue. * Disconnect legacy plugin The index file should now be redundant with what's in the plugin: * app registration * feature registration * Move public gitattributes * Remove references to legacy embeddables We can now use the NP API. Maps embeddable will not work here until their work is merged, but this should prevent us from importing legacy code and thus breaking the build. * Add our frontend dependencies to kibana.json These are all required for now, because that's how they're typed. If they _should_ be optional (and I think several should), we need to update the type and handle the null case within the app. * Replace use of ui/new_platform mocks in embeddable utils * Fix remaining jest tests * Replace build-breaking ui/new_platform mocks with equivalents in core proper * Remove unnecessary mocks of ui/new_platform * Remove references to legacy SIEM folder * I left the reference in CODEOWNERS in case someone tries to sneak something back * I left the .gitignore reference for the same reason * Fix mocks of relative paths These were not caught by typescript and were causing test failures. * Export our client plugin contracts They're empty for now. * Move from deprecated appmount API The new one dropped a param we weren't using. * Add missing mock causing test failures * Don't re-export core types from our plugin Import them from core where we need them, instead * Move Actions UI registry outside of mount This is already imported, there's no benefit (and potential timing issues) with doing this inside the mount. * Add security's setup contract to our StartServices This doesn't change what's used, only how we're typing it. The types are now a little more truthful as: * our StartPlugins don't include setup contracts * our StartServices includes everything we use at Start time, including the one setup plugin. * Add order and icon back to the sidebar link * Replace plugin class properties with constants These are shared, and should be consistent. * Enable our UI on NP * Add missed plugin dependencies We're not using their contracts, but we are importing code from them. * Revert use of constant in translation Can't do that, whoops * i18n our feature catalogue entry * Remove unnecessary array from single element * Remove unused keys These were the legacy translations used... well, I don't know where they were used. * Ignore circular dependencies in external plugins * Normalize exclusions * Add undeclared dependencies to kibana.json We import our maps embeddable from maps, and we pass inspector to the embeddable. I just missed these in my audit. This was causing errors in the map embeddable. * Await our call to setLayerList This is an async call that we need to complete before we can render. * Reduce siem plugin size When we load our initial plugin (before our app is loaded), were were implicitly importing all of kibana_react with this import. While a global module prevents this from affecting our bundle size currently, that could change in the future. Since we only need a reference to our class, we just import that instead.
2020-04-28 00:59:21 +02:00
// files: ['x-pack/plugins/siem/public/**/!(*.test).{js,ts,tsx}'],
// plugins: ['react-perf'],
// rules: {
// // 'react-perf/jsx-no-new-object-as-prop': 'error',
// // 'react-perf/jsx-no-new-array-as-prop': 'error',
// // 'react-perf/jsx-no-new-function-as-prop': 'error',
// // 'react/jsx-no-bind': 'error',
// },
// },
[SIEM] Low impact linter rules to start with (#37137) ## Summary Low impact linter rules to help catch bugs for back-porting as well as moving into the future. We will slowly turn the warns into errors and fix the errors as we go along. This helps us avoid a "big bang" switch over approach to avoid back-port issues as we are porting bugs aggressively at the beginning. Added a custom pattern detection rule for determining if the UI is trying to import anything from the server backend since that would cause web-pack front to pull in backend code. Also forbid the use of NodeJS imports on the front end. Double checked that I was not duplicating rules from: * https://github.com/elastic/kibana/blob/master/packages/eslint-config-kibana/typescript.js * https://github.com/elastic/kibana/blob/master/packages/eslint-config-kibana/javascript.js ### Checklist Use ~~strikethroughs~~ to remove checklist items you don't feel are applicable to this PR. ~- [ ] This was checked for cross-browser compatibility, [including a check against IE11](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#cross-browser-compatibility)~ ~- [ ] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/master/packages/kbn-i18n/README.md)~ ~- [ ] [Documentation](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#writing-documentation) was added for features that require explanation or tutorials~ ~- [ ] [Unit or functional tests](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#cross-browser-compatibility) were updated or added to match the most common scenarios~ ~- [ ] This was checked for [keyboard-only and screenreader accessibility](https://developer.mozilla.org/en-US/docs/Learn/Tools_and_testing/Cross_browser_testing/Accessibility#Accessibility_testing_checklist)~ ### For maintainers ~- [ ] This was checked for breaking API changes and was [labeled appropriately](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#release-notes-process)~ ~- [ ] This includes a feature addition or change that requires a release note and was [labeled appropriately](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#release-notes-process)~
2019-05-28 19:14:17 +02:00
{
// typescript and javascript for front and back end
[SIEM] Server cutover to New Platform (#63430) * Move server code into NP folder * NP config is not yet used * Relative imports are somewhat broken * Move common folder into NP * Move cypress folder into NP * Move scripts folder into NP * Move misc. config into NP folder A few of these were moved into the cypress folder as they're cypress-specific. I tried to update all the relative paths but some are likely broken. I'm not going to know until other stuff is fixed, though. * Move value for siem index pattern into common/constants The other default values live in there, this is no different. * Update paths following file move If this was referencing the full project, it now references both paths (legacy for UI, and NP for server). * Fix typescript errors related to module resolution These are mostly updating imports to the common/ folder on the UI side (since things changed relative to those files). * Replace Legacy Config with NP Config * Updates plugin to use NP config * defines new config previously coming from savedObjects config * cleans up legacy types Conflicts: x-pack/plugins/siem/server/lib/detection_engine/routes/rules/export_rules_route.ts x-pack/plugins/siem/server/lib/detection_engine/routes/rules/import_rules_route.ts x-pack/plugins/siem/server/lib/detection_engine/rules/types.ts x-pack/plugins/siem/server/plugin.ts x-pack/plugins/siem/server/routes/index.ts x-pack/plugins/siem/server/types.ts * Remove local SIEM tsconfig This was originally added to address an issue with tsserver, but that issue is no longer relevant. The presence of this file confuses typescript into thinking that siem is a separate TS project. * Update kibana.json to declare our dependencies These are not necessarily correct in terms of what's required/optional, but this is what's declared in our types. * Remove legacy plugin instantiation * Removes legacy instantiation of server plugin, which is now handled by NP * Loosens legacy config spec so we no longer have to duplicate config types * Update tests with NP config These were written against the old Hapi config function; now, we just have a POJO. * Update es_archiver helpers' paths I'm not quite sure if these are working yet, but they're no longer throwing errors. * Ignore restricted path on script This was cribbed from infra, who has made a similar change. * Ignore restricted path on temporary savedObject mappings import This will be changed subsequently when we switch to the NP form of savedObject type registration. * Add symlink to lockfile * Fix paths on circular deps script * Add separate config for Rule and Timeline saved objects We had previously used the savedObjects' config, but those are not currently exposed to us on New Platform. For now, we're going to split this into two sets of values for the SOs we deal with importing/exporting within the SIEM app, with the same defaults as savedObjects. * Fixing relative paths within cypress These are strings that wouldn't be caught by typescript.
2020-04-17 19:31:54 +02:00
files: ['x-pack/{,legacy/}plugins/siem/**/*.{js,ts,tsx}'],
[SIEM] Change deprecated Buffer method for non-deprecated Buffer method (#38634) ## Summary * Added linter rule to prevent us from accidentally adding deprecated node methods * Added the new package linter plugin for NodeJS * Added unit test for the base 64 encoding for sanity check Note: Only the one line of code will be back-ported for the NodeJS fix for 7.2.0. The linter rule will not be back-ported. ### Checklist Use ~~strikethroughs~~ to remove checklist items you don't feel are applicable to this PR. ~~- [ ] This was checked for cross-browser compatibility, [including a check against IE11](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#cross-browser-compatibility)~~ ~~- [ ] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/master/packages/kbn-i18n/README.md)~~ ~~- [ ] [Documentation](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#writing-documentation) was added for features that require explanation or tutorials~~ - [x] [Unit or functional tests](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#cross-browser-compatibility) were updated or added to match the most common scenarios ~~- [ ] This was checked for [keyboard-only and screenreader accessibility](https://developer.mozilla.org/en-US/docs/Learn/Tools_and_testing/Cross_browser_testing/Accessibility#Accessibility_testing_checklist)~~ ### For maintainers ~~- [ ] This was checked for breaking API changes and was [labeled appropriately](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#release-notes-process)~~ ~~- [ ] This includes a feature addition or change that requires a release note and was [labeled appropriately](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#release-notes-process)~~
2019-06-11 06:15:11 +02:00
plugins: ['eslint-plugin-node', 'react'],
env: {
mocha: true,
jest: true,
},
[SIEM] Low impact linter rules to start with (#37137) ## Summary Low impact linter rules to help catch bugs for back-porting as well as moving into the future. We will slowly turn the warns into errors and fix the errors as we go along. This helps us avoid a "big bang" switch over approach to avoid back-port issues as we are porting bugs aggressively at the beginning. Added a custom pattern detection rule for determining if the UI is trying to import anything from the server backend since that would cause web-pack front to pull in backend code. Also forbid the use of NodeJS imports on the front end. Double checked that I was not duplicating rules from: * https://github.com/elastic/kibana/blob/master/packages/eslint-config-kibana/typescript.js * https://github.com/elastic/kibana/blob/master/packages/eslint-config-kibana/javascript.js ### Checklist Use ~~strikethroughs~~ to remove checklist items you don't feel are applicable to this PR. ~- [ ] This was checked for cross-browser compatibility, [including a check against IE11](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#cross-browser-compatibility)~ ~- [ ] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/master/packages/kbn-i18n/README.md)~ ~- [ ] [Documentation](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#writing-documentation) was added for features that require explanation or tutorials~ ~- [ ] [Unit or functional tests](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#cross-browser-compatibility) were updated or added to match the most common scenarios~ ~- [ ] This was checked for [keyboard-only and screenreader accessibility](https://developer.mozilla.org/en-US/docs/Learn/Tools_and_testing/Cross_browser_testing/Accessibility#Accessibility_testing_checklist)~ ### For maintainers ~- [ ] This was checked for breaking API changes and was [labeled appropriately](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#release-notes-process)~ ~- [ ] This includes a feature addition or change that requires a release note and was [labeled appropriately](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#release-notes-process)~
2019-05-28 19:14:17 +02:00
rules: {
'accessor-pairs': 'error',
'array-callback-return': 'error',
'no-array-constructor': 'error',
complexity: 'warn',
// This will be turned on after bug fixes are mostly completed
// 'consistent-return': 'warn',
// This will be turned on after bug fixes are mostly completed
// 'func-style': ['warn', 'expression'],
// These will be turned on after bug fixes are mostly completed and we can
// run a fix-lint
/*
'import/order': [
'warn',
{
groups: ['builtin', 'external', 'internal', 'parent', 'sibling', 'index'],
'newlines-between': 'always',
},
],
*/
[SIEM] Change deprecated Buffer method for non-deprecated Buffer method (#38634) ## Summary * Added linter rule to prevent us from accidentally adding deprecated node methods * Added the new package linter plugin for NodeJS * Added unit test for the base 64 encoding for sanity check Note: Only the one line of code will be back-ported for the NodeJS fix for 7.2.0. The linter rule will not be back-ported. ### Checklist Use ~~strikethroughs~~ to remove checklist items you don't feel are applicable to this PR. ~~- [ ] This was checked for cross-browser compatibility, [including a check against IE11](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#cross-browser-compatibility)~~ ~~- [ ] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/master/packages/kbn-i18n/README.md)~~ ~~- [ ] [Documentation](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#writing-documentation) was added for features that require explanation or tutorials~~ - [x] [Unit or functional tests](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#cross-browser-compatibility) were updated or added to match the most common scenarios ~~- [ ] This was checked for [keyboard-only and screenreader accessibility](https://developer.mozilla.org/en-US/docs/Learn/Tools_and_testing/Cross_browser_testing/Accessibility#Accessibility_testing_checklist)~~ ### For maintainers ~~- [ ] This was checked for breaking API changes and was [labeled appropriately](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#release-notes-process)~~ ~~- [ ] This includes a feature addition or change that requires a release note and was [labeled appropriately](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#release-notes-process)~~
2019-06-11 06:15:11 +02:00
'node/no-deprecated-api': 'error',
[SIEM] Low impact linter rules to start with (#37137) ## Summary Low impact linter rules to help catch bugs for back-porting as well as moving into the future. We will slowly turn the warns into errors and fix the errors as we go along. This helps us avoid a "big bang" switch over approach to avoid back-port issues as we are porting bugs aggressively at the beginning. Added a custom pattern detection rule for determining if the UI is trying to import anything from the server backend since that would cause web-pack front to pull in backend code. Also forbid the use of NodeJS imports on the front end. Double checked that I was not duplicating rules from: * https://github.com/elastic/kibana/blob/master/packages/eslint-config-kibana/typescript.js * https://github.com/elastic/kibana/blob/master/packages/eslint-config-kibana/javascript.js ### Checklist Use ~~strikethroughs~~ to remove checklist items you don't feel are applicable to this PR. ~- [ ] This was checked for cross-browser compatibility, [including a check against IE11](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#cross-browser-compatibility)~ ~- [ ] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/master/packages/kbn-i18n/README.md)~ ~- [ ] [Documentation](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#writing-documentation) was added for features that require explanation or tutorials~ ~- [ ] [Unit or functional tests](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#cross-browser-compatibility) were updated or added to match the most common scenarios~ ~- [ ] This was checked for [keyboard-only and screenreader accessibility](https://developer.mozilla.org/en-US/docs/Learn/Tools_and_testing/Cross_browser_testing/Accessibility#Accessibility_testing_checklist)~ ### For maintainers ~- [ ] This was checked for breaking API changes and was [labeled appropriately](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#release-notes-process)~ ~- [ ] This includes a feature addition or change that requires a release note and was [labeled appropriately](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#release-notes-process)~
2019-05-28 19:14:17 +02:00
'no-bitwise': 'error',
'no-continue': 'error',
'no-dupe-keys': 'error',
'no-duplicate-case': 'error',
'no-duplicate-imports': 'error',
[SIEM] Low impact linter rules to start with (#37137) ## Summary Low impact linter rules to help catch bugs for back-porting as well as moving into the future. We will slowly turn the warns into errors and fix the errors as we go along. This helps us avoid a "big bang" switch over approach to avoid back-port issues as we are porting bugs aggressively at the beginning. Added a custom pattern detection rule for determining if the UI is trying to import anything from the server backend since that would cause web-pack front to pull in backend code. Also forbid the use of NodeJS imports on the front end. Double checked that I was not duplicating rules from: * https://github.com/elastic/kibana/blob/master/packages/eslint-config-kibana/typescript.js * https://github.com/elastic/kibana/blob/master/packages/eslint-config-kibana/javascript.js ### Checklist Use ~~strikethroughs~~ to remove checklist items you don't feel are applicable to this PR. ~- [ ] This was checked for cross-browser compatibility, [including a check against IE11](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#cross-browser-compatibility)~ ~- [ ] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/master/packages/kbn-i18n/README.md)~ ~- [ ] [Documentation](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#writing-documentation) was added for features that require explanation or tutorials~ ~- [ ] [Unit or functional tests](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#cross-browser-compatibility) were updated or added to match the most common scenarios~ ~- [ ] This was checked for [keyboard-only and screenreader accessibility](https://developer.mozilla.org/en-US/docs/Learn/Tools_and_testing/Cross_browser_testing/Accessibility#Accessibility_testing_checklist)~ ### For maintainers ~- [ ] This was checked for breaking API changes and was [labeled appropriately](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#release-notes-process)~ ~- [ ] This includes a feature addition or change that requires a release note and was [labeled appropriately](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#release-notes-process)~
2019-05-28 19:14:17 +02:00
'no-empty-character-class': 'error',
'no-empty-pattern': 'error',
'no-ex-assign': 'error',
'no-extend-native': 'error',
'no-extra-bind': 'error',
'no-extra-boolean-cast': 'error',
'no-extra-label': 'error',
'no-func-assign': 'error',
'no-implicit-globals': 'error',
'no-implied-eval': 'error',
'no-invalid-regexp': 'error',
'no-inner-declarations': 'error',
'no-lone-blocks': 'error',
'no-multi-assign': 'error',
'no-misleading-character-class': 'error',
'no-new-symbol': 'error',
'no-obj-calls': 'error',
'no-param-reassign': 'error',
[SIEM] Low impact linter rules to start with (#37137) ## Summary Low impact linter rules to help catch bugs for back-porting as well as moving into the future. We will slowly turn the warns into errors and fix the errors as we go along. This helps us avoid a "big bang" switch over approach to avoid back-port issues as we are porting bugs aggressively at the beginning. Added a custom pattern detection rule for determining if the UI is trying to import anything from the server backend since that would cause web-pack front to pull in backend code. Also forbid the use of NodeJS imports on the front end. Double checked that I was not duplicating rules from: * https://github.com/elastic/kibana/blob/master/packages/eslint-config-kibana/typescript.js * https://github.com/elastic/kibana/blob/master/packages/eslint-config-kibana/javascript.js ### Checklist Use ~~strikethroughs~~ to remove checklist items you don't feel are applicable to this PR. ~- [ ] This was checked for cross-browser compatibility, [including a check against IE11](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#cross-browser-compatibility)~ ~- [ ] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/master/packages/kbn-i18n/README.md)~ ~- [ ] [Documentation](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#writing-documentation) was added for features that require explanation or tutorials~ ~- [ ] [Unit or functional tests](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#cross-browser-compatibility) were updated or added to match the most common scenarios~ ~- [ ] This was checked for [keyboard-only and screenreader accessibility](https://developer.mozilla.org/en-US/docs/Learn/Tools_and_testing/Cross_browser_testing/Accessibility#Accessibility_testing_checklist)~ ### For maintainers ~- [ ] This was checked for breaking API changes and was [labeled appropriately](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#release-notes-process)~ ~- [ ] This includes a feature addition or change that requires a release note and was [labeled appropriately](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#release-notes-process)~
2019-05-28 19:14:17 +02:00
'no-process-exit': 'error',
'no-prototype-builtins': 'error',
'no-return-await': 'error',
[SIEM] Low impact linter rules to start with (#37137) ## Summary Low impact linter rules to help catch bugs for back-porting as well as moving into the future. We will slowly turn the warns into errors and fix the errors as we go along. This helps us avoid a "big bang" switch over approach to avoid back-port issues as we are porting bugs aggressively at the beginning. Added a custom pattern detection rule for determining if the UI is trying to import anything from the server backend since that would cause web-pack front to pull in backend code. Also forbid the use of NodeJS imports on the front end. Double checked that I was not duplicating rules from: * https://github.com/elastic/kibana/blob/master/packages/eslint-config-kibana/typescript.js * https://github.com/elastic/kibana/blob/master/packages/eslint-config-kibana/javascript.js ### Checklist Use ~~strikethroughs~~ to remove checklist items you don't feel are applicable to this PR. ~- [ ] This was checked for cross-browser compatibility, [including a check against IE11](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#cross-browser-compatibility)~ ~- [ ] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/master/packages/kbn-i18n/README.md)~ ~- [ ] [Documentation](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#writing-documentation) was added for features that require explanation or tutorials~ ~- [ ] [Unit or functional tests](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#cross-browser-compatibility) were updated or added to match the most common scenarios~ ~- [ ] This was checked for [keyboard-only and screenreader accessibility](https://developer.mozilla.org/en-US/docs/Learn/Tools_and_testing/Cross_browser_testing/Accessibility#Accessibility_testing_checklist)~ ### For maintainers ~- [ ] This was checked for breaking API changes and was [labeled appropriately](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#release-notes-process)~ ~- [ ] This includes a feature addition or change that requires a release note and was [labeled appropriately](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#release-notes-process)~
2019-05-28 19:14:17 +02:00
'no-self-compare': 'error',
'no-shadow-restricted-names': 'error',
'no-sparse-arrays': 'error',
'no-this-before-super': 'error',
'no-undef': 'error',
[SIEM] Low impact linter rules to start with (#37137) ## Summary Low impact linter rules to help catch bugs for back-porting as well as moving into the future. We will slowly turn the warns into errors and fix the errors as we go along. This helps us avoid a "big bang" switch over approach to avoid back-port issues as we are porting bugs aggressively at the beginning. Added a custom pattern detection rule for determining if the UI is trying to import anything from the server backend since that would cause web-pack front to pull in backend code. Also forbid the use of NodeJS imports on the front end. Double checked that I was not duplicating rules from: * https://github.com/elastic/kibana/blob/master/packages/eslint-config-kibana/typescript.js * https://github.com/elastic/kibana/blob/master/packages/eslint-config-kibana/javascript.js ### Checklist Use ~~strikethroughs~~ to remove checklist items you don't feel are applicable to this PR. ~- [ ] This was checked for cross-browser compatibility, [including a check against IE11](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#cross-browser-compatibility)~ ~- [ ] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/master/packages/kbn-i18n/README.md)~ ~- [ ] [Documentation](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#writing-documentation) was added for features that require explanation or tutorials~ ~- [ ] [Unit or functional tests](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#cross-browser-compatibility) were updated or added to match the most common scenarios~ ~- [ ] This was checked for [keyboard-only and screenreader accessibility](https://developer.mozilla.org/en-US/docs/Learn/Tools_and_testing/Cross_browser_testing/Accessibility#Accessibility_testing_checklist)~ ### For maintainers ~- [ ] This was checked for breaking API changes and was [labeled appropriately](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#release-notes-process)~ ~- [ ] This includes a feature addition or change that requires a release note and was [labeled appropriately](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#release-notes-process)~
2019-05-28 19:14:17 +02:00
'no-unreachable': 'error',
'no-unsafe-finally': 'error',
'no-useless-call': 'error',
'no-useless-catch': 'error',
[SIEM] Low impact linter rules to start with (#37137) ## Summary Low impact linter rules to help catch bugs for back-porting as well as moving into the future. We will slowly turn the warns into errors and fix the errors as we go along. This helps us avoid a "big bang" switch over approach to avoid back-port issues as we are porting bugs aggressively at the beginning. Added a custom pattern detection rule for determining if the UI is trying to import anything from the server backend since that would cause web-pack front to pull in backend code. Also forbid the use of NodeJS imports on the front end. Double checked that I was not duplicating rules from: * https://github.com/elastic/kibana/blob/master/packages/eslint-config-kibana/typescript.js * https://github.com/elastic/kibana/blob/master/packages/eslint-config-kibana/javascript.js ### Checklist Use ~~strikethroughs~~ to remove checklist items you don't feel are applicable to this PR. ~- [ ] This was checked for cross-browser compatibility, [including a check against IE11](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#cross-browser-compatibility)~ ~- [ ] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/master/packages/kbn-i18n/README.md)~ ~- [ ] [Documentation](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#writing-documentation) was added for features that require explanation or tutorials~ ~- [ ] [Unit or functional tests](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#cross-browser-compatibility) were updated or added to match the most common scenarios~ ~- [ ] This was checked for [keyboard-only and screenreader accessibility](https://developer.mozilla.org/en-US/docs/Learn/Tools_and_testing/Cross_browser_testing/Accessibility#Accessibility_testing_checklist)~ ### For maintainers ~- [ ] This was checked for breaking API changes and was [labeled appropriately](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#release-notes-process)~ ~- [ ] This includes a feature addition or change that requires a release note and was [labeled appropriately](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#release-notes-process)~
2019-05-28 19:14:17 +02:00
'no-useless-concat': 'error',
'no-useless-computed-key': 'error',
// This will be turned on after bug fixes are mostly complete
// 'no-useless-escape': 'warn',
'no-useless-rename': 'error',
'no-useless-return': 'error',
[SIEM] Low impact linter rules to start with (#37137) ## Summary Low impact linter rules to help catch bugs for back-porting as well as moving into the future. We will slowly turn the warns into errors and fix the errors as we go along. This helps us avoid a "big bang" switch over approach to avoid back-port issues as we are porting bugs aggressively at the beginning. Added a custom pattern detection rule for determining if the UI is trying to import anything from the server backend since that would cause web-pack front to pull in backend code. Also forbid the use of NodeJS imports on the front end. Double checked that I was not duplicating rules from: * https://github.com/elastic/kibana/blob/master/packages/eslint-config-kibana/typescript.js * https://github.com/elastic/kibana/blob/master/packages/eslint-config-kibana/javascript.js ### Checklist Use ~~strikethroughs~~ to remove checklist items you don't feel are applicable to this PR. ~- [ ] This was checked for cross-browser compatibility, [including a check against IE11](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#cross-browser-compatibility)~ ~- [ ] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/master/packages/kbn-i18n/README.md)~ ~- [ ] [Documentation](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#writing-documentation) was added for features that require explanation or tutorials~ ~- [ ] [Unit or functional tests](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#cross-browser-compatibility) were updated or added to match the most common scenarios~ ~- [ ] This was checked for [keyboard-only and screenreader accessibility](https://developer.mozilla.org/en-US/docs/Learn/Tools_and_testing/Cross_browser_testing/Accessibility#Accessibility_testing_checklist)~ ### For maintainers ~- [ ] This was checked for breaking API changes and was [labeled appropriately](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#release-notes-process)~ ~- [ ] This includes a feature addition or change that requires a release note and was [labeled appropriately](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#release-notes-process)~
2019-05-28 19:14:17 +02:00
// This will be turned on after bug fixers are mostly complete
// 'no-void': 'warn',
'one-var-declaration-per-line': 'error',
'prefer-object-spread': 'error',
'prefer-promise-reject-errors': 'error',
'prefer-rest-params': 'error',
'prefer-spread': 'error',
'prefer-template': 'error',
[SIEM] Low impact linter rules to start with (#37137) ## Summary Low impact linter rules to help catch bugs for back-porting as well as moving into the future. We will slowly turn the warns into errors and fix the errors as we go along. This helps us avoid a "big bang" switch over approach to avoid back-port issues as we are porting bugs aggressively at the beginning. Added a custom pattern detection rule for determining if the UI is trying to import anything from the server backend since that would cause web-pack front to pull in backend code. Also forbid the use of NodeJS imports on the front end. Double checked that I was not duplicating rules from: * https://github.com/elastic/kibana/blob/master/packages/eslint-config-kibana/typescript.js * https://github.com/elastic/kibana/blob/master/packages/eslint-config-kibana/javascript.js ### Checklist Use ~~strikethroughs~~ to remove checklist items you don't feel are applicable to this PR. ~- [ ] This was checked for cross-browser compatibility, [including a check against IE11](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#cross-browser-compatibility)~ ~- [ ] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/master/packages/kbn-i18n/README.md)~ ~- [ ] [Documentation](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#writing-documentation) was added for features that require explanation or tutorials~ ~- [ ] [Unit or functional tests](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#cross-browser-compatibility) were updated or added to match the most common scenarios~ ~- [ ] This was checked for [keyboard-only and screenreader accessibility](https://developer.mozilla.org/en-US/docs/Learn/Tools_and_testing/Cross_browser_testing/Accessibility#Accessibility_testing_checklist)~ ### For maintainers ~- [ ] This was checked for breaking API changes and was [labeled appropriately](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#release-notes-process)~ ~- [ ] This includes a feature addition or change that requires a release note and was [labeled appropriately](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#release-notes-process)~
2019-05-28 19:14:17 +02:00
'react/boolean-prop-naming': 'error',
'react/button-has-type': 'error',
'react/display-name': 'error',
[SIEM] Low impact linter rules to start with (#37137) ## Summary Low impact linter rules to help catch bugs for back-porting as well as moving into the future. We will slowly turn the warns into errors and fix the errors as we go along. This helps us avoid a "big bang" switch over approach to avoid back-port issues as we are porting bugs aggressively at the beginning. Added a custom pattern detection rule for determining if the UI is trying to import anything from the server backend since that would cause web-pack front to pull in backend code. Also forbid the use of NodeJS imports on the front end. Double checked that I was not duplicating rules from: * https://github.com/elastic/kibana/blob/master/packages/eslint-config-kibana/typescript.js * https://github.com/elastic/kibana/blob/master/packages/eslint-config-kibana/javascript.js ### Checklist Use ~~strikethroughs~~ to remove checklist items you don't feel are applicable to this PR. ~- [ ] This was checked for cross-browser compatibility, [including a check against IE11](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#cross-browser-compatibility)~ ~- [ ] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/master/packages/kbn-i18n/README.md)~ ~- [ ] [Documentation](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#writing-documentation) was added for features that require explanation or tutorials~ ~- [ ] [Unit or functional tests](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#cross-browser-compatibility) were updated or added to match the most common scenarios~ ~- [ ] This was checked for [keyboard-only and screenreader accessibility](https://developer.mozilla.org/en-US/docs/Learn/Tools_and_testing/Cross_browser_testing/Accessibility#Accessibility_testing_checklist)~ ### For maintainers ~- [ ] This was checked for breaking API changes and was [labeled appropriately](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#release-notes-process)~ ~- [ ] This includes a feature addition or change that requires a release note and was [labeled appropriately](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#release-notes-process)~
2019-05-28 19:14:17 +02:00
'react/forbid-dom-props': 'error',
[SIEM] Fix state issues to avoid potential React update issues (#37261) ## Summary Fixed prevState issues with React setState * This will avoid subtle bugs with the react update renderer * Enabled one lint rule from warn to error * Turned off the other linter issue as it has an open ticket against it. * https://github.com/elastic/ingest-dev/issues/468 Summarize your PR. If it involves visual changes include a screenshot or gif. ### Checklist Use ~~strikethroughs~~ to remove checklist items you don't feel are applicable to this PR. ~~- [ ] This was checked for cross-browser compatibility, [including a check against IE11](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#cross-browser-compatibility)~~ ~~- [ ] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/master/packages/kbn-i18n/README.md)~~ ~~- [ ] [Documentation](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#writing-documentation) was added for features that require explanation or tutorials~~ ~~- [ ] [Unit or functional tests](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#cross-browser-compatibility) were updated or added to match the most common scenarios~~ ~~- [ ] This was checked for [keyboard-only and screenreader accessibility](https://developer.mozilla.org/en-US/docs/Learn/Tools_and_testing/Cross_browser_testing/Accessibility#Accessibility_testing_checklist)~~ ### For maintainers ~~- [ ] This was checked for breaking API changes and was [labeled appropriately](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#release-notes-process)~~ ~~- [ ] This includes a feature addition or change that requires a release note and was [labeled appropriately](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#release-notes-process)~~
2019-05-28 21:10:53 +02:00
'react/no-access-state-in-setstate': 'error',
'react/no-children-prop': 'error',
[SIEM] Low impact linter rules to start with (#37137) ## Summary Low impact linter rules to help catch bugs for back-porting as well as moving into the future. We will slowly turn the warns into errors and fix the errors as we go along. This helps us avoid a "big bang" switch over approach to avoid back-port issues as we are porting bugs aggressively at the beginning. Added a custom pattern detection rule for determining if the UI is trying to import anything from the server backend since that would cause web-pack front to pull in backend code. Also forbid the use of NodeJS imports on the front end. Double checked that I was not duplicating rules from: * https://github.com/elastic/kibana/blob/master/packages/eslint-config-kibana/typescript.js * https://github.com/elastic/kibana/blob/master/packages/eslint-config-kibana/javascript.js ### Checklist Use ~~strikethroughs~~ to remove checklist items you don't feel are applicable to this PR. ~- [ ] This was checked for cross-browser compatibility, [including a check against IE11](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#cross-browser-compatibility)~ ~- [ ] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/master/packages/kbn-i18n/README.md)~ ~- [ ] [Documentation](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#writing-documentation) was added for features that require explanation or tutorials~ ~- [ ] [Unit or functional tests](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#cross-browser-compatibility) were updated or added to match the most common scenarios~ ~- [ ] This was checked for [keyboard-only and screenreader accessibility](https://developer.mozilla.org/en-US/docs/Learn/Tools_and_testing/Cross_browser_testing/Accessibility#Accessibility_testing_checklist)~ ### For maintainers ~- [ ] This was checked for breaking API changes and was [labeled appropriately](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#release-notes-process)~ ~- [ ] This includes a feature addition or change that requires a release note and was [labeled appropriately](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#release-notes-process)~
2019-05-28 19:14:17 +02:00
'react/no-danger-with-children': 'error',
'react/no-deprecated': 'error',
'react/no-did-mount-set-state': 'error',
[SIEM] Fix state issues to avoid potential React update issues (#37261) ## Summary Fixed prevState issues with React setState * This will avoid subtle bugs with the react update renderer * Enabled one lint rule from warn to error * Turned off the other linter issue as it has an open ticket against it. * https://github.com/elastic/ingest-dev/issues/468 Summarize your PR. If it involves visual changes include a screenshot or gif. ### Checklist Use ~~strikethroughs~~ to remove checklist items you don't feel are applicable to this PR. ~~- [ ] This was checked for cross-browser compatibility, [including a check against IE11](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#cross-browser-compatibility)~~ ~~- [ ] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/master/packages/kbn-i18n/README.md)~~ ~~- [ ] [Documentation](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#writing-documentation) was added for features that require explanation or tutorials~~ ~~- [ ] [Unit or functional tests](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#cross-browser-compatibility) were updated or added to match the most common scenarios~~ ~~- [ ] This was checked for [keyboard-only and screenreader accessibility](https://developer.mozilla.org/en-US/docs/Learn/Tools_and_testing/Cross_browser_testing/Accessibility#Accessibility_testing_checklist)~~ ### For maintainers ~~- [ ] This was checked for breaking API changes and was [labeled appropriately](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#release-notes-process)~~ ~~- [ ] This includes a feature addition or change that requires a release note and was [labeled appropriately](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#release-notes-process)~~
2019-05-28 21:10:53 +02:00
// Re-enable once we have better options per this issue:
// https://github.com/airbnb/javascript/issues/1875
// 'react/no-did-update-set-state': 'error',
[SIEM] Low impact linter rules to start with (#37137) ## Summary Low impact linter rules to help catch bugs for back-porting as well as moving into the future. We will slowly turn the warns into errors and fix the errors as we go along. This helps us avoid a "big bang" switch over approach to avoid back-port issues as we are porting bugs aggressively at the beginning. Added a custom pattern detection rule for determining if the UI is trying to import anything from the server backend since that would cause web-pack front to pull in backend code. Also forbid the use of NodeJS imports on the front end. Double checked that I was not duplicating rules from: * https://github.com/elastic/kibana/blob/master/packages/eslint-config-kibana/typescript.js * https://github.com/elastic/kibana/blob/master/packages/eslint-config-kibana/javascript.js ### Checklist Use ~~strikethroughs~~ to remove checklist items you don't feel are applicable to this PR. ~- [ ] This was checked for cross-browser compatibility, [including a check against IE11](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#cross-browser-compatibility)~ ~- [ ] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/master/packages/kbn-i18n/README.md)~ ~- [ ] [Documentation](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#writing-documentation) was added for features that require explanation or tutorials~ ~- [ ] [Unit or functional tests](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#cross-browser-compatibility) were updated or added to match the most common scenarios~ ~- [ ] This was checked for [keyboard-only and screenreader accessibility](https://developer.mozilla.org/en-US/docs/Learn/Tools_and_testing/Cross_browser_testing/Accessibility#Accessibility_testing_checklist)~ ### For maintainers ~- [ ] This was checked for breaking API changes and was [labeled appropriately](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#release-notes-process)~ ~- [ ] This includes a feature addition or change that requires a release note and was [labeled appropriately](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#release-notes-process)~
2019-05-28 19:14:17 +02:00
'react/no-direct-mutation-state': 'error',
'react/no-find-dom-node': 'error',
'react/no-redundant-should-component-update': 'error',
'react/no-render-return-value': 'error',
'react/no-typos': 'error',
'react/no-string-refs': 'error',
'react/no-this-in-sfc': 'error',
[SIEM] Fixed unescaped HTML entity issue (#37257) ## Summary * Turned on linter rule to be an error * Removed the extra character * https://github.com/elastic/ingest-dev/issues/467 Removes the extra `}` character seen after line 84 below in the screen shot: <img width="368" alt="Screen Shot 2019-05-28 at 9 39 28 AM" src="https://user-images.githubusercontent.com/1151048/58498271-f4672f00-813a-11e9-8b80-2326db363bb0.png"> ### Checklist Use ~~strikethroughs~~ to remove checklist items you don't feel are applicable to this PR. ~~- [ ] This was checked for cross-browser compatibility, [including a check against IE11](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#cross-browser-compatibility)~~ ~~- [ ] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/master/packages/kbn-i18n/README.md)~~ ~~- [ ] [Documentation](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#writing-documentation) was added for features that require explanation or tutorials~~ ~~- [ ] [Unit or functional tests](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#cross-browser-compatibility) were updated or added to match the most common scenarios~~ ~~- [ ] This was checked for [keyboard-only and screenreader accessibility](https://developer.mozilla.org/en-US/docs/Learn/Tools_and_testing/Cross_browser_testing/Accessibility#Accessibility_testing_checklist)~~ ### For maintainers ~~- [ ] This was checked for breaking API changes and was [labeled appropriately](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#release-notes-process)~~ ~~- [ ] This includes a feature addition or change that requires a release note and was [labeled appropriately](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#release-notes-process)~~
2019-05-28 20:33:51 +02:00
'react/no-unescaped-entities': 'error',
[SIEM] Low impact linter rules to start with (#37137) ## Summary Low impact linter rules to help catch bugs for back-porting as well as moving into the future. We will slowly turn the warns into errors and fix the errors as we go along. This helps us avoid a "big bang" switch over approach to avoid back-port issues as we are porting bugs aggressively at the beginning. Added a custom pattern detection rule for determining if the UI is trying to import anything from the server backend since that would cause web-pack front to pull in backend code. Also forbid the use of NodeJS imports on the front end. Double checked that I was not duplicating rules from: * https://github.com/elastic/kibana/blob/master/packages/eslint-config-kibana/typescript.js * https://github.com/elastic/kibana/blob/master/packages/eslint-config-kibana/javascript.js ### Checklist Use ~~strikethroughs~~ to remove checklist items you don't feel are applicable to this PR. ~- [ ] This was checked for cross-browser compatibility, [including a check against IE11](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#cross-browser-compatibility)~ ~- [ ] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/master/packages/kbn-i18n/README.md)~ ~- [ ] [Documentation](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#writing-documentation) was added for features that require explanation or tutorials~ ~- [ ] [Unit or functional tests](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#cross-browser-compatibility) were updated or added to match the most common scenarios~ ~- [ ] This was checked for [keyboard-only and screenreader accessibility](https://developer.mozilla.org/en-US/docs/Learn/Tools_and_testing/Cross_browser_testing/Accessibility#Accessibility_testing_checklist)~ ### For maintainers ~- [ ] This was checked for breaking API changes and was [labeled appropriately](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#release-notes-process)~ ~- [ ] This includes a feature addition or change that requires a release note and was [labeled appropriately](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#release-notes-process)~
2019-05-28 19:14:17 +02:00
'react/no-unsafe': 'error',
'react/no-unused-prop-types': 'error',
'react/no-unused-state': 'error',
// will introduced after the other warns are fixed
// 'react/sort-comp': 'error',
'react/void-dom-elements-no-children': 'error',
'react/jsx-no-comment-textnodes': 'error',
[SIEM] Add missing i18n keys (#37400) ## Summary * Added missing i18n keys * Added linter rule to catch mistakes * Updated code and tests and other areas to work with new linter rule * Changed linter rule to be an error now * Fixed other i18n keys * Added spacer and removed the &nbsp; that the linter did not like ### Checklist Use ~~strikethroughs~~ to remove checklist items you don't feel are applicable to this PR. ~~- [ ] This was checked for cross-browser compatibility, [including a check against IE11](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#cross-browser-compatibility)~~ - [x] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/master/packages/kbn-i18n/README.md) ~~- [ ] [Documentation](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#writing-documentation) was added for features that require explanation or tutorials~~ - [x] [Unit or functional tests](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#cross-browser-compatibility) were updated or added to match the most common scenarios ~~- [ ] This was checked for [keyboard-only and screenreader accessibility](https://developer.mozilla.org/en-US/docs/Learn/Tools_and_testing/Cross_browser_testing/Accessibility#Accessibility_testing_checklist)~~ ### For maintainers ~~- [ ] This was checked for breaking API changes and was [labeled appropriately](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#release-notes-process)~~ ~~- [ ] This includes a feature addition or change that requires a release note and was [labeled appropriately](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#release-notes-process)~~
2019-05-30 22:17:29 +02:00
'react/jsx-no-literals': 'error',
[SIEM] Low impact linter rules to start with (#37137) ## Summary Low impact linter rules to help catch bugs for back-porting as well as moving into the future. We will slowly turn the warns into errors and fix the errors as we go along. This helps us avoid a "big bang" switch over approach to avoid back-port issues as we are porting bugs aggressively at the beginning. Added a custom pattern detection rule for determining if the UI is trying to import anything from the server backend since that would cause web-pack front to pull in backend code. Also forbid the use of NodeJS imports on the front end. Double checked that I was not duplicating rules from: * https://github.com/elastic/kibana/blob/master/packages/eslint-config-kibana/typescript.js * https://github.com/elastic/kibana/blob/master/packages/eslint-config-kibana/javascript.js ### Checklist Use ~~strikethroughs~~ to remove checklist items you don't feel are applicable to this PR. ~- [ ] This was checked for cross-browser compatibility, [including a check against IE11](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#cross-browser-compatibility)~ ~- [ ] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/master/packages/kbn-i18n/README.md)~ ~- [ ] [Documentation](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#writing-documentation) was added for features that require explanation or tutorials~ ~- [ ] [Unit or functional tests](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#cross-browser-compatibility) were updated or added to match the most common scenarios~ ~- [ ] This was checked for [keyboard-only and screenreader accessibility](https://developer.mozilla.org/en-US/docs/Learn/Tools_and_testing/Cross_browser_testing/Accessibility#Accessibility_testing_checklist)~ ### For maintainers ~- [ ] This was checked for breaking API changes and was [labeled appropriately](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#release-notes-process)~ ~- [ ] This includes a feature addition or change that requires a release note and was [labeled appropriately](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#release-notes-process)~
2019-05-28 19:14:17 +02:00
'react/jsx-no-target-blank': 'error',
'react/jsx-fragments': 'error',
'react/jsx-sort-default-props': 'error',
// might be introduced after the other warns are fixed
// 'react/jsx-sort-props': 'error',
2019-11-16 18:24:27 +01:00
// might be introduced after the other warns are fixed
'react-hooks/exhaustive-deps': 'off',
[SIEM] Low impact linter rules to start with (#37137) ## Summary Low impact linter rules to help catch bugs for back-porting as well as moving into the future. We will slowly turn the warns into errors and fix the errors as we go along. This helps us avoid a "big bang" switch over approach to avoid back-port issues as we are porting bugs aggressively at the beginning. Added a custom pattern detection rule for determining if the UI is trying to import anything from the server backend since that would cause web-pack front to pull in backend code. Also forbid the use of NodeJS imports on the front end. Double checked that I was not duplicating rules from: * https://github.com/elastic/kibana/blob/master/packages/eslint-config-kibana/typescript.js * https://github.com/elastic/kibana/blob/master/packages/eslint-config-kibana/javascript.js ### Checklist Use ~~strikethroughs~~ to remove checklist items you don't feel are applicable to this PR. ~- [ ] This was checked for cross-browser compatibility, [including a check against IE11](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#cross-browser-compatibility)~ ~- [ ] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/master/packages/kbn-i18n/README.md)~ ~- [ ] [Documentation](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#writing-documentation) was added for features that require explanation or tutorials~ ~- [ ] [Unit or functional tests](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#cross-browser-compatibility) were updated or added to match the most common scenarios~ ~- [ ] This was checked for [keyboard-only and screenreader accessibility](https://developer.mozilla.org/en-US/docs/Learn/Tools_and_testing/Cross_browser_testing/Accessibility#Accessibility_testing_checklist)~ ### For maintainers ~- [ ] This was checked for breaking API changes and was [labeled appropriately](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#release-notes-process)~ ~- [ ] This includes a feature addition or change that requires a release note and was [labeled appropriately](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#release-notes-process)~
2019-05-28 19:14:17 +02:00
'require-atomic-updates': 'error',
'symbol-description': 'error',
'vars-on-top': 'error',
},
},
[SIEM][Detections] Adds large list support using REST endpoints ## Summary * Adds large list support using REST endpoints. Status: --- * Currently ready to be merged behind the feature flag of it being disabled with ongoing work happening after it is merged. * REST Endpoints shouldn't have large refactoring at this point * Team meeting occurred where the pieces were discussed in person. What is left? --- - [ ] Add other data types. At the moment `ip` and `keyword` are the two types of lists. See: https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-types.html - [x] Unit tests - [x] Lots of misc TODO's in the code base still - [ ] Import loads everything into memory first when it should attempt streaming - [ ] Add end to end backend tests - [x] Add transform and io-ts validation for returns Testing --- Ensure you set this in your ENV before starting Kibana: ```ts export ELASTIC_XPACK_SIEM_LISTS_FEATURE=true ``` Download or create a large list file such as this one filled with IP's: https://cinsscore.com/list/ci-badguys.txt Go to your REST endpoint folder of scripts: ```ts cd kibana/x-pack/plugins/lists/server/scripts ``` Do a hard reset: ```ts ./hard_reset ``` Then import it as either a data type of `ip`: ```ts ./import_list_items_by_filename.sh ip ~/Downloads/ci-badguys-smaller.txt ``` Or as a `keyword` ```ts ./import_list_items_by_filename.sh keyword ~/Downloads/ci-badguys-smaller.txt ``` Then you can export it through: ```ts ./export_list_items.sh ci-badgusy-smaller.txt ``` For all the other endpoints and testing of the CRUD operations you have access to: ```ts delete_all_lists.sh delete_list.sh delete_list_index.sh delete_list_item.sh delete_list_item_by_id.sh delete_list_item_by_value.sh export_list_items.sh export_list_items_to_file.sh get_list.sh get_list_item_by_id.sh get_list_item_by_value.sh import_list_items.sh import_list_items_by_filename.sh lists_index_exists.sh patch_list.sh patch_list_item.sh post_list.sh post_list_index.sh post_list_item.sh ``` ### Checklist Delete any items that are not applicable to this PR. - [ ] [Unit or functional tests](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#cross-browser-compatibility) were updated or added to match the most common scenarios ### For maintainers - [ ] This was checked for breaking API changes and was [labeled appropriately](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#release-notes-process)
2020-04-29 00:00:22 +02:00
/**
* Lists overrides
*/
{
// typescript and javascript for front and back end
files: ['x-pack/plugins/lists/**/*.{js,ts,tsx}'],
plugins: ['eslint-plugin-node'],
env: {
mocha: true,
jest: true,
},
rules: {
'accessor-pairs': 'error',
'array-callback-return': 'error',
'no-array-constructor': 'error',
complexity: 'error',
'consistent-return': 'error',
'func-style': ['error', 'expression'],
'import/order': [
'error',
{
groups: ['builtin', 'external', 'internal', 'parent', 'sibling', 'index'],
'newlines-between': 'always',
},
],
'sort-imports': [
'error',
{
ignoreDeclarationSort: true,
},
],
'node/no-deprecated-api': 'error',
'no-bitwise': 'error',
'no-continue': 'error',
'no-dupe-keys': 'error',
'no-duplicate-case': 'error',
'no-duplicate-imports': 'error',
'no-empty-character-class': 'error',
'no-empty-pattern': 'error',
'no-ex-assign': 'error',
'no-extend-native': 'error',
'no-extra-bind': 'error',
'no-extra-boolean-cast': 'error',
'no-extra-label': 'error',
'no-func-assign': 'error',
'no-implicit-globals': 'error',
'no-implied-eval': 'error',
'no-invalid-regexp': 'error',
'no-inner-declarations': 'error',
'no-lone-blocks': 'error',
'no-multi-assign': 'error',
'no-misleading-character-class': 'error',
'no-new-symbol': 'error',
'no-obj-calls': 'error',
'no-param-reassign': ['error', { props: true }],
'no-process-exit': 'error',
'no-prototype-builtins': 'error',
'no-return-await': 'error',
'no-self-compare': 'error',
'no-shadow-restricted-names': 'error',
'no-sparse-arrays': 'error',
'no-this-before-super': 'error',
'no-undef': 'error',
'no-unreachable': 'error',
'no-unsafe-finally': 'error',
'no-useless-call': 'error',
'no-useless-catch': 'error',
'no-useless-concat': 'error',
'no-useless-computed-key': 'error',
'no-useless-escape': 'error',
'no-useless-rename': 'error',
'no-useless-return': 'error',
'no-void': 'error',
'one-var-declaration-per-line': 'error',
'prefer-object-spread': 'error',
'prefer-promise-reject-errors': 'error',
'prefer-rest-params': 'error',
'prefer-spread': 'error',
'prefer-template': 'error',
'require-atomic-updates': 'error',
'symbol-description': 'error',
'vars-on-top': 'error',
'@typescript-eslint/explicit-member-accessibility': 'error',
'@typescript-eslint/no-this-alias': 'error',
'@typescript-eslint/no-explicit-any': 'error',
'@typescript-eslint/no-useless-constructor': 'error',
'@typescript-eslint/unified-signatures': 'error',
'@typescript-eslint/explicit-function-return-type': 'error',
'@typescript-eslint/no-non-null-assertion': 'error',
'@typescript-eslint/no-unused-vars': 'error',
'no-template-curly-in-string': 'error',
'sort-keys': 'error',
'prefer-destructuring': 'error',
},
},
/**
* Alerting Services overrides
*/
{
// typescript only for front and back end
files: [
'x-pack/{,legacy/}plugins/{alerting,alerting_builtins,actions,task_manager,event_log}/**/*.{ts,tsx}',
],
rules: {
'@typescript-eslint/no-explicit-any': 'error',
},
},
New visualization editor Lens (#36437) * [lens] Initial Commit (#35627) * [visualization editor] Initial Commit * [lens] Add more complete initial state * [lens] Fix type issues * [lens] Remove feature control * [lens] Bring back feature control and add tests * [lens] Update plugin structure and naming per comments * replace any usage by safe casting * [lens] Respond to review comments * [lens] Remove unused EditorFrameState type * [lens] Initial state for IndexPatternDatasource (#36052) * [lens] Add first tests to indexpattern data source * Respond to review comments * Fix type definitions * [lens] Editor frame initializes datasources and visualizations (#36060) * [lens] Editor frame initializes datasources and visualizations * Respond to review comments * Fix build issues * Fix state management issue * [lens][draft] Lens/drag drop (#36268) Add basic drag / drop component to Lens * remove local package (#36456) * [lens] Native renderer (#36165) * Add nativerenderer component * Use native renderer in app and editor frame * [Lens] No explicit any (#36515) * [Lens] Implement basic editor frame state handling (#36443) * [lens] Load index patterns and render in data panel (#36463) * [lens] Editor frame initializes datasources and visualizations * Respond to review comments * Fix build issues * remove local package * [lens] Load index patterns into data source * Redo types for Index Pattern Datasource * Fix one more type * Respond to review comments * [draft] Lens/line chart renderer (#36827) Expression logic for the Lens xy chart. * [lens] Index pattern data panel (initial) (#37015) * [lens] Index pattern switcher * Respond to review comments * [Lens] Editor state 2 (#36513) * [lens] Dimension panel that generates columns (#37117) * [lens] Dimension panel that generates columns * Update from review comments * [lens] Generate esdocs queries from index pattern (#37361) * [lens] Generate esdocs queries from index pattern * Remove unused code * Update yarn.lock from yarn kbn bootstrap * [Lens] Add basic Lens xy chart suggestions (#37030) Basic xy chart suggestions * [Lens] Expression rendering (#37648) * [Lens] Expression handling (#37876) * [Lens] Lens/xy config panel (#37391) Basic xy chart configuration panel * [Lens] Xy expression building (#37967) * [Lens] Initialize visualization with datasource api (#38142) * [lens] Dimension panel lets users select operations and fields individually (#37573) * [lens] Dimension panel lets users select operations and fields individually * Split files and add tests * Fix dimension labeling and add clear button * Support more aggregations, aggregation nesting, rollups, and clearing * Fix esaggs expression * Increase top-level test coverage of dimension panel * Update from review comments * [Lens] Rename columns (#38278) * [Lens] Lens/index pattern drag drop (#37711) * Basic xy chart suggestions * Re-apply XY config panel after force merge * Initial integration of lens drag and drop * Tweak naming, remove irellevant comment * Tweaks per Wylie's feedback * Add xy chart internationalization Tweak types per Joe's feedback * Update xy chart i18n implementation * Fix i18n id * Add drop tests to the lens index pattern * improve tests * [lens] Only allow aggregated dimensions (#38820) * [lens] Only allow aggregated dimensions * [lens] Index pattern suggest on drop * Fully remove value * Revert "[lens] Index pattern suggest on drop" This reverts commit 604c6ed68ca394441ddafa662bdfc5f421de300c. * Fix type errors * [lens] Suggest on drop (#38848) * [lens] Index pattern suggest on drop * Add test for suggestion without date field * fix merge * [Lens] Parameter configurations and new dimension config flow (#38863) * fix eslint failure * [lens] Fix build by updating saved objects and i18n (#39391) * [lens] Update location of saved objects code * Update internatationalization * Remove added file * [lens] Fix arguments to esaggs using booleans (#39462) * [lens] Datatable visualization plugin (#39390) * [lens] Datatable visualization plugin * Fix merge issues and add tests * Update from review * Fix file locations * [lens] Use first suggestion when switching visualizations (#39377) * [lens] Label each Y axis with its operation label (#39461) * [lens] Label each Y axis with its operation label * Remove comment * Add link to chart issue * [Lens] Suggestion preview rendering (#39576) * [Lens] Popover configs (#39565) * [Lens] Basic layouting (#39587) * remove datasource public API in suggestions (#39772) * [Lens] Basic save / load (#39257) Add basic routing, save, and load to Lens * [lens] Fix lint error * [lens] Use node scripts/eslint.js --fix to fix errors * [lens] Include link to lens from Visualize (#40542) * [lens] Support stacking in xy visualization (#40546) * [lens] Support stacking in xy visualization * Use chart type switcher for stacked and horizontal xy charts * Clean up remaining isStacked code * Fix type error * [Lens] Add xy split series support (#39726) * Add split series to lens xy chart * [lens] Lens Filter Ratio (#40196) * WIP filter ratio * Fix test issues * Pass dependencies through plugin like new platform * Pass props into filter ratio popover editor * Provide mocks to filter_ratio popover test * Add another test * Clean up to prepare for review * Clean up unnecessary changes * Respond to review comments * Fix tests * [Lens] Terms order direction (#39884) * fix types * [Lens] Data panel styling and optimizations (#40787) Style the data panel (mostly Joe Reuter's doing). Optimize a bunch of the Lens stack. * [Lens] Optimize dimension panel flow (#41114) * [Lens] re-introduce no-explicit-any (#41454) * [Lens] No results marker (#41450) * [lens] Support layers for visualizing results of multiple queries (#41290) * [lens] WIP add support for layers * [lens] WIP switch to nested tables * Get basic layering to work * Load multiple tables and render in one chart * Fix priority ordering * Reduce quantity of linting errors * Ensure that new xy layer state has a split column * Make the "add" y / split the trailing accessor * Various fixes for datasource public API and implementation * Unify datasource deletion and accessor removal * Fix broken scss * Fix xy visualization TypeScript errors? * Build basic suggestions * Restore save/load and fix typescript bugs * simplify init routine * fix save tests * fix persistence tests * fix state management tests * Ensure the data table is aligned to the top * Add layer support to Lens datatable * Give xy chart a default layer initially * Allow deletion of layers in xy charts * xy: Make split accessor singular Remove commented code blocks * Change expression type for lens_merge_tables * Fix XY chart rendering expression * Fix type errors relating to `layerId` in table suggestions * Pass around tables for suggestions with associated layerIds * fix tests in workspace panel * fix editor_frame tests * Fix xy tests, skip inapplicable tests that will be implemented in a separate PR * add some tests for multiple datasources and layers * Suggest that split series comes before X axis in XY chart * Get datatable suggestion working * Adjust how xy axis labels are computed * Datasource suggestions should handle layers and have tests * Fix linting in XY chart and remove commented code * Update snapshots from earlier change * Fix linting errors * More cleanup * Remove commented code * Test the multi-column editor * XY Visualization does not need to track datasourceId * Fix various comments * Remove unused xy prop Add datasource header to datatable config * Use operation labels for XY chart * Adding and removing layers is reflected in the datasource * rewrote datasource state init * clean up editor_frame frame api implementation * clean up editor frame * [Lens] Embeddable (#41361) * [lens] Move XY chart config into popover and fix layering (#41927) * [lens] Move XY chart config into popover and fix layering * Fix tests * Update style * Change wrapping of layer settings popover * [Lens] Fix bugs in date_histogram and filter ratio (#42046) * [Lens] Performance improvements (#41784) * fix type error * switch default size of terms operation to 3 (#42334) * [lens] Improve suggestions for split series (#42052) * [lens] Add chart switcher (#42093) * solve merge conflicts * fix test case * [Lens] Allow only current visualization on field drop in workspace (#42344) * [Lens] Remove indexpattern id on column (#42429) * [lens] Implement app-level filtering and time picker (#42031) * [lens] Implement app-level filtering and time picker * More integration with filter bar * Clean up test code and type errors * Add frame level tests for syncing with app * Add test coverage for app logic * Simplify state management from app down * Fix import errors * Clarify whether properties are ids or titles for index pattern * pass new saved object by ref * add dirty state checking * Fix tests * [Lens] Add some tests around document handling in dimension panel (#42670) * [Lens] Terms operation boolean support (#42817) * [lens] Minor UX/UI improvements in Lens (#42852) * Make dimension popover toggle when clicking button * Without suggestions hide suggestion panel * Add missing translations (#42921) * [Lens] Config panel design (#42980) * Fix up design of config panel Does not include config popover * Remove a couple of non-null assertions (#43013) * Remove a couple of non-null assertions * Remove orphaned import * [Lens] Switch indexpattern manually (#42599) * [Lens] Update frame to put suggestions at the bottom (#42997) * fix type errors * switch indexpattern on layer if there is only a single empty one (#43079) * [Lens] Suggest reduced versions of current data table (#42537) * [Lens] Field formatter support (#38874) * Fix bugs * [Lens] Add bucket nesting editor to indexpattern (#42869) * [Lens] Remove unnecessary fields and indexing from mappings (#43285) * [Lens] Xy scale type (#42142) * [lens] Allow updater function to be used for updating state (#43373) * [Lens] Lens metric visualization (#39364) * Fix axis rotation (#43792) * [Lens] Auto date histogram (#43775) * Add auto date histogram * Improve documentation and cleanup * Add tests * Change test name * [Lens] Fix query bar integration (#43865) * [Lens] Clean up operations code (#43784) * [Lens] Functional tests (#44279) Foundational layer for lens functional tests. Lens-specific page objects are not in this PR. * [Lens] Add Lens visualizations to Visualize list (#43398) * [Lens] Suggestion improvements (#43688) * [lens] Calculate existence of fields in datasource (#44422) * [lens] Calculate existence of fields in datasource * Fix route registration * Add page object and use existence in functional test * Simplify layout of filters for index pattern * Respond to review feedback * Update class names * Use new URL constant * Fix usage of base path * Fix lint errors * [Lens ] Preview metric (#43755) * format filter ratio as percentage (#44625) * [Lens] Remove datasource suggestion id (#44495) * [Lens] Make breadcrumbs look and feel like Visualize (#44258) * [lens] Fix breakage from app-arch movements (#44720) * [lens] Fix type error in test from merge * [lens] Fix registration of embeddable (#45171) * [Lens] Functional tests (#44814) Basic functional tests for Lens, by no means comprehensive. This is more of a smokescreen test of some normal use cases. * [lens] Add Lens to CODEOWNERS (#45296) * [lens] Fix visualization alias registration * [lens] Fix usage of EUI after typescript upgrade (#45404) * [lens] Fix usage of EUI after typescript upgrade * Use local fix instead of workaround * [lens] Fix usage of expressions plugin (#45544) * [lens] Fix usage of expressions plugin * Use updated exports from #45538 * Fix imports and mocha tests * Use relative instead of absolute path to fix tests * [lens] More cleanup from QueryBar changes in master (#45687) * [lens] Fix build and use new platform from entry points (#45834) * [lens] Fix build and use new platform from entry points * Fix params for existence route
2019-09-17 20:57:53 +02:00
/**
* Lens overrides
*/
{
files: ['x-pack/plugins/lens/**/*.{ts,tsx}'],
New visualization editor Lens (#36437) * [lens] Initial Commit (#35627) * [visualization editor] Initial Commit * [lens] Add more complete initial state * [lens] Fix type issues * [lens] Remove feature control * [lens] Bring back feature control and add tests * [lens] Update plugin structure and naming per comments * replace any usage by safe casting * [lens] Respond to review comments * [lens] Remove unused EditorFrameState type * [lens] Initial state for IndexPatternDatasource (#36052) * [lens] Add first tests to indexpattern data source * Respond to review comments * Fix type definitions * [lens] Editor frame initializes datasources and visualizations (#36060) * [lens] Editor frame initializes datasources and visualizations * Respond to review comments * Fix build issues * Fix state management issue * [lens][draft] Lens/drag drop (#36268) Add basic drag / drop component to Lens * remove local package (#36456) * [lens] Native renderer (#36165) * Add nativerenderer component * Use native renderer in app and editor frame * [Lens] No explicit any (#36515) * [Lens] Implement basic editor frame state handling (#36443) * [lens] Load index patterns and render in data panel (#36463) * [lens] Editor frame initializes datasources and visualizations * Respond to review comments * Fix build issues * remove local package * [lens] Load index patterns into data source * Redo types for Index Pattern Datasource * Fix one more type * Respond to review comments * [draft] Lens/line chart renderer (#36827) Expression logic for the Lens xy chart. * [lens] Index pattern data panel (initial) (#37015) * [lens] Index pattern switcher * Respond to review comments * [Lens] Editor state 2 (#36513) * [lens] Dimension panel that generates columns (#37117) * [lens] Dimension panel that generates columns * Update from review comments * [lens] Generate esdocs queries from index pattern (#37361) * [lens] Generate esdocs queries from index pattern * Remove unused code * Update yarn.lock from yarn kbn bootstrap * [Lens] Add basic Lens xy chart suggestions (#37030) Basic xy chart suggestions * [Lens] Expression rendering (#37648) * [Lens] Expression handling (#37876) * [Lens] Lens/xy config panel (#37391) Basic xy chart configuration panel * [Lens] Xy expression building (#37967) * [Lens] Initialize visualization with datasource api (#38142) * [lens] Dimension panel lets users select operations and fields individually (#37573) * [lens] Dimension panel lets users select operations and fields individually * Split files and add tests * Fix dimension labeling and add clear button * Support more aggregations, aggregation nesting, rollups, and clearing * Fix esaggs expression * Increase top-level test coverage of dimension panel * Update from review comments * [Lens] Rename columns (#38278) * [Lens] Lens/index pattern drag drop (#37711) * Basic xy chart suggestions * Re-apply XY config panel after force merge * Initial integration of lens drag and drop * Tweak naming, remove irellevant comment * Tweaks per Wylie's feedback * Add xy chart internationalization Tweak types per Joe's feedback * Update xy chart i18n implementation * Fix i18n id * Add drop tests to the lens index pattern * improve tests * [lens] Only allow aggregated dimensions (#38820) * [lens] Only allow aggregated dimensions * [lens] Index pattern suggest on drop * Fully remove value * Revert "[lens] Index pattern suggest on drop" This reverts commit 604c6ed68ca394441ddafa662bdfc5f421de300c. * Fix type errors * [lens] Suggest on drop (#38848) * [lens] Index pattern suggest on drop * Add test for suggestion without date field * fix merge * [Lens] Parameter configurations and new dimension config flow (#38863) * fix eslint failure * [lens] Fix build by updating saved objects and i18n (#39391) * [lens] Update location of saved objects code * Update internatationalization * Remove added file * [lens] Fix arguments to esaggs using booleans (#39462) * [lens] Datatable visualization plugin (#39390) * [lens] Datatable visualization plugin * Fix merge issues and add tests * Update from review * Fix file locations * [lens] Use first suggestion when switching visualizations (#39377) * [lens] Label each Y axis with its operation label (#39461) * [lens] Label each Y axis with its operation label * Remove comment * Add link to chart issue * [Lens] Suggestion preview rendering (#39576) * [Lens] Popover configs (#39565) * [Lens] Basic layouting (#39587) * remove datasource public API in suggestions (#39772) * [Lens] Basic save / load (#39257) Add basic routing, save, and load to Lens * [lens] Fix lint error * [lens] Use node scripts/eslint.js --fix to fix errors * [lens] Include link to lens from Visualize (#40542) * [lens] Support stacking in xy visualization (#40546) * [lens] Support stacking in xy visualization * Use chart type switcher for stacked and horizontal xy charts * Clean up remaining isStacked code * Fix type error * [Lens] Add xy split series support (#39726) * Add split series to lens xy chart * [lens] Lens Filter Ratio (#40196) * WIP filter ratio * Fix test issues * Pass dependencies through plugin like new platform * Pass props into filter ratio popover editor * Provide mocks to filter_ratio popover test * Add another test * Clean up to prepare for review * Clean up unnecessary changes * Respond to review comments * Fix tests * [Lens] Terms order direction (#39884) * fix types * [Lens] Data panel styling and optimizations (#40787) Style the data panel (mostly Joe Reuter's doing). Optimize a bunch of the Lens stack. * [Lens] Optimize dimension panel flow (#41114) * [Lens] re-introduce no-explicit-any (#41454) * [Lens] No results marker (#41450) * [lens] Support layers for visualizing results of multiple queries (#41290) * [lens] WIP add support for layers * [lens] WIP switch to nested tables * Get basic layering to work * Load multiple tables and render in one chart * Fix priority ordering * Reduce quantity of linting errors * Ensure that new xy layer state has a split column * Make the "add" y / split the trailing accessor * Various fixes for datasource public API and implementation * Unify datasource deletion and accessor removal * Fix broken scss * Fix xy visualization TypeScript errors? * Build basic suggestions * Restore save/load and fix typescript bugs * simplify init routine * fix save tests * fix persistence tests * fix state management tests * Ensure the data table is aligned to the top * Add layer support to Lens datatable * Give xy chart a default layer initially * Allow deletion of layers in xy charts * xy: Make split accessor singular Remove commented code blocks * Change expression type for lens_merge_tables * Fix XY chart rendering expression * Fix type errors relating to `layerId` in table suggestions * Pass around tables for suggestions with associated layerIds * fix tests in workspace panel * fix editor_frame tests * Fix xy tests, skip inapplicable tests that will be implemented in a separate PR * add some tests for multiple datasources and layers * Suggest that split series comes before X axis in XY chart * Get datatable suggestion working * Adjust how xy axis labels are computed * Datasource suggestions should handle layers and have tests * Fix linting in XY chart and remove commented code * Update snapshots from earlier change * Fix linting errors * More cleanup * Remove commented code * Test the multi-column editor * XY Visualization does not need to track datasourceId * Fix various comments * Remove unused xy prop Add datasource header to datatable config * Use operation labels for XY chart * Adding and removing layers is reflected in the datasource * rewrote datasource state init * clean up editor_frame frame api implementation * clean up editor frame * [Lens] Embeddable (#41361) * [lens] Move XY chart config into popover and fix layering (#41927) * [lens] Move XY chart config into popover and fix layering * Fix tests * Update style * Change wrapping of layer settings popover * [Lens] Fix bugs in date_histogram and filter ratio (#42046) * [Lens] Performance improvements (#41784) * fix type error * switch default size of terms operation to 3 (#42334) * [lens] Improve suggestions for split series (#42052) * [lens] Add chart switcher (#42093) * solve merge conflicts * fix test case * [Lens] Allow only current visualization on field drop in workspace (#42344) * [Lens] Remove indexpattern id on column (#42429) * [lens] Implement app-level filtering and time picker (#42031) * [lens] Implement app-level filtering and time picker * More integration with filter bar * Clean up test code and type errors * Add frame level tests for syncing with app * Add test coverage for app logic * Simplify state management from app down * Fix import errors * Clarify whether properties are ids or titles for index pattern * pass new saved object by ref * add dirty state checking * Fix tests * [Lens] Add some tests around document handling in dimension panel (#42670) * [Lens] Terms operation boolean support (#42817) * [lens] Minor UX/UI improvements in Lens (#42852) * Make dimension popover toggle when clicking button * Without suggestions hide suggestion panel * Add missing translations (#42921) * [Lens] Config panel design (#42980) * Fix up design of config panel Does not include config popover * Remove a couple of non-null assertions (#43013) * Remove a couple of non-null assertions * Remove orphaned import * [Lens] Switch indexpattern manually (#42599) * [Lens] Update frame to put suggestions at the bottom (#42997) * fix type errors * switch indexpattern on layer if there is only a single empty one (#43079) * [Lens] Suggest reduced versions of current data table (#42537) * [Lens] Field formatter support (#38874) * Fix bugs * [Lens] Add bucket nesting editor to indexpattern (#42869) * [Lens] Remove unnecessary fields and indexing from mappings (#43285) * [Lens] Xy scale type (#42142) * [lens] Allow updater function to be used for updating state (#43373) * [Lens] Lens metric visualization (#39364) * Fix axis rotation (#43792) * [Lens] Auto date histogram (#43775) * Add auto date histogram * Improve documentation and cleanup * Add tests * Change test name * [Lens] Fix query bar integration (#43865) * [Lens] Clean up operations code (#43784) * [Lens] Functional tests (#44279) Foundational layer for lens functional tests. Lens-specific page objects are not in this PR. * [Lens] Add Lens visualizations to Visualize list (#43398) * [Lens] Suggestion improvements (#43688) * [lens] Calculate existence of fields in datasource (#44422) * [lens] Calculate existence of fields in datasource * Fix route registration * Add page object and use existence in functional test * Simplify layout of filters for index pattern * Respond to review feedback * Update class names * Use new URL constant * Fix usage of base path * Fix lint errors * [Lens ] Preview metric (#43755) * format filter ratio as percentage (#44625) * [Lens] Remove datasource suggestion id (#44495) * [Lens] Make breadcrumbs look and feel like Visualize (#44258) * [lens] Fix breakage from app-arch movements (#44720) * [lens] Fix type error in test from merge * [lens] Fix registration of embeddable (#45171) * [Lens] Functional tests (#44814) Basic functional tests for Lens, by no means comprehensive. This is more of a smokescreen test of some normal use cases. * [lens] Add Lens to CODEOWNERS (#45296) * [lens] Fix visualization alias registration * [lens] Fix usage of EUI after typescript upgrade (#45404) * [lens] Fix usage of EUI after typescript upgrade * Use local fix instead of workaround * [lens] Fix usage of expressions plugin (#45544) * [lens] Fix usage of expressions plugin * Use updated exports from #45538 * Fix imports and mocha tests * Use relative instead of absolute path to fix tests * [lens] More cleanup from QueryBar changes in master (#45687) * [lens] Fix build and use new platform from entry points (#45834) * [lens] Fix build and use new platform from entry points * Fix params for existence route
2019-09-17 20:57:53 +02:00
rules: {
'@typescript-eslint/no-explicit-any': 'error',
},
},
/**
* disable jsx-a11y for kbn-ui-framework
*/
{
Migrate from tslint (#33826) * chore(NA): remove tslint dependencies, configs and enable eslint typescript parser. * fix(NA): apply recommend eslint typescript rule.s * chore(NA): upgrade eslint package versions. * chore(NA): split javascript eslint config in an override section. * chore(NA): split all eslint configs with overrides. * chore(NA): remove missing console.log. * chore(NA): change eslint splits and overrides order. * chore(NA): replace tslint disable comments with eslint ones. * chore(NA): solve eslint typescript errors for elastic/kibana-custom/no-default-export * chore(NA): fixed multiple eslint typescript rule failures. * chore(NA): add tarfet folder to the eslint ignore. * chore(NA): apply prettier rule to ts type file. * chore(NA): remove last mentions to tslint * chore(NA): add old defined rules * chore(NA): missing port rules website * chore(na): ordered rules * chore(NA): solved eslint typescript problems. * chore(NA): fix spaced comment problems. * chore(NA): fix some more eslint typescript rules: import/order no-empty-interface * chore(NA): fix last rules and comment out what are the ones still failing. * chore(NA): comment out camelcase rule. * chore(NA): regenerate kbn pm dist. * chore(NA): updated snapshots. * chore(NA): updated snapshots. * chore(NA): disabled sort-keys rule. * chore(NA): remove rule prefer-arrow/prefer-arrow-functions. * chore(NA): fix for @typescript-eslint/no-var-requires rule. * chore(NA): fixes for @typescript-eslint/camelcase rule. * chore(NA): fix typo on eslint config kibana typescript. Co-Authored-By: mistic <tiagoffcc@hotmail.com> * chore(NA): remove legacy note after the intellij upgrade to 2019.1 * fix(NA): import order plugin. * chore(NA): fix ts ignore positions after auto fix. * fix(NA): performance issue with typescript eslint. * refact(NA): eslint configs organization. * chore(NA): apply resticted paths to ts files too. * chore(NA): split comment from eslint ignore.
2019-04-05 18:45:23 +02:00
files: ['packages/kbn-ui-framework/**/*.js'],
rules: {
'jsx-a11y/click-events-have-key-events': 'off',
'jsx-a11y/anchor-has-content': 'off',
'jsx-a11y/tabindex-no-positive': 'off',
'jsx-a11y/label-has-associated-control': 'off',
'jsx-a11y/aria-role': 'off',
},
},
/**
* Canvas overrides
*/
{
files: ['x-pack/plugins/canvas/**/*.js'],
rules: {
radix: 'error',
// module importing
'import/order': [
'error',
{
groups: ['builtin', 'external', 'internal', 'parent', 'sibling', 'index'],
},
],
'import/extensions': ['error', 'never', { json: 'always', less: 'always', svg: 'always' }],
// react
'react/no-did-mount-set-state': 'error',
'react/no-did-update-set-state': 'error',
'react/no-multi-comp': ['error', { ignoreStateless: true }],
'react/self-closing-comp': 'error',
'react/sort-comp': 'error',
'react/jsx-boolean-value': 'error',
'react/no-unescaped-entities': ['error', { forbid: ['>', '}'] }],
'react/forbid-elements': [
'error',
{
forbid: [
{
element: 'EuiConfirmModal',
message: 'Use <ConfirmModal> instead',
},
{
element: 'EuiPopover',
message: 'Use <Popover> instead',
},
{
element: 'EuiIconTip',
message: 'Use <TooltipIcon> instead',
},
],
},
],
},
},
{
files: [
'x-pack/plugins/canvas/gulpfile.js',
'x-pack/plugins/canvas/scripts/*.js',
'x-pack/plugins/canvas/tasks/*.js',
'x-pack/plugins/canvas/tasks/**/*.js',
'x-pack/plugins/canvas/__tests__/**/*.js',
'x-pack/plugins/canvas/**/{__tests__,__test__,__jest__,__fixtures__,__mocks__}/**/*.js',
],
rules: {
'import/no-extraneous-dependencies': [
'error',
{
devDependencies: true,
peerDependencies: true,
},
],
},
},
{
files: ['x-pack/plugins/canvas/canvas_plugin_src/**/*.js'],
globals: { canvas: true, $: true },
rules: {
'import/no-unresolved': [
'error',
{
ignore: ['!!raw-loader.+.svg$'],
},
],
},
},
{
files: ['x-pack/plugins/canvas/public/**/*.js'],
env: {
browser: true,
},
},
{
files: ['x-pack/plugins/canvas/canvas_plugin_src/lib/flot-charts/**/*.js'],
env: {
jquery: true,
},
},
{
files: ['x-pack/plugins/monitoring/public/lib/jquery_flot/**/*.js'],
env: {
jquery: true,
},
},
/**
* TSVB overrides
*/
{
2020-04-07 09:24:21 +02:00
files: [
'src/plugins/vis_type_timeseries/**/*.{js,ts,tsx}',
'src/legacy/core_plugins/vis_type_timeseries/**/*.{js,ts,tsx}',
],
rules: {
'import/no-default-export': 'error',
},
},
/**
* Prettier disables all conflicting rules, listing as last override so it takes precedence
*/
{
files: ['**/*'],
rules: {
...require('eslint-config-prettier').rules,
...require('eslint-config-prettier/react').rules,
...require('eslint-config-prettier/@typescript-eslint').rules,
},
},
],
};