← Back

indent warning

This rule enforces a consistent indentation style. It is turned off for *.vue files as the indentation for these is governed by vue/script-indent.

Examples

❌  Incorrect

// 2 space indent
const b = () => {
  return {
    foo: 'bar',
  };
};

// 8 space indent
const c = () => {
        return {
                foo: 'bar',
        };
};

    // 4 space initial indent
    const d = () => {
        return {
            foo: 'bar',
        };
    };

// spacing using the fibonacci sequence
const d = () => {
 return {
   foo: {
      bar: {
           hello: {
                   world: null,
           },
      },
   },
 };
};

✅  Correct

const a = () => {
    return {
        foo: 'bar',
    };
};