Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generated Code + Semicolons #18

Open
DrewML opened this issue Feb 5, 2020 · 2 comments
Open

Generated Code + Semicolons #18

DrewML opened this issue Feb 5, 2020 · 2 comments
Labels
enhancement New feature or request

Comments

@DrewML
Copy link

DrewML commented Feb 5, 2020

Expected Behaviour

Hey! We're starting to work on some integrations with I/O functions on the Magento side of things, and I spun up a new functions-only app with aio app:init.

I noticed that the example functions pulled in by the Yeoman generator are currently going semi-less. I definitely am not looking to start a debate of which style is better.

However, Magento has a lot of folks that don't consider JS their primary language (employees and system integrators), and this can cause some surprises when folks are first attempting to onboard to I/O.

As an example, I helped a co-worker debug their function for about ~30 minutes the other day - I totally missed the missing semi they had after an IIFE, which ended up creating some surprising results.

I would love to see us improve in one of the following 2 ways:

  • Terminate statements with semicolons
    OR
  • Include ESLint with a default configuration that'll catch common ASI footguns

My own preference would be to add semis to the examples. I think a decent number of folks starting that don't have a JS background won't know what ESLint is, and likely won't have the editor plugin installed when they start up. Eliminating a foot gun for those folks could make the onboarding experience more seamless.

Actual Behaviour

No semis, no tooling to catch mistakes

Reproduce Scenario (including but not limited to)

Steps to Reproduce

Platform and Version

Sample Code that illustrates the problem

Logs taken while reproducing problem

@meryllblanchet meryllblanchet added enhancement New feature or request question Further information is requested labels Feb 5, 2020
@purplecabbage
Copy link
Member

good callout, we already add jest by default, we could add eslintrc and dev dependency as well.

@moritzraho
Copy link
Member

moritzraho commented Apr 21, 2020

+1 to generation of eslint config, and using the standard config (eslint-config-standard)
The user can then change the eslint config to the desired one if needed

@moritzraho moritzraho removed the question Further information is requested label Apr 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants