Skip to content

Commit d5125c3

Browse files
committed
refactor: fix lint
1 parent 481b536 commit d5125c3

File tree

4 files changed

+15
-11
lines changed

4 files changed

+15
-11
lines changed

packages/nx-plugin/eslint.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
const tseslint = require('typescript-eslint');
22
const baseConfig = require('../../eslint.config.js').default;
33

4+
// eslint-disable-next-line unicorn/prefer-top-level-await, arrow-body-style
45
module.exports = (async () => {
56
return tseslint.config(
67
...(await (typeof baseConfig === 'function' ? baseConfig() : baseConfig)),

packages/plugin-axe/src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// eslint-disable-next-line import/no-unassigned-import
12
import './lib/_polyfills.dom.js';
23
import { axePlugin } from './lib/axe-plugin.js';
34

packages/plugin-axe/src/lib/_polyfills.dom.ts

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// Polyfills for axe-core DOM access in Node.js environment
22
// This must be imported before any axe-core imports
33

4+
/* eslint-disable functional/immutable-data, @typescript-eslint/no-explicit-any, unicorn/prefer-global-this, n/no-unsupported-features/node-builtins, unicorn/no-typeof-undefined, @typescript-eslint/no-empty-function */
45
if (typeof global.window === 'undefined') {
56
const mockElement = {
67
style: {},
@@ -25,15 +26,15 @@ if (typeof global.window === 'undefined') {
2526

2627
// Mock document
2728
const mockDocument = {
28-
createElement: tagName => ({
29+
createElement: (tagName: string) => ({
2930
...mockElement,
3031
tagName: tagName.toUpperCase(),
3132
}),
32-
createElementNS: (ns, tagName) => ({
33+
createElementNS: (_ns: string, tagName: string) => ({
3334
...mockElement,
3435
tagName: tagName.toUpperCase(),
3536
}),
36-
createTextNode: text => ({ ...mockElement, textContent: text }),
37+
createTextNode: (text: string) => ({ ...mockElement, textContent: text }),
3738
body: { ...mockElement, tagName: 'BODY' },
3839
documentElement: { ...mockElement, tagName: 'HTML' },
3940
head: { ...mockElement, tagName: 'HEAD' },
@@ -52,30 +53,30 @@ if (typeof global.window === 'undefined') {
5253
};
5354

5455
// Set up global objects
55-
global.window = global;
56-
global.document = mockDocument;
56+
(global as any).window = global;
57+
(global as any).document = mockDocument;
5758

5859
// Only set navigator if it doesn't exist or isn't read-only
5960
try {
6061
if (typeof global.navigator === 'undefined') {
61-
global.navigator = {
62+
(global as any).navigator = {
6263
userAgent: 'Node.js',
6364
platform: 'Node.js',
6465
appVersion: 'Node.js',
6566
};
6667
}
67-
} catch (e) {
68+
} catch {
6869
// navigator is read-only, skip setting it
6970
}
7071

7172
// Also set on globalThis for consistency
72-
globalThis.window = global.window;
73-
globalThis.document = global.document;
73+
(globalThis as any).window = (global as any).window;
74+
(globalThis as any).document = (global as any).document;
7475
try {
7576
if (typeof globalThis.navigator === 'undefined') {
76-
globalThis.navigator = global.navigator;
77+
(globalThis as any).navigator = (global as any).navigator;
7778
}
78-
} catch (e) {
79+
} catch {
7980
// navigator is read-only, skip setting it
8081
}
8182
}

tools/zod2md-jsdocs/eslint.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
const baseConfig = require('../../eslint.config.js').default;
22

3+
// eslint-disable-next-line unicorn/prefer-top-level-await, arrow-body-style
34
module.exports = (async () => {
45
return [
56
...(await (typeof baseConfig === 'function' ? baseConfig() : baseConfig)),

0 commit comments

Comments
 (0)