-
Notifications
You must be signed in to change notification settings - Fork 11
chore(lint): add eslint header and baseline rules #88
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore(lint): add eslint header and baseline rules #88
Conversation
| parser: tseslint.parser, | ||
| }, | ||
| plugins: { | ||
| 'baseline-js': baselinePlugin, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this effectively duplicating biome linting? I understand they aren't identical.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, it's not. This is only running the baseline plugin and the header plugin which are not available in the biome plugin format. Both features are essential so while running biome and eslint is not ideal, it's still a major speed up from running eslint recommended rules on its own.
eslint.config.js
Outdated
| `; | ||
|
|
||
| const licensePattern = | ||
| /^\/\*\n \* Copyright The OpenTelemetry Authors\n \* SPDX-License-Identifier: Apache-2\.0\n \*\/$/; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This won't allow for extra copyright assignments. See, for example, https://github.com/open-telemetry/opentelemetry-js-contrib/blob/main/packages/instrumentation-oracledb/src/instrumentation.ts
Currently nothing in this repo requires a separate copyright assignment, so this works for now.
Could perhaps do this:
| /^\/\*\n \* Copyright The OpenTelemetry Authors\n \* SPDX-License-Identifier: Apache-2\.0\n \*\/$/; | |
| /^\/\*\n \* Copyright The OpenTelemetry Authors(?:, [^\n]+)*\n \* SPDX-License-Identifier: Apache-2\.0\n \*\/$/; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That was an oversight. I just fixed so it matches contrib to allow for comma-delimited vendors on the same line as OTel, as well as on the next line, with an optional line break after
What problem is this solving?
Adds ESLint rules for browser compatibility checking (baseline) and license header enforcement to ensure code quality and compliance.
Short description of changes
eslint-plugin-baseline-jsfor browser compatibility lintingeslint-plugin-yet-another-license-header, thanks @trentm!packages/*/src/**/*.{js,ts,mjs}filesTesting
npm run lintpasses