How to convince eslint that settings are defined?

/home/runner/work/discourse-custom-homepage-for-groups/discourse-custom-homepage-for-groups/javascripts/discourse/initializers/custom-homepage-set.js.es6
Error:   13:11  error  'settings' is not defined  no-undef
Error:   14:21  error  'settings' is not defined  no-undef
Error:   19:20  error  'settings' is not defined  no-undef
Error:   20:21  error  'settings' is not defined  no-undef
Error:   25:36  error  'settings' is not defined  no-undef
Error:   26:21  error  'settings' is not defined  no-undef
Error:   32:40  error  'settings' is not defined  no-undef
Error:   33:26  error  'settings' is not defined  no-undef

Right. I’m using settings. How do I convince eslint that they are defined? I’ve looked at a bunch of other exemplars (like discourse-brand-header/javascripts/discourse/initializers/initialize-mobile-decorator.js at main · discourse/discourse-brand-header · GitHub) and tney don’t seem to be defining settings.

In theory this should be handled by the eslint config you’re importing from our shared lint-configs :thinking:

But it seems like that’s not working for some reason…

2 Likes

Yeah, make sure you read this @pfaffman if you’ve not done so already :slight_smile:

Hm, maybe there’s an incompatibility between the newest eslint config and es6 files. Could you see if the errors persist after dropping the .es6 suffixes?

4 Likes

Rather than reading that, I copied the stuff blindly from the theme skeleton. :person_shrugging: I think I did one time find that, which explains some of the mystery.

You are very kind to suggest that my theory was not without merit.

image

Aha. So is there some reason not to do a global rename of all of my es6 files everywhere?

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.