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

{ajv,moment} isn't parseable by eslint #3

Closed
davfive opened this issue Oct 4, 2018 · 2 comments
Closed

{ajv,moment} isn't parseable by eslint #3

davfive opened this issue Oct 4, 2018 · 2 comments

Comments

@davfive
Copy link

davfive commented Oct 4, 2018

Hi,

I love ajv-moment. However, we're using eslint now and the way its setup to parse the options isn't parseable as valid js. Objects have fields: values, while you're asking for an object that looks like an array.

Could you change it so that it's called like plugin({ ajv: ajv, moment: moment)? or just plugin(ajv, moment)?

Thanks. I'd prefer to use a blessed version rather than forking.

David

@cludden
Copy link
Owner

cludden commented Oct 4, 2018

@davfive the example in the README is using the ES6 shorthand syntax for object properties covered by the object-shortand ESLint rule. It is perfectly valid to call the plugin using the more verbose syntax for object properties:

import Ajv from 'ajv';
import { plugin } from 'ajv-moment';
import moment from 'moment';

const ajv = new Ajv();
plugin({ ajv: ajv, moment: moment });

@davfive
Copy link
Author

davfive commented Oct 4, 2018 via email

@cludden cludden closed this as completed Oct 4, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants