salesforce / eslint-config-lwc

Opinionated ESLint configurations for LWC projects
MIT License
112 stars 35 forks source link

chore: restrict @salesforce/lds imports #111

Closed scarrawaySF closed 1 year ago

scarrawaySF commented 1 year ago

restricting access to @salesforce/lds modules as they shouldn't be accessed directly in consuming code.

scarrawaySF commented 1 year ago

@nolanlawson are you the right person to ask for a review here? Let me know if there's another process I should follow

ravijayaramappa commented 1 year ago

@scarrawaySF Is your team planning to start using import foo from '@salesforce/lds'; statements in generated internal modules?

lwc-platform-public(the metadata collector for LWCs) currently validates allowed usages for @salesforce/xxx imports. I do not see @salesforce/lds as an allowed pattern, so importing this should already be dis-allowed in LWCs.

scarrawaySF commented 1 year ago

@scarrawaySF Is your team planning to start using import foo from '@salesforce/lds'; statements in generated internal modules?

lwc-platform-public(the metadata collector for LWCs) currently validates allowed usages for @salesforce/xxx imports. I do not see @salesforce/lds as an allowed pattern, so importing this should already be dis-allowed in LWCs.

Yes that's the idea. We're externalizing GraphQL documents that we've parsed to their own modules, then they'll be imported into the components for use by the adapter.