Skip to content

Commit c28f4ed

Browse files
authored
chore: add baseline-js eslint plugin for browser packages (#3220)
1 parent 83e406a commit c28f4ed

File tree

5 files changed

+76
-2
lines changed

5 files changed

+76
-2
lines changed

eslint.config.mjs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import tseslint from 'typescript-eslint';
1919
import globals from 'globals';
2020
import nodePlugin from 'eslint-plugin-n';
2121
import yalhPlugin from 'eslint-plugin-yet-another-license-header';
22+
import baselinePlugin from 'eslint-plugin-baseline-js';
2223

2324
const defaultLicense = `
2425
/*
@@ -201,11 +202,20 @@ const baseConfig = tseslint.config(
201202
files: [
202203
'**/examples/web/**/*',
203204
'**/packages/**/browser/**/*',
204-
'**/packages/instrumentation-user-interaction/**/*',
205+
'**/packages/auto-instrumentations-web/**/*',
205206
'**/packages/instrumentation-document-load/**/*',
206207
'**/packages/instrumentation-long-task/**/*',
208+
'**/packages/instrumentation-user-interaction/**/*',
209+
'**/packages/instrumentation-web-exception/**/*',
207210
'**/packages/plugin-react-load/**/*',
208211
],
212+
plugins: { 'baseline-js': baselinePlugin },
213+
extends: [
214+
baselinePlugin.configs['recommended-ts']({
215+
available: 'widely',
216+
level: 'error',
217+
}),
218+
],
209219
languageOptions: {
210220
globals: {
211221
...globals.browser,

package-lock.json

Lines changed: 58 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@
5959
"babel-plugin-istanbul": "7.0.1",
6060
"cross-env": "10.1.0",
6161
"eslint": "9.34.0",
62+
"eslint-plugin-baseline-js": "0.4.0",
6263
"eslint-plugin-import": "2.32.0",
6364
"eslint-plugin-n": "17.21.3",
6465
"eslint-plugin-yet-another-license-header": "0.2.0",

packages/instrumentation-long-task/src/instrumentation.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16+
17+
// PerformanceLongTaskTiming is experimental and may change in future versions.
18+
// https://developer.mozilla.org/en-US/docs/Web/API/PerformanceLongTaskTiming
19+
/* eslint-disable baseline-js/use-baseline */
20+
1621
import { hrTime } from '@opentelemetry/core';
1722
import { diag } from '@opentelemetry/api';
1823
import { InstrumentationBase } from '@opentelemetry/instrumentation';

packages/instrumentation-long-task/test/util.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
import * as tracing from '@opentelemetry/sdk-trace-base';
1717

1818
export class DummySpanExporter implements tracing.SpanExporter {
19-
export(spans: tracing.ReadableSpan[]) {}
19+
export(_spans: tracing.ReadableSpan[]) {}
2020

2121
shutdown() {
2222
return Promise.resolve();

0 commit comments

Comments
 (0)