Skip to content
This repository has been archived by the owner on Jan 11, 2019. It is now read-only.

Should not change code style #15

Closed
sindresorhus opened this issue Apr 7, 2016 · 5 comments
Closed

Should not change code style #15

sindresorhus opened this issue Apr 7, 2016 · 5 comments

Comments

@sindresorhus
Copy link
Member

When using ava-codemods on:

test(t => {
    t.same(fn.sync('1.tmp', {cwd: t.context.tmp}), [path.join(t.context.tmp, '1.tmp')]);
});

I get:

test(t => {
    t.deepEqual(
        fn.sync('1.tmp', {cwd: t.context.tmp}),
        [path.join(t.context.tmp, '1.tmp')]
    );
});

It should not change unrelated code.

And it doesn't even use the correct indentation. Source was tab indented, now it's 4 spaces.

@jamestalmage
Copy link
Contributor

Fixed.

@jfmengels - Just FYI. recast attaches details about surrounding whitespace to each individual node, so the less of the AST you can replace the better. See: e375eb7

@jamestalmage
Copy link
Contributor

fix deployed in v0.2.1

@jfmengels
Copy link
Contributor

Ah, yes. Duly noted, thanks 👍

@jfmengels
Copy link
Contributor

cc @spudly you might want this tip too :)

@spudly
Copy link

spudly commented Apr 7, 2016

Good info. Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants