Skip to content

Commit

Permalink
Merge branch '7.x' into backport/7.x/pr-90978
Browse files Browse the repository at this point in the history
  • Loading branch information
kibanamachine authored Mar 17, 2021
2 parents 5234431 + 8781e4c commit 241d44b
Show file tree
Hide file tree
Showing 679 changed files with 14,190 additions and 10,302 deletions.
117 changes: 56 additions & 61 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -832,48 +832,12 @@ module.exports = {
// typescript only for front and back end
files: ['x-pack/plugins/security_solution/**/*.{ts,tsx}'],
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',
'@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
// files: ['x-pack/plugins/security_solution/public/**/!(*.test).{js,mjs,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',
// },
// },
{
// typescript and javascript for front and back end
files: ['x-pack/plugins/security_solution/**/*.{js,mjs,ts,tsx}'],
Expand All @@ -886,21 +850,6 @@ module.exports = {
'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',
},
],
*/
'node/no-deprecated-api': 'error',
'no-bitwise': 'error',
'no-continue': 'error',
Expand Down Expand Up @@ -940,12 +889,8 @@ module.exports = {
'no-useless-catch': 'error',
'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',
// 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',
Expand All @@ -961,9 +906,6 @@ module.exports = {
'react/no-danger-with-children': 'error',
'react/no-deprecated': 'error',
'react/no-did-mount-set-state': 'error',
// Re-enable once we have better options per this issue:
// https://github.com/airbnb/javascript/issues/1875
// 'react/no-did-update-set-state': 'error',
'react/no-direct-mutation-state': 'error',
'react/no-find-dom-node': 'error',
'react/no-redundant-should-component-update': 'error',
Expand All @@ -975,8 +917,6 @@ module.exports = {
'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',
'react/jsx-no-literals': 'error',
Expand Down Expand Up @@ -1010,7 +950,62 @@ module.exports = {
},
},
{
// typescript and javascript for front and back end
// typescript for /public and /common
files: ['x-pack/plugins/lists/public/*.{ts,tsx}', 'x-pack/plugins/lists/common/*.{ts,tsx}'],
rules: {
'@typescript-eslint/no-for-in-array': 'error',
},
},
{
// typescript for /public and /common
files: ['x-pack/plugins/lists/public/*.{ts,tsx}', 'x-pack/plugins/lists/common/*.{ts,tsx}'],
plugins: ['react'],
env: {
jest: true,
},
rules: {
'react/boolean-prop-naming': 'error',
'react/button-has-type': 'error',
'react/display-name': 'error',
'react/forbid-dom-props': 'error',
'react/no-access-state-in-setstate': 'error',
'react/no-children-prop': 'error',
'react/no-danger-with-children': 'error',
'react/no-deprecated': 'error',
'react/no-did-mount-set-state': 'error',
'react/no-did-update-set-state': 'error',
'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',
'react/no-unescaped-entities': 'error',
'react/no-unsafe': 'error',
'react/no-unused-prop-types': 'error',
'react/no-unused-state': 'error',
'react/sort-comp': 'error',
'react/void-dom-elements-no-children': 'error',
'react/jsx-no-comment-textnodes': 'error',
'react/jsx-no-literals': 'error',
'react/jsx-no-target-blank': 'error',
'react/jsx-fragments': 'error',
'react/jsx-sort-default-props': 'error',
},
},
{
files: ['x-pack/plugins/lists/public/**/!(*.test).{js,mjs,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',
},
},
{
// typescript and javascript for front and back
files: ['x-pack/plugins/lists/**/*.{js,mjs,ts,tsx}'],
plugins: ['eslint-plugin-node'],
env: {
Expand Down
6 changes: 3 additions & 3 deletions WORKSPACE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
# Fetch Node.js rules
http_archive(
name = "build_bazel_rules_nodejs",
sha256 = "bfacf15161d96a6a39510e7b3d3b522cf61cb8b82a31e79400a84c5abcab5347",
urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/3.2.1/rules_nodejs-3.2.1.tar.gz"],
sha256 = "55a25a762fcf9c9b88ab54436581e671bc9f4f523cb5a1bd32459ebec7be68a8",
urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/3.2.2/rules_nodejs-3.2.2.tar.gz"],
)

# Now that we have the rules let's import from them to complete the work
load("@build_bazel_rules_nodejs//:index.bzl", "check_rules_nodejs_version", "node_repositories", "yarn_install")

# Assure we have at least a given rules_nodejs version
check_rules_nodejs_version(minimum_version_string = "3.2.1")
check_rules_nodejs_version(minimum_version_string = "3.2.2")

# Setup the Node.js toolchain for the architectures we want to support
#
Expand Down
8 changes: 4 additions & 4 deletions api_docs/charts.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,26 +9,26 @@
"children": [
{
"type": "Object",
"label": "{ onChange, color: selectedColor, id, label }",
"label": "{\n onChange,\n color: selectedColor,\n label,\n useLegacyColors = true,\n colorIsOverwritten = true,\n}",
"isRequired": true,
"signature": [
"ColorPickerProps"
],
"description": [],
"source": {
"path": "src/plugins/charts/public/static/components/color_picker.tsx",
"lineNumber": 83
"lineNumber": 108
}
}
],
"signature": [
"({ onChange, color: selectedColor, id, label }: ColorPickerProps) => JSX.Element"
"({ onChange, color: selectedColor, label, useLegacyColors, colorIsOverwritten, }: ColorPickerProps) => JSX.Element"
],
"description": [],
"label": "ColorPicker",
"source": {
"path": "src/plugins/charts/public/static/components/color_picker.tsx",
"lineNumber": 83
"lineNumber": 108
},
"tags": [],
"returnComment": [],
Expand Down
Loading

0 comments on commit 241d44b

Please sign in to comment.