I am trying to use esLint in a Javascript file that is used as a source for SharePoint content editor webpart and I use an external JS library which is loaded elsewhere by the external solution itself. Therefore I don't need to import them in my files myself.
In my .eslintrc.js I want to specify the functions defined in the external library by a wildcard or regex, e.g. like this
'globals': {
myLib_*: true
}
or
'globals': {
/myLib_[^\s]+/: true
}
so calls of any function starting with myLib_ are not marked as no-undef
Is this possible or not? If it is not, I can put the external library on my filesystem and then reference it in the .eslintrc.js how?
Thank you!
Based on the closed issues below, it unfortunately looks like it won't be supported 😞
ESLint contributer nzakas stated in a comment in 2015 that
Globals can't work with unknown values because we do full scope resolution, not just identifier name matching.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With