Git Product home page Git Product logo

Comments (12)

mlegenhausen avatar mlegenhausen commented on June 2, 2024

This will be a little bit tricky cause the JSON.stringify method wraps everything in double quotes. Do you know any other library for this problem? It would be nice if I could also convert Date objects and keep them as Date.

from grunt-ng-constant.

vilmosioo avatar vilmosioo commented on June 2, 2024

I don't know any :( Can easily bypass this issue by ignoring the generated file.

Great work though!

from grunt-ng-constant.

mlegenhausen avatar mlegenhausen commented on June 2, 2024

That would be my advice too ;)

I will keep this open, maybe I find an alternative.

from grunt-ng-constant.

vilmosioo avatar vilmosioo commented on June 2, 2024

I think valid JSON should have double quotes. I set my jshint to ignore all json files and it's fine.
I would close this issue myself but I'll leave the decision to you in case you want to add this feature at some point.

from grunt-ng-constant.

mlegenhausen avatar mlegenhausen commented on June 2, 2024

That's right it is valid JSON, but you are not limited to JSON in an angular constant module.

from grunt-ng-constant.

vilmosioo avatar vilmosioo commented on June 2, 2024

True but I prefer it. I work on a medium to large app with a lot of constants spread over multiple files. I do not find it proper to define constant values in my Gruntfile. Unless I'm missing something here...

from grunt-ng-constant.

mlegenhausen avatar mlegenhausen commented on June 2, 2024

Nice to hear that my plugin is useful for others :)

Sure the JSON option should always be the default, but another option could be useful too.

from grunt-ng-constant.

vilmosioo avatar vilmosioo commented on June 2, 2024

Thanks for everything! I'll keep an eye out on this issue to see if the generated files still fail jshint.
I'll do my best to help in the meantime.

from grunt-ng-constant.

mkhatib avatar mkhatib commented on June 2, 2024

I just sent a pull request to add a singlequote option. Check it out and let me know if that might be a possible solution.

from grunt-ng-constant.

vilmosioo avatar vilmosioo commented on June 2, 2024

@werk85 is everything alright with the pull request?

from grunt-ng-constant.

kylejeske avatar kylejeske commented on June 2, 2024

Is there any reason why "singlequote" didn't get pulled into master?

A work-around for this ...

        ngconstant: {
            options: {
                space: '  ',
                wrap: '/*jshint quotmark:double*/\n\n"use strict";\n\n {%= __ngModule %}',
                name: 'myConfig'
            },

from grunt-ng-constant.

mlegenhausen avatar mlegenhausen commented on June 2, 2024

Read #20 for more informations.

from grunt-ng-constant.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.