Skip to content

Commit b5c242e

Browse files
Remove all eslint-disable comments for for...of syntax (#4501)
Support for this landed in PR #4498 so all of these can be removed now.
1 parent 23f4d49 commit b5c242e

13 files changed

Lines changed: 0 additions & 17 deletions

File tree

bin/build-locales

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ if (!app && !buildAll) {
2626
}
2727

2828
const appsBuildList = buildAll ? config.get('validAppNames') : [app];
29-
// eslint-disable-next-line no-restricted-syntax
3029
for (const appName of appsBuildList) {
3130
const localeDir = path.join(__dirname, '../locale');
3231
const poFiles = glob.sync(`${localeDir}/**/${appName}.po`);

src/amo/sagas/home.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ export function* fetchHomeAddons({
3030
const state = yield select(getState);
3131

3232
const collections = [];
33-
// eslint-disable-next-line no-restricted-syntax
3433
for (const collection of collectionsToFetch) {
3534
const result = yield call(getCollectionAddons, {
3635
api: state.api,

src/core/addonManager.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ export function install(
5454
return _mozAddonManager.createInstall({ url })
5555
.then((installObj) => {
5656
const callback = (e) => eventCallback(installObj, e);
57-
// eslint-disable-next-line no-restricted-syntax
5857
for (const event of INSTALL_EVENT_LIST) {
5958
log.info(`[install] Adding listener for ${event}`);
6059
installObj.addEventListener(event, callback);
@@ -95,7 +94,6 @@ export function addChangeListeners(callback, mozAddonManager) {
9594
}
9695

9796
if (mozAddonManager && mozAddonManager.addEventListener) {
98-
// eslint-disable-next-line no-restricted-syntax
9997
for (const event of GLOBAL_EVENTS) {
10098
log.info(`adding event listener for "${event}"`);
10199
mozAddonManager.addEventListener(event, handleChangeEvent);

src/core/components/InstallButton/index.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ export const getFileHash = ({ addon, installURL } = {}) => {
4646
// https://github.com/mozilla/addons-frontend/issues/3871
4747

4848
if (addon.current_version) {
49-
// eslint-disable-next-line no-restricted-syntax
5049
for (const file of addon.current_version.files) {
5150
// The API sometimes appends ?src= to URLs so we just check the
5251
// basename.

src/core/i18n/utils.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,6 @@ export function getLangFromHeader(
163163
let userLang;
164164
if (acceptLanguage) {
165165
const langList = parseAcceptLanguage(acceptLanguage);
166-
// eslint-disable-next-line no-restricted-syntax
167166
for (const langPref of langList) {
168167
if (isSupportedLang(normalizeLang(langPref.lang), { _supportedLangs })) {
169168
userLang = langPref.lang;

src/core/utils/index.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ export function ngettext(singular, plural, n) {
3535

3636
export function getClientConfig(_config) {
3737
const clientConfig = {};
38-
// eslint-disable-next-line no-restricted-syntax
3938
for (const key of _config.get('clientConfigKeys')) {
4039
clientConfig[key] = _config.get(key);
4140
}

tests/unit/TestCSPConfig.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ describe('CSP Config Defaults', () => {
2626
process.env.NODE_ENV = existingNodeEnv;
2727
});
2828

29-
// eslint-disable-next-line no-restricted-syntax
3029
for (const env of deployedEnvs) {
3130
// eslint-disable-next-lint no-loop-func
3231
it(`should have a source-list config for ${env}`, () => {

tests/unit/TestFrameGuardConfig.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ describe('App Specific Frameguard Config', () => {
1111
delete process.env.NODE_APP_INSTANCE;
1212
});
1313

14-
// eslint-disable-next-line no-restricted-syntax
1514
for (const appName of appsList) {
1615
// eslint-disable-next-line no-loop-func
1716
it(`should default frameGuard to "deny" for ${appName} in production`, () => {

tests/unit/TestLocalesConfig.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,13 @@ const langs = config.get('langs');
1212
const basePath = config.get('basePath');
1313

1414
describe(__filename, () => {
15-
// eslint-disable-next-line no-restricted-syntax
1615
for (const lang of langs) {
1716
// eslint-disable no-loop-func
1817
it(`should have a corresponding ${lang} dir in locale`, () => {
1918
fs.lstatSync(path.join(basePath, 'locale', langToLocale(lang)));
2019
});
2120
}
2221

23-
// eslint-disable-next-line no-restricted-syntax
2422
for (const localeDir of glob.sync('locale/*')) {
2523
const locale = path.basename(localeDir);
2624
const lang = localeToLang(locale);
@@ -34,7 +32,6 @@ describe(__filename, () => {
3432
});
3533

3634
describe('Check Locale JS for entities', () => {
37-
// eslint-disable-next-line no-restricted-syntax
3835
for (const localeJSFile of glob.sync('src/locale/*/*.js')) {
3936
it(`${localeJSFile} should not have html entities`, (done) => {
4037
fs.readFile(localeJSFile, 'utf8', (err, data) => {

tests/unit/core/middleware/test_frameguardMiddleware.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ describe('Frameguard Middleware', () => {
1515
delete process.env.NODE_APP_INSTANCE;
1616
});
1717

18-
// eslint-disable-next-line no-restricted-syntax
1918
for (const appName of appsList) {
2019
// eslint-disable-next-line no-loop-func
2120
it(`provides the expected x-frame-options headers for ${appName}`, () => {

0 commit comments

Comments
 (0)