settingsが定義されていることをeslintに納得させる方法

https://github.com/pfaffman/discourse-custom-homepage-for-groups/actions/runs/7211339319/job/19646550333

/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

https://github.com/pfaffman/discourse-custom-homepage-for-groups/blob/main/javascripts/discourse/initializers/custom-homepage-set.js.es6

右。settings を使用していますが、eslint に定義されていることを納得させるにはどうすればよいですか?他の多くの例 (https://github.com/discourse/discourse-brand-header/blob/main/javascripts/discourse/initializers/initialize-mobile-decorator.js など) を見ましたが、settings が定義されているようには見えません。

理論上は、共有の lint-configs からインポートしている eslint 設定で処理されるはずです :thinking:

https://github.com/discourse/lint-configs/blob/main/lint-configs/eslint-theme.cjs#L7-L10

しかし、何らかの理由でそれが機能していないようです…

「いいね!」 2

@pfaffman さん、まだ読んでいない場合は、こちらを必ずお読みください :slight_smile:

Hm、最新のeslint設定とes6ファイルとの間に互換性の問題があるのかもしれません。.es6 の接尾辞を削除した後もエラーが続くかどうか確認していただけますか?

「いいね!」 4

それを読む代わりに、テーマのスケルトンから盲目的にコピーしました。 :person_shrugging: 一度見つけたことがあると思いますが、それが謎の一部を説明しています。

私の理論が一理ないものではなかったと示唆していただき、ありがとうございます。

なるほど。では、私のすべての es6 ファイルをどこでもグローバルに名前変更しない理由があるのでしょうか?

「いいね!」 1

このトピックは、最後の返信から30日後に自動的にクローズされました。新しい返信は許可されていません。