Skip to content

Commit

Permalink
chore: fix eslint errors and warnings (#1079)
Browse files Browse the repository at this point in the history
Fixes all the lint errors and warnings in preparation for #1078

No QA needed
  • Loading branch information
straker authored Jun 4, 2024
1 parent bf7bbf9 commit 2c713b5
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 9 deletions.
15 changes: 12 additions & 3 deletions eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ module.exports = [
'@typescript-eslint/ban-types': 'off',
'@typescript-eslint/no-unused-vars': 'error',
'@typescript-eslint/no-explicit-any': 'error',
'@typescript-eslint/no-non-null-assertion': 'error'
'@typescript-eslint/no-non-null-assertion': 'error',
'@typescript-eslint/no-require-imports': 'off'
}
},
{
Expand All @@ -54,11 +55,19 @@ module.exports = [
}
},
{
files: ['**/*.test.ts', '**/*.test.tsx', '**/*.spec.ts', '**/*.spec.tsx'],
files: [
'**/*.test.ts',
'**/*.test.tsx',
'**/*.spec.ts',
'**/*.spec.tsx',
'**/test/**',
'**/tests/**'
],
rules: {
'@typescript-eslint/no-empty-function': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-non-null-assertion': 'off'
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/no-unused-expressions': 'off'
}
},
{
Expand Down
1 change: 0 additions & 1 deletion packages/playwright/src/AxePartialRunner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,4 @@ export default class AxePartialRunner {
// See: https://stackoverflow.com/questions/40920179/should-i-refrain-from-handling-promise-rejection-asynchronously
export const caught = ((f: () => void) => {
return <T>(p: Promise<T>): Promise<T> => (p.catch(f), p);
/* eslint-disable @typescript-eslint/no-empty-function */
})(() => {});
1 change: 0 additions & 1 deletion packages/puppeteer/src/axePartialRunner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,4 @@ export class AxePartialRunner {
// See: https://stackoverflow.com/questions/40920179/should-i-refrain-from-handling-promise-rejection-asynchronously
export const caught = ((f: () => void) => {
return <T>(p: Promise<T>): Promise<T> => (p.catch(f), p);
/* eslint-disable @typescript-eslint/no-empty-function */
})(() => {});
1 change: 0 additions & 1 deletion packages/react/test/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ reactAxe(React, ReactDOM, 1000, {
checks: [
{
id: 'my-check',
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type, @typescript-eslint/no-empty-function
evaluate() {}
}
],
Expand Down
2 changes: 0 additions & 2 deletions packages/webdriverio/test/axe-webdriverio.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ import { fixturesPath } from 'axe-test-fixtures';
const connectToChromeDriver = (port: number): Promise<void> => {
let socket: net.Socket;
return new Promise((resolve, reject) => {
// eslint-disable-next-line prefer-const

// Give up after 1s
const timer = setTimeout(() => {
socket.destroy();
Expand Down
1 change: 0 additions & 1 deletion packages/webdriverjs/src/axe-injector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ export default class AxeInjectorLegacy {
// does not return a "real promise" (ManagedPromise)
// and we want to await it.
return new Promise((resolve, reject) => {
/* eslint-disable no-undef */
this.driver
// https://github.com/vercel/pkg/issues/676
// we need to pass a string vs a function so we manually stringified the function
Expand Down

0 comments on commit 2c713b5

Please sign in to comment.