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

No input argument received on validate #1142

Closed
loranger opened this issue Apr 17, 2018 · 2 comments
Closed

No input argument received on validate #1142

loranger opened this issue Apr 17, 2018 · 2 comments
Milestone

Comments

@loranger
Copy link

Hello,

Sorry to bother, but even if mjml is a wonderful project allowing us to make universal responsive emails, we still can break all the thing by typing errorneous tags. That's what I did few weeks ago, without noticing my emails were broken on production.

Once we did figure out there was a remaining trailing space in an mjml tag, I decided to add an mjml linter on my git commit hook

But I still can't make it work. I'm not sure what I did wrong, so here is what I did.
Can someone point me on what I did miss ?

Reproduction Steps:

  1. I use mjml inside a laravel project.

Even if the validator is installed (as a dependency ?), I cannot use it until I install it explicitely :

$ ls -la node_modules
$ ls -la node_modules
...
drwxr-xr-x     7 loranger  staff     224 27 fév 14:41 mjml
drwxr-xr-x     6 loranger  staff     192 27 fév 14:41 mjml-accordion
drwxr-xr-x     6 loranger  staff     192 27 fév 14:41 mjml-body
drwxr-xr-x     6 loranger  staff     192 27 fév 14:41 mjml-button
drwxr-xr-x     6 loranger  staff     192 27 fév 14:41 mjml-carousel
drwxr-xr-x     9 loranger  staff     288 27 fév 14:41 mjml-cli
drwxr-xr-x     6 loranger  staff     192 27 fév 14:41 mjml-column
drwxr-xr-x     7 loranger  staff     224 27 fév 14:41 mjml-core
drwxr-xr-x     6 loranger  staff     192 27 fév 14:41 mjml-divider
drwxr-xr-x     6 loranger  staff     192 27 fév 14:41 mjml-group
drwxr-xr-x     5 loranger  staff     160 27 fév 14:41 mjml-head
drwxr-xr-x     6 loranger  staff     192 27 fév 14:41 mjml-head-attributes
drwxr-xr-x     6 loranger  staff     192 27 fév 14:41 mjml-head-breakpoint
drwxr-xr-x     6 loranger  staff     192 27 fév 14:41 mjml-head-font
drwxr-xr-x     6 loranger  staff     192 27 fév 14:41 mjml-head-preview
drwxr-xr-x     6 loranger  staff     192 27 fév 14:41 mjml-head-style
drwxr-xr-x     6 loranger  staff     192 27 fév 14:41 mjml-head-title
drwxr-xr-x     6 loranger  staff     192 27 fév 14:41 mjml-hero
drwxr-xr-x     6 loranger  staff     192 27 fév 14:41 mjml-image
drwxr-xr-x     8 loranger  staff     256 27 fév 14:41 mjml-migrate
drwxr-xr-x     6 loranger  staff     192 27 fév 14:41 mjml-navbar
drwxr-xr-x     5 loranger  staff     160 27 fév 14:41 mjml-parser-xml
drwxr-xr-x     6 loranger  staff     192 27 fév 14:41 mjml-raw
drwxr-xr-x     6 loranger  staff     192 27 fév 14:41 mjml-section
drwxr-xr-x     6 loranger  staff     192 27 fév 14:41 mjml-social
drwxr-xr-x     6 loranger  staff     192 27 fév 14:41 mjml-spacer
drwxr-xr-x     6 loranger  staff     192 27 fév 14:41 mjml-table
drwxr-xr-x     6 loranger  staff     192 27 fév 14:41 mjml-text
drwxr-xr-x     6 loranger  staff     192 27 fév 14:41 mjml-validator
drwxr-xr-x     6 loranger  staff     192 27 fév 14:41 mjml-wrapper
...
$ mjml --validate
$ ./node_modules/.bin/mjml --validate resources/views/mjml/welcome.mjml
Too much input arguments received
$ mjml-cli --validate
$ ./node_modules/.bin/mjml-cli --validate resources/views/mjml/welcome.mjml
Too much input arguments received

  1. So I install the mjml-validator explicitely
$ npm i mjml-validator --save-dev

Then the error message is slightly different

$ mjml --validate
$ ./node_modules/.bin/mjml --validate resources/views/mjml/welcome.mjml
No input argument received
$ mjml-cli --validate
$ ./node_modules/.bin/mjml-cli --validate resources/views/mjml/welcome.mjml
No input argument received

I took a deeper look at the documentation, but I stil can't find my error. Could you help, please ?

Expected behavior:

A validation output listing my markup errors

Observed behavior:

It looks like the mjml command does not understand the validate flag or the input file

MJML version:

  • mjml-core: 4.0.1
  • mjml-cli: 4.0.3
@iRyusa
Copy link
Member

iRyusa commented Apr 17, 2018

Hi @loranger !

I think --validate option hasn't been backported yet into the 4 cli yet, @kmcb777 can you take a look to add it back for 4.1 ? 👍

@iRyusa iRyusa added this to the 4.1.0 milestone Apr 17, 2018
@ngarnier ngarnier added this to Soon to be released in MJML Roadmap Apr 24, 2018
kmcb777 added a commit that referenced this issue May 17, 2018
fix #1142 --validate option on cli
@kmcb777
Copy link
Collaborator

kmcb777 commented Jun 20, 2018

Hi @loranger we released a new beta for mjml 4.1, which you can install with npm install mjml@next, could you check if the --validate option is working as you wish ?

@iRyusa iRyusa closed this as completed in b4c9f18 Jun 28, 2018
MJML Roadmap automation moved this from Soon to be released to Released Jun 28, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
MJML Roadmap
  
Released
Development

No branches or pull requests

3 participants