Skip to content

Commit

Permalink
Make sure ESLint that should only work on TSX are set to only trigger…
Browse files Browse the repository at this point in the history
… on TSX files (#169361)

## Summary

This makes the newly created i18n ESLint rule actually activate on
paths, and narrows the use of the Telemetry ESLint rule to only activate
on .tsx files. This is done because the rule only makes sense in the
context of JSX.

## More words

Noticed that this:

```
        'x-pack/plugins/aiops/**/*.{tsx}',
        'x-pack/plugins/apm/**/*.{tsx}',
        'x-pack/plugins/exploratory_view/**/*.{tsx}',
```

does not work. 

This:

```
        'x-pack/plugins/aiops/**/*.tsx',
        'x-pack/plugins/apm/**/*.tsx',
        'x-pack/plugins/exploratory_view/**/*.tsx',
```

does.
  • Loading branch information
CoenWarmer authored Oct 19, 2023
1 parent f931fd8 commit 7676cc4
Showing 1 changed file with 22 additions and 22 deletions.
44 changes: 22 additions & 22 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -910,35 +910,35 @@ module.exports = {
},
{
files: [
'x-pack/plugins/aiops/**/*.{js,mjs,ts,tsx}',
'x-pack/plugins/apm/**/*.{js,mjs,ts,tsx}',
'x-pack/plugins/exploratory_view/**/*.{js,mjs,ts,tsx}',
'x-pack/plugins/infra/**/*.{js,mjs,ts,tsx}',
'x-pack/plugins/observability/**/*.{js,mjs,ts,tsx}',
'x-pack/plugins/observability_ai_assistant/**/*.{js,mjs,ts,tsx}',
'x-pack/plugins/observability_onboarding/**/*.{js,mjs,ts,tsx}',
'x-pack/plugins/observability_shared/**/*.{js,mjs,ts,tsx}',
'x-pack/plugins/profiling/**/*.{js,mjs,ts,tsx}',
'x-pack/plugins/synthetics/**/*.{js,mjs,ts,tsx}',
'x-pack/plugins/ux/**/*.{js,mjs,ts,tsx}',
'x-pack/plugins/aiops/**/*.tsx',
'x-pack/plugins/apm/**/*.tsx',
'x-pack/plugins/exploratory_view/**/*.tsx',
'x-pack/plugins/infra/**/*.tsx',
'x-pack/plugins/observability/**/*.tsx',
'x-pack/plugins/observability_ai_assistant/**/*.tsx',
'x-pack/plugins/observability_onboarding/**/*.tsx',
'x-pack/plugins/observability_shared/**/*.tsx',
'x-pack/plugins/profiling/**/*.tsx',
'x-pack/plugins/synthetics/**/*.tsx',
'x-pack/plugins/ux/**/*.tsx',
],
rules: {
'@kbn/telemetry/event_generating_elements_should_be_instrumented': 'error',
},
},
{
files: [
'x-pack/plugins/aiops/**/*.{tsx}',
'x-pack/plugins/apm/**/*.{tsx}',
'x-pack/plugins/exploratory_view/**/*.{tsx}',
'x-pack/plugins/infra/**/*.{tsx}',
'x-pack/plugins/observability/**/*.{tsx}',
'x-pack/plugins/observability_ai_assistant/**/*.{tsx}',
'x-pack/plugins/observability_onboarding/**/*.{tsx}',
'x-pack/plugins/observability_shared/**/*.{tsx}',
'x-pack/plugins/profiling/**/*.{tsx}',
'x-pack/plugins/synthetics/**/*.{tsx}',
'x-pack/plugins/ux/**/*.{tsx}',
'x-pack/plugins/aiops/**/*.tsx',
'x-pack/plugins/apm/**/*.tsx',
'x-pack/plugins/exploratory_view/**/*.tsx',
'x-pack/plugins/infra/**/*.tsx',
'x-pack/plugins/observability/**/*.tsx',
'x-pack/plugins/observability_ai_assistant/**/*.tsx',
'x-pack/plugins/observability_onboarding/**/*.tsx',
'x-pack/plugins/observability_shared/**/*.tsx',
'x-pack/plugins/profiling/**/*.tsx',
'x-pack/plugins/synthetics/**/*.tsx',
'x-pack/plugins/ux/**/*.tsx',
],
rules: {
'@kbn/i18n/strings_should_be_translated_with_i18n': 'warn',
Expand Down

0 comments on commit 7676cc4

Please sign in to comment.