sindresorhus / eslint-plugin-unicorn

@@ -218,7 +218,7 @@
Loading
218 218
	const filename = context.getFilename().toLowerCase();
219 219
220 220
	if (filename.endsWith('.cjs')) {
221 -
		return {};
221 +
		return;
222 222
	}
223 223
224 224
	const sourceCode = context.getSourceCode();

@@ -147,7 +147,7 @@
Loading
147 147
	const filenameWithExtension = context.getPhysicalFilename();
148 148
149 149
	if (filenameWithExtension === '<input>' || filenameWithExtension === '<text>') {
150 -
		return {};
150 +
		return;
151 151
	}
152 152
153 153
	return {

@@ -70,7 +70,7 @@
Loading
70 70
	const replacements = getReplacements(patterns);
71 71
72 72
	if (replacements.length === 0) {
73 -
		return {};
73 +
		return;
74 74
	}
75 75
76 76
	return {

@@ -71,10 +71,18 @@
Loading
71 71
		return create;
72 72
	}
73 73
74 -
	const wrapped = context => Object.fromEntries(
75 -
		Object.entries(create(context))
76 -
			.map(([selector, listener]) => [selector, reportListenerProblems(listener, context)]),
77 -
	);
74 +
	const wrapped = context => {
75 +
		const listeners = create(context);
76 +
77 +
		if (!listeners) {
78 +
			return {};
79 +
		}
80 +
81 +
		return Object.fromEntries(
82 +
			Object.entries(listeners)
83 +
				.map(([selector, listener]) => [selector, reportListenerProblems(listener, context)]),
84 +
		);
85 +
	};
78 86
79 87
	wrappedFunctions.add(wrapped);
80 88

@@ -20,7 +20,7 @@
Loading
20 20
	const filename = context.getPhysicalFilename().toLowerCase();
21 21
22 22
	if (!/\.(?:js|mjs|cjs|ts|mts|cts)$/.test(filename)) {
23 -
		return {};
23 +
		return;
24 24
	}
25 25
26 26
	return {
Files Coverage
configs 100.00%
rules 99.87%
scripts 73.33%
index.js 100.00%
Project Totals (203 files) 99.70%
1
coverage:
2
  status:
3
    project:
4
      default:
5
        target: 99%
6
        threshold: 1%
Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading