by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Felix Kling
    @fkling
    I don't think that worked as I wanted it to, but as long as there is a way to communicate it's fine I guess.
    @skratchdot
    This seems like a good forum. Just read over your comments
    thanks for taking the time for that
    I was working on writing a jest test generator. Was hoping that would get the coverage up, until we could tweak tests. I didn't quite get it finished, but just wanted to make sure you were okay with it (before spending a bunch of time- and not getting it pulled in)
    Felix Kling
    @fkling
    I love tests... I just don't write them as often as I should ;)
    @skratchdot
    haha. same here. so i'm trying to get better at it
    Felix Kling
    @fkling
    So, what I am currently working on is storing parser settings with snippets (kind of an update to #127) and then finally figure out how to use gists as a backend .
    @skratchdot
    ok. very cool
    Felix Kling
    @fkling
    Parse is shutting down on Jan 20th, so that's the hard deadline :D
    @skratchdot
    i was thinking it'd be cool to eventually have "save" be a dropdown. I guess with "gist" being an option, or perhaps "deep link" if there's ever a router solution
    ah... yeah. i read about that a while back. cool that they gave the long grace period
    well, i don't wanna take up too much of your time, but thanks for the feedback. i might have some time this weekend to work on some stuff, so i'll just keep the PR's focused, and try to ask before doing anything too big. thanks again for the great tool!
    l8r
    Felix Kling
    @fkling
    Sounds good! Thank you for help!
    Pavithra Kodmad
    @pksjce
    Hey @fkling - I was trying to write a codemod at http://astexplorer.net/#/iBjDDgDrsg
    I have an extra newline coming up at line 16 of the output. Any idea how I can avoid this?
    Also I'm not able to figure out how to format the output to match my eslint configs. My test output fixture is formatted as per project's eslint but jscodeshift output has different formatting and I'm not able to get the two to match!
    Felix Kling
    @fkling

    Hi @pksjce! I’d try to create a minimal repro case. jscodeshift itself doesn’t actually do any of printing, recast does. So I’d raise that there if you can create a minimal example.
    Regarding formatting: Without knowing rules I can only tell you that printing options are passed to the .toSource() method and the available options are listed here: https://github.com/benjamn/recast/blob/master/lib/options.js . Here as well, if you think something is missing, please open an issue for recast.

    Btw, there is no need to call .toSource() in loadersToRules, loaderToUseand the other functions because you are not doing anything with the generated code. Only the return ast.toSource({quote:'single'}); at the end is important. Remove the other calls will probably improve performance a little bit.

    Sorry for not being able to provide more concrete solutions :-/

    Pavithra Kodmad
    @pksjce
    Hey! Thanks for the advice. I raised this PR benjamn/recast#353 at recast. Seems like it adds an extra new line during printing of objectExpression under certain conditions. Was able to write a failing test case there.
    And yeah you're right! I don't need those extra toSource() calls
    con-ssc
    @con-ssc
    Hello
    How do I get the typescript AST from a javascript file and generate a d.ts from the typescript AST after that ?
    Or maybe, first things first, how would I get an AST representation of a js file?
    Felix Kling
    @fkling
    @con-ssc: I’m not that familiar with typescript. You can have a look at astexplorer’s parser wrapper for how the parser is invoked: https://github.com/fkling/astexplorer/blob/1ddf98203a257c2ac6685d98e2c2591e9a1464be/src/parsers/js/typescript.js .
    con-ssc
    @con-ssc
    Ok thank you
    Finally someone reacted ;)
    Would be really interesting if I could get this somehow to work to generate a d.ts file from the typescript AST generated from a js file :)
    But maybe it is just too deep for me
    Ingvar Stepanyan
    @RReverser
    @con-ssc TypeScript AST, just like any, only represents actual code as it was written
    If it didn't have types (if you parsed JavaScript), the resulting AST won't have them either
    So you can't generate typed .d.ts out of non-typed JS
    con-ssc
    @con-ssc
    well, the target would be first to have everything of type any
    Roman Dvornov
    @lahmatiy
    @fkling Hi! Is there a way to get a link for specific parser? I mean something like https://astexplorer.net/css/parser
    Felix Kling
    @fkling
    Hey @lahmatiy! Not yet... that's something that would be really nice to have (and has been asked before). I was thinking more of something like http://astexplorer.net/#/?parser=csstree though, I think a parser is generally more of a parameter and it would probably be easier to implement too. Would you have time to work on a PR for this? I'm happy to help. I won't be able to allocate a lot of time to astexplorer in the next couple of weeks.
    Roman Dvornov
    @lahmatiy
    @fkling Ok, may be a little bit later. Is there an issue for that?
    Jeremy Gayed
    @tizmagik
    there used to be auto-complete in ASTExplorer right? or am I misremembering :)
    Marcos Ojeda
    @nsfmc
    is there some trick to getting babel-eslint and eslintv3 working together? i get an error like Line 3: 'import' and 'export' may appear only with 'sourceType: module'
    Marcos Ojeda
    @nsfmc
    @hzoo do you know offhand of an eslint rule that checks for certain amount of whitespace between two nodes (i'm trying to have two-spaces between adjacent classes)
    Rory O’Kane
    @roryokane

    I’m getting the same babel-eslint and eslintv3 error as @nsfmc. In fact, any JavaScript parser with any of the three ESLint transformer versions gives the error Line 1: 'import' and 'export' may appear only with 'sourceType: module'.

    You can see it by leaving the default transformer JavaScript (“Do not use template literals”), and putting this as the JavaScript to be transformed:

    import A from './A.js';

    The Babel and jscodeshift transformers don’t have this problem.

    Felix Kling
    @fkling
    Yeah, there is a problem with the configuration of eslint v3. #219 is trying to solve this but apparently it didn't work. This needs more investigation, sorry.
    @tizmagik: We have autocompletion for jscodeshift if you press <CTRL>+<Space>.
    弘树@阿里
    @dickeylth
    I'm trying astexplorer for test and I've found that the transform result in astexplorer and on my local node.js are not the same: https://github.com/babel/babel/issues/7102#issuecomment-353829115, could anyone help to see why? Thank you!
    Suchipi
    @suchipi
    @fkling is there anywhere I can donate? I rely on this tool a ton for prettier/babel/eslint and want to give back somehow
    Felix Kling
    @fkling
    @suchipi , that's very kind of you, think you! I have to clarify some things regarding this project with my employer first, but eventually I'd like to cover server costs via donations. I'll update the website once it's possible to donate.
    (or alternatively get a sponsorship from linode or digitalocean ;) )
    Suchipi
    @suchipi
    thanks!
    Vignesh Murugesan
    @vigneshm

    Hey folks, apologies if this has been asked before, I'm seeing issues in astexplorer.net while trying to transform js code annotated with flow types. See https://astexplorer.net/#/gist/01b63d8c875c95c86a067fbfec42f128/2f4b3fde6f96678c0d98faefeed75ec170733c90

    The parsing looks good, but the output fails as it is unable to handle flow syntax. Is this a known issue? Anyway workaround or local fix that I can do to unblock myself?

    I would be glad to work on a fix and send a PR if I can get some pointers
    mansoor basha
    @mansoor_bellary_twitter
    Hi Folks. Apologies, if this question was asked before. Is there any library to convert an AST to a vue template ?
    Paulius Valiunas
    @pauliunas
    is there a workaround for typescript-eslint parser not working?