Skip to content

Commit f1cf13c

Browse files
committed
fix: enforce curly braces and remove deprecated eslint-env comments
Remove curly: off override from eslint config now that code complies with the curly rule from eslint-config-helix 3.0.24. Remove redundant eslint-env comments (globals configured by helix test preset).
1 parent 385e654 commit f1cf13c

File tree

19 files changed

+15
-39
lines changed

19 files changed

+15
-39
lines changed

src/agents/brand-profile/services/product-extractor.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,9 @@ const EXCLUDE_PATTERNS = [
7676
* @returns {number|null} Year as integer, or null
7777
*/
7878
function extractYear(dateString) {
79-
if (!dateString) return null;
79+
if (!dateString) {
80+
return null;
81+
}
8082
try {
8183
if (dateString.includes('T')) {
8284
return parseInt(dateString.split('-')[0], 10);
@@ -94,7 +96,9 @@ function extractYear(dateString) {
9496
* @returns {string} Cleaned category string
9597
*/
9698
function cleanCategory(typeLabel) {
97-
if (!typeLabel) return '';
99+
if (!typeLabel) {
100+
return '';
101+
}
98102
const clean = typeLabel.replace(/_/g, ' ');
99103
return clean.charAt(0).toUpperCase() + clean.slice(1).toLowerCase();
100104
}
@@ -219,7 +223,9 @@ async function queryWikidataProducts(wikidataId, log) {
219223
* @returns {object[]} Normalized items
220224
*/
221225
function normalizeItems(items, status = 'current') {
222-
if (!Array.isArray(items)) return [];
226+
if (!Array.isArray(items)) {
227+
return [];
228+
}
223229

224230
return items.map((item) => {
225231
if (typeof item === 'string') {

src/tasks/cwv-demo-suggestions-processor/handler.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,9 @@ async function processCWVOpportunity(opportunity, logger, env, slackContext) {
220220
const sayPromises = [];
221221

222222
for (const suggestion of sortedSuggestions) {
223-
if (suggestionsToUpdate.length >= MAX_CWV_DEMO_SUGGESTIONS) break;
223+
if (suggestionsToUpdate.length >= MAX_CWV_DEMO_SUGGESTIONS) {
224+
break;
225+
}
224226

225227
const data = suggestion.getData();
226228
const metrics = data.metrics || [];

test/agents/base.test.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010
* governing permissions and limitations under the License.
1111
*/
1212

13-
/* eslint-env mocha */
14-
1513
import { expect } from 'chai';
1614
import path from 'path';
1715
import fs from 'fs';
@@ -47,7 +45,9 @@ describe('agents/base utilities', () => {
4745
const unlink = (filePath) => {
4846
try {
4947
fs.unlinkSync(filePath);
50-
} catch (e) { /* ignore */ }
48+
} catch (e) {
49+
/* ignore */
50+
}
5151
};
5252

5353
it('reads a file via relative path against static prompt dirname', () => {

test/agents/brand-profile/index.test.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010
* governing permissions and limitations under the License.
1111
*/
1212

13-
/* eslint-env mocha */
14-
1513
import { expect, use } from 'chai';
1614
import chaiAsPromised from 'chai-as-promised';
1715
import sinon from 'sinon';

test/agents/brand-profile/services/competitor-inference.test.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010
* governing permissions and limitations under the License.
1111
*/
1212

13-
/* eslint-env mocha */
14-
1513
import { expect, use } from 'chai';
1614
import chaiAsPromised from 'chai-as-promised';
1715
import sinon from 'sinon';

test/agents/brand-profile/services/persona-inference.test.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010
* governing permissions and limitations under the License.
1111
*/
1212

13-
/* eslint-env mocha */
14-
1513
import { expect, use } from 'chai';
1614
import chaiAsPromised from 'chai-as-promised';
1715
import sinon from 'sinon';

test/agents/brand-profile/services/product-extractor.test.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010
* governing permissions and limitations under the License.
1111
*/
1212

13-
/* eslint-env mocha */
14-
1513
import { expect, use } from 'chai';
1614
import chaiAsPromised from 'chai-as-promised';
1715
import sinon from 'sinon';

test/agents/brand-profile/services/regional-context.test.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010
* governing permissions and limitations under the License.
1111
*/
1212

13-
/* eslint-env mocha */
14-
1513
import { expect, use } from 'chai';
1614
import chaiAsPromised from 'chai-as-promised';
1715
import sinon from 'sinon';

test/agents/brand-profile/services/wikipedia.test.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010
* governing permissions and limitations under the License.
1111
*/
1212

13-
/* eslint-env mocha */
14-
1513
import { expect, use } from 'chai';
1614
import chaiAsPromised from 'chai-as-promised';
1715
import sinon from 'sinon';

test/agents/registry.test.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010
* governing permissions and limitations under the License.
1111
*/
1212

13-
/* eslint-env mocha */
14-
1513
import { expect, use } from 'chai';
1614
import sinon from 'sinon';
1715
import sinonChai from 'sinon-chai';

0 commit comments

Comments
 (0)