Skip to content

Commit

Permalink
Migrate to ESLint 9 (#10762)
Browse files Browse the repository at this point in the history
* update ESLint related packages

* migrate to flat config format

* Fix prefer-const error

Fixes
'overrideLogoSize' is never reassigned. Use 'const' instead

* remove irrelevant eslint-disable comment

These comments came from a swizzled upstream
component but never did anything in our codebase.

ESLint 9 does not allow disable comments
for rules that are not registered.

* remove irrelevant eslint-disable comments

These were here because in the past we were applying
mocha lint rules to files which contained no tests

ESLint 9 now flags eslint-disable comments
that aren't doing anythings

* remove irrelevant eslint-disable comment

ESLint 9 now flags eslint-disable comments
that aren't doing anything

* there are no .tsx files in our code any more

* include .mjs files in linting and formatting

* update sort-class-members rule for openApi property

and update the handful of files violating it
  • Loading branch information
chris48s authored Dec 31, 2024
1 parent 7108e08 commit c567f6c
Show file tree
Hide file tree
Showing 15 changed files with 1,510 additions and 771 deletions.
7 changes: 0 additions & 7 deletions .eslintignore

This file was deleted.

189 changes: 0 additions & 189 deletions .eslintrc.yml

This file was deleted.

2 changes: 1 addition & 1 deletion core/base-service/coalesce-badge.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,13 @@ export default function coalesceBadge(
label: overrideLabel,
logo: overrideLogo,
logoColor: overrideLogoColor,
logoSize: overrideLogoSize,
link: overrideLink,
colorB: legacyOverrideColor,
colorA: legacyOverrideLabelColor,
} = overrides
let {
logoWidth: overrideLogoWidth,
logoSize: overrideLogoSize,
color: overrideColor,
labelColor: overrideLabelColor,
} = overrides
Expand Down
2 changes: 0 additions & 2 deletions core/base-service/legacy-request-handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@ function handleRequest(cacheHeaderConfig, handlerOptions) {
const result = handlerOptions.handler(
filteredQueryParams,
match,
// eslint-disable-next-line mocha/prefer-arrow-callback
function sendBadge(format, badgeData) {
if (serverUnresponsive) {
return
Expand All @@ -128,7 +127,6 @@ function handleRequest(cacheHeaderConfig, handlerOptions) {
makeSend(format, ask.res, end)(svg)
},
)
// eslint-disable-next-line promise/prefer-await-to-then
if (result && result.catch) {
// eslint-disable-next-line promise/prefer-await-to-then
result.catch(err => {
Expand Down
2 changes: 1 addition & 1 deletion core/service-test-runner/service-tester.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ class ServiceTester {
.before(() => {
this.beforeEach()
})
// eslint-disable-next-line mocha/prefer-arrow-callback, promise/prefer-await-to-then
// eslint-disable-next-line promise/prefer-await-to-then
.finally(function () {
// `this` is the IcedFrisby instance.
let responseBody
Expand Down
Loading

0 comments on commit c567f6c

Please sign in to comment.