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

hoist-class-statics plugin is removing indentation #120

Open
protoEvangelion opened this issue May 25, 2021 · 2 comments
Open

hoist-class-statics plugin is removing indentation #120

protoEvangelion opened this issue May 25, 2021 · 2 comments
Labels
bug Something isn't working low priority

Comments

@protoEvangelion
Copy link

protoEvangelion commented May 25, 2021

Before

import PropTypes from 'prop-types'
import * as React from 'react'

class B {

}

class A extends B {
    render () {
        return (<div>hi</div>);
    }
}

A.propTypes = {
    data: PropTypes.array
}

After

class A extends B {
static propTypes = {
    data: PropTypes.array
};

    render () {
        return (<div>hi</div>);
    }
}

@edsrzf
Copy link
Collaborator

edsrzf commented Jun 4, 2021

While not ideal, this seems like something that can be easily fixed through ESLint and the eslint-fix plugin, either using the indent rule or with eslint-plugin-prettier. Were you running the hoist-class-statics plugin by itself? If so, why? Just as a matter of curiosity.

Unless there's a compelling use case to run the plugin all by itself, I'd consider this pretty low priority to fix. Contrast it with something like #97, where the lost blank lines cannot be recovered easily through automation.

@protoEvangelion
Copy link
Author

I tried eslint & surprisingly it can't fix it. I'm leaning towards running prettier with precise commits to fix this to minimize the amount of formatting that takes place: https://github.com/nrwl/precise-commits

I'm running almost all of the plugins. I just identified that specific plugin as the one causing the indentation issue.

You can close if you would like.

@Rudeg Rudeg added bug Something isn't working low priority labels Sep 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working low priority
Projects
None yet
Development

No branches or pull requests

3 participants