No More Posting New Topics!

If you have a question or an issue, please start a thread in our Github Discussions Forum.
This forum is closed for new threads/ topics.

Navigation

    Quasar Framework

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    Expected Spaces Not Tabs

    CLI
    4
    4
    1979
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • P
      packy last edited by

      Is there a way to turn this off? I would prefer to use my common workflow in all my projects which use tabs not spaces, but when I do it in any vue file I get a compile error

      1 Reply Last reply Reply Quote 0
      • rstoenescu
        rstoenescu Admin last edited by rstoenescu

        You can change the indent ESLint rule in /.eslintrc > rules. http://eslint.org/docs/rules/indent

        1 Reply Last reply Reply Quote 0
        • J
          JCharante last edited by

          @packy Did you end up finding a solution? I always use tabs but I spent a couple hours trying to get eslint to accept my tabs and settled for 4 spaces instead of 2.

          1 Reply Last reply Reply Quote 0
          • a47ae
            a47ae last edited by a47ae

            As @rstoenescu said, just edit the .eslintrc.js file in your project to look like this:

            module.exports = {
              root: true,
              parser: 'babel-eslint',
              parserOptions: {
                sourceType: 'module'
              },
              env: {
                browser: true,
              },
              // https://github.com/feross/standard/blob/master/RULES.md#javascript-standard-style
              extends: 'standard',
              // required to lint *.vue files
              plugins: [
                'html'
              ],
              globals: {
                'cordova': true,
                'DEV': true,
                'PROD': true,
                '__THEME': true
              },
              // add your custom rules here
              'rules': {
                // allow paren-less arrow functions
                'arrow-parens': 0,
                'one-var': 0,
                'import/first': 0,
                // allow debugger during development
                'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0,
                'brace-style': [2, 'stroustrup', { 'allowSingleLine': true }],
            
                'indent': ['error', 'tab'] // This is the required line to use tabs instead of spaces
            
              }
            }
            

            Please note, I copied the whole file, but the only line you need to add is 'indent': ['error', 'tab'] to the rules section.

            1 Reply Last reply Reply Quote 0
            • First post
              Last post