elicwhite / ESLint-Formatter

Sublime Text 3 Plugin to Autoformat with Eslint
MIT License
139 stars 20 forks source link

Jumps to top of file randomly #73

Open Niekes opened 4 years ago

Niekes commented 4 years ago

I am using Sublime Text 3.2.2 Build 3211 on Mac Version 10.14.6 (18G4032). Eslint-Formatter v2.3.1. I use it mainly in vue projects but also in Vanilla JS projects.

After formatting the file it jumps to the top of the file. Randomly. I can not track down any pattern. It just happens randomly. Any thoughts?

Here is my .eslintrc.js for my vue-projects:

module.exports = {
    root: true,
    env: {
        node: true,
    },
    extends: [
        'plugin:vue/recommended',
        '@vue/airbnb',
    ],
    rules: {
        'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
        'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
        indent: ['error', 4],
        // don't require .vue extension when importing
        'import/extensions': ['error', 'always', {
            js: 'never',
            vue: 'never',
        }],
        'vue/html-indent': ['error', 4],
    },
    parserOptions: {
        parser: 'babel-eslint',
    },
};

Here is my .eslintrc.js for my vanilla projects:

module.exports = {
    root: true,

    env: {
        browser: true,
    },

    extends: [
        'airbnb'
    ],

    rules: {
        'import/no-unresolved': [2, { ignore: ['$'] }],
        'indent': ['error', 4],
        'react/no-this-in-sfc': [0],
    },
}

And finally my sublime-project file:

// ...
        "ESLint-Formatter": {
            "format_on_save": true,
            "format_on_save_extensions": [
                "js",
                "jsx",
                "es",
                "es6",
                "vue",
                "babel"
            ]
        },
// ...
jazairi commented 4 years ago

I'm also having this issue, but I haven't been able to identify a pattern yet.