I have the following ESLint rule. This disallows MyImport1 and MyImport2 of being imported from my-package
.
"no-restricted-imports": ["warn", {"paths": [ {"name": "my-package","importNames": ["MyImport1", "MyImport2"],"message": "Only MyImport1 and MyImport2 are allowed to use from this package." } ],}],
Now I would like to achieve the exact opposite. If I import any other import than these from this package, I would like to throw an error.
import { MyImport89 } from 'my-package'; // Show error: This is not MyImport1 or MyImport2
Would this be possible?