magento / pwa-studio

🛠Development tools to build, optimize and deploy Progressive Web Applications for Magento 2.
https://developer.adobe.com/commerce/pwa-studio/
Open Software License 3.0
1.07k stars 683 forks source link

[feature]: Idea for static code analysis of PWA Stduio modules #2633

Open larsroettig opened 4 years ago

larsroettig commented 4 years ago

Is your feature request related to a problem? Please describe.

All PWA modules should be checked for consistency through a validation process. This should work similarly to the Magento Coding Style an idea would be to build an eslint rule

Describe the solution you'd like

Idea we parse package.json check for "pwa-studio": {"targets": { "intercept" there is defined if it is an PWA Extensions.

We add this folder to our validation process the every PWA Extensions need the esModules flag in the intercept file. Also we search if contains the module any .css or .graphql then flags cssModules flag or graphqlQueries flag are required.

I think what we also should check if a .js contains an import for @magento/peregrine but is it is not defined as peerDependencies then we should throw an error for missing peer dependencies.

Describe alternatives you've considered

Additional context

Please let us know what packages this feature is in regards to:

m2-assistant[bot] commented 4 years ago

Hi @larsroettig. Thank you for your report. To help us process this issue please make sure that you provided sufficient information.

Please, add a comment to assign the issue: @magento I am working on this


larsroettig commented 4 years ago

@zetlen what do think about this?

awilcoxa commented 4 years ago

Created PWA-868