leo-buneev / eslint-plugin-sort-keys-fix

Fork of https://eslint.org/docs/rules/sort-keys that allows automatic fixing
95 stars 22 forks source link

Comments are placed incorrectly #22

Open vikas-bansal-DisneyPH opened 3 years ago

vikas-bansal-DisneyPH commented 3 years ago

Hi @leo-buneev,

Its a beautiful eslint fixer however I have found a bug. Please help.

"eslint-plugin-sort-keys-fix": "^1.1.1",

Following input has been converted incorrectly.

INPUT

const getShowInformationUsingShowId = function (appConfig, showId) {
    return getRequest({
        url: appConstants.XYZ, // example comment
        headers: {},
        params: {
            id: showId,
        },
    });
};

OUTPUT


const getShowInformationUsingShowId = function (appConfig, showId) {
    return getRequest({
        // example comment
        headers: {},
        params: {
            id: showId,
        },
        url: appConstants.XYZ,
    });
};
namnm commented 2 years ago

I fixed this in my fork and also some other critical bugs as well. Look like this repo is not in maintenance anymore, if anyone still interested in this sort keys plugin please try mine: https://github.com/namnm/eslint-plugin-sort-keys

Install: eslint-plugin-sort-keys Rule: sort-keys/sort-keys-fix