Skip to content

Commit

Permalink
[CI] Auto-commit changed files from 'node scripts/eslint --no-cache -…
Browse files Browse the repository at this point in the history
…-fix'
  • Loading branch information
kibanamachine committed Dec 4, 2024
1 parent 7560da9 commit 08ddf86
Show file tree
Hide file tree
Showing 74 changed files with 194 additions and 229 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ const babelTester = [
const invalid: RuleTester.InvalidTestCase[] = [
{
name: 'When a string literal is passed to i18n.translate, it should start with the correct i18n identifier, and if no existing defaultMessage is passed, it should add an empty default.',
filename: '/x-pack/solutions/observability/solutions/observability/plugins/observability_solution/observability/public/test_component.ts',
filename:
'/x-pack/solutions/observability/solutions/observability/plugins/observability_solution/observability/public/test_component.ts',
code: `
import { i18n } from '@kbn/i18n';
Expand All @@ -67,7 +68,8 @@ function TestComponent() {
},
{
name: 'When a string literal is passed to i18n.translate, and the root of the i18n identifier is not correct, it should keep the existing identifier but only update the right base app.',
filename: '/x-pack/solutions/observability/solutions/observability/plugins/observability_solution/observability/public/test_component.ts',
filename:
'/x-pack/solutions/observability/solutions/observability/plugins/observability_solution/observability/public/test_component.ts',
code: `
import { i18n } from '@kbn/i18n';
Expand All @@ -89,7 +91,8 @@ function TestComponent() {
},
{
name: 'When a string literal is passed to i18n.translate, and the root of the i18n identifier is not correct, it should keep the existing identifier but only update the right base app, and keep the default message if available.',
filename: '/x-pack/solutions/observability/solutions/observability/plugins/observability_solution/observability/public/test_component.ts',
filename:
'/x-pack/solutions/observability/solutions/observability/plugins/observability_solution/observability/public/test_component.ts',
code: `
import { i18n } from '@kbn/i18n';
Expand All @@ -111,7 +114,8 @@ function TestComponent() {
},
{
name: 'When no string literal is passed to i18n.translate, it should start with the correct i18n identifier.',
filename: '/x-pack/solutions/observability/solutions/observability/plugins/observability_solution/observability/public/test_component.ts',
filename:
'/x-pack/solutions/observability/solutions/observability/plugins/observability_solution/observability/public/test_component.ts',
code: `
import { i18n } from '@kbn/i18n';
Expand All @@ -133,7 +137,8 @@ function TestComponent() {
},
{
name: 'When i18n is not imported yet, the rule should add it.',
filename: '/x-pack/solutions/observability/solutions/observability/plugins/observability_solution/observability/public/test_component.ts',
filename:
'/x-pack/solutions/observability/solutions/observability/plugins/observability_solution/observability/public/test_component.ts',
code: `
function TestComponent() {
const foo = i18n.translate();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ const babelTester = [
const invalid: RuleTester.InvalidTestCase[] = [
{
name: 'A JSX element with a string literal should be translated with i18n',
filename: '/x-pack/solutions/observability/solutions/observability/plugins/observability_solution/observability/public/test_component.tsx',
filename:
'/x-pack/solutions/observability/solutions/observability/plugins/observability_solution/observability/public/test_component.tsx',
code: `
import React from 'react';
Expand Down Expand Up @@ -76,7 +77,8 @@ function TestComponent() {
},
{
name: 'A JSX element with a string literal that are inside an Eui component should take the component name of the parent into account',
filename: '/x-pack/solutions/observability/solutions/observability/plugins/observability_solution/observability/public/another_component.tsx',
filename:
'/x-pack/solutions/observability/solutions/observability/plugins/observability_solution/observability/public/another_component.tsx',
code: `
import React from 'react';
Expand Down Expand Up @@ -155,7 +157,8 @@ function YetAnotherComponent() {
},
{
name: 'Import lines without the necessary translation module should be updated to include i18n',
filename: '/x-pack/solutions/observability/solutions/observability/plugins/observability_solution/observability/public/test_component.tsx',
filename:
'/x-pack/solutions/observability/solutions/observability/plugins/observability_solution/observability/public/test_component.tsx',
code: `
import React from 'react';
import { SomeOtherModule } from '@kbn/i18n-react';
Expand Down Expand Up @@ -183,7 +186,8 @@ function TestComponent() {
},
{
name: 'JSX elements that have a label, aria-label or title prop with a string value should be translated with FormattedMessage',
filename: '/x-pack/solutions/observability/solutions/observability/plugins/observability_solution/observability/public/test_component.tsx',
filename:
'/x-pack/solutions/observability/solutions/observability/plugins/observability_solution/observability/public/test_component.tsx',
code: `
import React from 'react';
import { FormattedMessage } from '@kbn/i18n-react';
Expand Down Expand Up @@ -239,7 +243,8 @@ function TestComponent3() {
},
{
name: 'JSX elements that have a label, aria-label or title prop with a string value with quotes in it should be correctly translated with FormattedMessage',
filename: '/x-pack/solutions/observability/solutions/observability/plugins/observability_solution/observability/public/test_component.tsx',
filename:
'/x-pack/solutions/observability/solutions/observability/plugins/observability_solution/observability/public/test_component.tsx',
code: `
import React from 'react';
import { FormattedMessage } from '@kbn/i18n-react';
Expand Down Expand Up @@ -295,7 +300,8 @@ function TestComponent3() {
},
{
name: 'JSX elements that have a label, aria-label or title prop with a JSXExpression value that is a string should be translated with FormattedMessage',
filename: '/x-pack/solutions/observability/solutions/observability/plugins/observability_solution/observability/public/test_component.tsx',
filename:
'/x-pack/solutions/observability/solutions/observability/plugins/observability_solution/observability/public/test_component.tsx',
code: `
import React from 'react';
import { FormattedMessage } from '@kbn/i18n-react';
Expand Down Expand Up @@ -351,7 +357,8 @@ function TestComponent3() {
},
{
name: 'JSX elements that have a label, aria-label or title prop with a JSXExpression value that is a string with quotes in it should be correctly translated with FormattedMessage',
filename: '/x-pack/solutions/observability/solutions/observability/plugins/observability_solution/observability/public/test_component.tsx',
filename:
'/x-pack/solutions/observability/solutions/observability/plugins/observability_solution/observability/public/test_component.tsx',
code: `
import React from 'react';
import { FormattedMessage } from '@kbn/i18n-react';
Expand Down Expand Up @@ -410,7 +417,8 @@ function TestComponent3() {
const valid: RuleTester.ValidTestCase[] = [
{
name: 'A JSXText element inside a EuiCode component should not be translated',
filename: '/x-pack/solutions/observability/solutions/observability/plugins/observability_solution/observability/public/test_component.tsx',
filename:
'/x-pack/solutions/observability/solutions/observability/plugins/observability_solution/observability/public/test_component.tsx',
code: `
import React from 'react';
Expand All @@ -422,7 +430,8 @@ function TestComponent() {
},
{
name: 'A JSXText element that contains anything other than alpha characters should not be translated',
filename: '/x-pack/solutions/observability/solutions/observability/plugins/observability_solution/observability/public/test_component.tsx',
filename:
'/x-pack/solutions/observability/solutions/observability/plugins/observability_solution/observability/public/test_component.tsx',
code: `
import React from 'react';
Expand All @@ -434,7 +443,8 @@ function TestComponent() {
},
{
name: 'A JSXText element that is wrapped in three backticks (markdown) should not be translated',
filename: '/x-pack/solutions/observability/solutions/observability/plugins/observability_solution/observability/public/test_component.tsx',
filename:
'/x-pack/solutions/observability/solutions/observability/plugins/observability_solution/observability/public/test_component.tsx',
code: `
import React from 'react';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ const babelTester = [
const invalid: RuleTester.InvalidTestCase[] = [
{
name: 'A JSX element with a string literal should be translated with i18n',
filename: '/x-pack/solutions/observability/solutions/observability/plugins/observability_solution/observability/public/test_component.tsx',
filename:
'/x-pack/solutions/observability/solutions/observability/plugins/observability_solution/observability/public/test_component.tsx',
code: `
import React from 'react';
Expand All @@ -72,7 +73,8 @@ function TestComponent() {
},
{
name: 'A JSX element with a string literal that are inside an Eui component should take the component name of the parent into account',
filename: '/x-pack/solutions/observability/solutions/observability/plugins/observability_solution/observability/public/another_component.tsx',
filename:
'/x-pack/solutions/observability/solutions/observability/plugins/observability_solution/observability/public/another_component.tsx',
code: `
import React from 'react';
Expand Down Expand Up @@ -143,7 +145,8 @@ function YetAnotherComponent() {
},
{
name: 'Import lines without the necessary translation module should be updated to include i18n',
filename: '/x-pack/solutions/observability/solutions/observability/plugins/observability_solution/observability/public/test_component.tsx',
filename:
'/x-pack/solutions/observability/solutions/observability/plugins/observability_solution/observability/public/test_component.tsx',
code: `
import React from 'react';
import { SomeOtherModule } from '@kbn/i18n';
Expand Down Expand Up @@ -171,7 +174,8 @@ function TestComponent() {
},
{
name: 'JSX elements that have a label, aria-label or title prop with a string value should be translated with i18n',
filename: '/x-pack/solutions/observability/solutions/observability/plugins/observability_solution/observability/public/test_component.tsx',
filename:
'/x-pack/solutions/observability/solutions/observability/plugins/observability_solution/observability/public/test_component.tsx',
code: `
import React from 'react';
import { i18n } from '@kbn/i18n';
Expand Down Expand Up @@ -227,7 +231,8 @@ function TestComponent3() {
},
{
name: 'JSX elements that have a label, aria-label or title prop with a string value with quotes should be correctly translated with i18n',
filename: '/x-pack/solutions/observability/solutions/observability/plugins/observability_solution/observability/public/test_component.tsx',
filename:
'/x-pack/solutions/observability/solutions/observability/plugins/observability_solution/observability/public/test_component.tsx',
code: `
import React from 'react';
import { i18n } from '@kbn/i18n';
Expand Down Expand Up @@ -283,7 +288,8 @@ function TestComponent3() {
},
{
name: 'JSX elements that have a label, aria-label or title prop with a JSXExpression value that is a string should be translated with i18n',
filename: '/x-pack/solutions/observability/solutions/observability/plugins/observability_solution/observability/public/test_component.tsx',
filename:
'/x-pack/solutions/observability/solutions/observability/plugins/observability_solution/observability/public/test_component.tsx',
code: `
import React from 'react';
import { i18n } from '@kbn/i18n';
Expand Down Expand Up @@ -339,7 +345,8 @@ function TestComponent3() {
},
{
name: 'JSX elements that have a label, aria-label or title prop with a JSXExpression value that is a string with quotes in it should be correctly translated with i18n',
filename: '/x-pack/solutions/observability/solutions/observability/plugins/observability_solution/observability/public/test_component.tsx',
filename:
'/x-pack/solutions/observability/solutions/observability/plugins/observability_solution/observability/public/test_component.tsx',
code: `
import React from 'react';
import { i18n } from '@kbn/i18n';
Expand Down Expand Up @@ -398,7 +405,8 @@ function TestComponent3() {
const valid: RuleTester.ValidTestCase[] = [
{
name: 'A JSXText element inside a EuiCode component should not be translated',
filename: '/x-pack/solutions/observability/solutions/observability/plugins/observability_solution/observability/public/test_component.tsx',
filename:
'/x-pack/solutions/observability/solutions/observability/plugins/observability_solution/observability/public/test_component.tsx',
code: `
import React from 'react';
Expand All @@ -410,7 +418,8 @@ function TestComponent() {
},
{
name: 'A JSXText element that contains anything other than alpha characters should not be translated',
filename: '/x-pack/solutions/observability/solutions/observability/plugins/observability_solution/observability/public/test_component.tsx',
filename:
'/x-pack/solutions/observability/solutions/observability/plugins/observability_solution/observability/public/test_component.tsx',
code: `
import React from 'react';
Expand All @@ -422,7 +431,8 @@ function TestComponent() {
},
{
name: 'A JSXText element that is wrapped in three backticks (markdown) should not be translated',
filename: '/x-pack/solutions/observability/solutions/observability/plugins/observability_solution/observability/public/test_component.tsx',
filename:
'/x-pack/solutions/observability/solutions/observability/plugins/observability_solution/observability/public/test_component.tsx',
code: `
import React from 'react';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ import { getAppName } from './get_app_name';
const SYSTEMPATH = 'systemPath';

const testMap = [
['x-pack/solutions/observability/solutions/observability/plugins/observability_solution/observability/foo/bar/baz/header_actions.tsx', 'o11y'],
[
'x-pack/solutions/observability/solutions/observability/plugins/observability_solution/observability/foo/bar/baz/header_actions.tsx',
'o11y',
],
['x-pack/plugins/observability_solution/apm/baz/header_actions.tsx', 'apm'],
['x-pack/plugins/apm/public/components/app/correlations/correlations_table.tsx', 'apm'],
['x-pack/plugins/observability/foo/bar/baz/header_actions.tsx', 'o11y'],
Expand Down
9 changes: 6 additions & 3 deletions src/dev/storybook/aliases.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,19 +46,22 @@ export const storybookAliases = {
home: 'src/plugins/home/.storybook',
infra: 'x-pack/plugins/observability_solution/infra/.storybook',
inventory: 'x-pack/plugins/observability_solution/inventory/.storybook',
investigate: 'x-pack/solutions/observability/solutions/observability/plugins/observability_solution/investigate_app/.storybook',
investigate:
'x-pack/solutions/observability/solutions/observability/plugins/observability_solution/investigate_app/.storybook',
kibana_react: 'src/plugins/kibana_react/.storybook',
lists: 'x-pack/plugins/lists/.storybook',
logs_explorer: 'x-pack/plugins/observability_solution/logs_explorer/.storybook',
management: 'packages/kbn-management/storybook/config',
observability: 'x-pack/solutions/observability/solutions/observability/plugins/observability_solution/observability/.storybook',
observability:
'x-pack/solutions/observability/solutions/observability/plugins/observability_solution/observability/.storybook',
observability_ai_assistant:
'x-pack/plugins/observability_solution/observability_ai_assistant/.storybook',
observability_ai_assistant_app:
'x-pack/plugins/observability_solution/observability_ai_assistant_app/.storybook',
observability_inventory: 'x-pack/plugins/observability_solution/inventory/.storybook',
observability_shared: 'x-pack/plugins/observability_solution/observability_shared/.storybook',
observability_slo: 'x-pack/solutions/observability/solutions/observability/plugins/observability_solution/slo/.storybook',
observability_slo:
'x-pack/solutions/observability/solutions/observability/plugins/observability_solution/slo/.storybook',
presentation: 'src/plugins/presentation_util/storybook',
random_sampling: 'x-pack/packages/kbn-random-sampling/.storybook',
esql_editor: 'packages/kbn-esql-editor/.storybook',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the "Elastic License
* 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side
* Public License v 1"; you may not use this file except in compliance with, at
* your election, the "Elastic License 2.0", the "GNU Affero General Public
* License v3.0 only", or the "Server Side Public License, v 1".
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/

export * from './src';
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the "Elastic License
* 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side
* Public License v 1"; you may not use this file except in compliance with, at
* your election, the "Elastic License 2.0", the "GNU Affero General Public
* License v3.0 only", or the "Server Side Public License, v 1".
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/

module.exports = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the "Elastic License
* 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side
* Public License v 1"; you may not use this file except in compliance with, at
* your election, the "Elastic License 2.0", the "GNU Affero General Public
* License v3.0 only", or the "Server Side Public License, v 1".
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/

export * from './rest_specs';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the "Elastic License
* 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side
* Public License v 1"; you may not use this file except in compliance with, at
* your election, the "Elastic License 2.0", the "GNU Affero General Public
* License v3.0 only", or the "Server Side Public License, v 1".
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/

import { z } from '@kbn/zod';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the "Elastic License
* 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side
* Public License v 1"; you may not use this file except in compliance with, at
* your election, the "Elastic License 2.0", the "GNU Affero General Public
* License v3.0 only", or the "Server Side Public License, v 1".
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/

import { z } from '@kbn/zod';
Expand Down
Loading

0 comments on commit 08ddf86

Please sign in to comment.