You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The updates of imported bindings by ES Modules cause runtime errors.
Rule Details
This rule warns the assignments, increments, and decrements of imported bindings.
Examples of incorrect code for this rule:
/*eslint no-import-assign: "error"*/importmod,{named}from"./mod.mjs"import*asmod_nsfrom"./mod.mjs"mod=1// ERROR: 'mod' is readonly.named=2// ERROR: 'named' is readonly.mod_ns.named=3// ERROR: the members of 'mod_ns' is readonly.mod_ns={}// ERROR: 'mod_ns' is readonly.
Examples of correct code for this rule:
/*eslint no-import-assign: "error"*/importmod,{named}from"./mod.mjs"import*asmod_nsfrom"./mod.mjs"mod.prop=1named.prop=2mod_ns.named.prop=3// Known Limitationfunctiontest(obj){obj.named=4// Not errored because 'obj' is not namespace objects.}test(mod_ns)// Not errored because it doesn't know that 'test' updates the member of the argument.
The text was updated successfully, but these errors were encountered:
import'../../../polyfill'importfetch,*asponyfillfrom'../../..'importaddModuleSuitefrom'../../module.spec'ponyfill.defaultExport=fetchaddModuleSuite('Browser: import on Webpack bundle',ponyfill)
Seems easy enough for them to add an // eslint-ignore comment when doing something hacky like this. Otherwise, this is a good rule.
https://eslint.org/docs/rules/no-import-assign
The updates of imported bindings by ES Modules cause runtime errors.
Rule Details
This rule warns the assignments, increments, and decrements of imported bindings.
Examples of incorrect code for this rule:
Examples of correct code for this rule:
The text was updated successfully, but these errors were encountered: