Skip to content

Latest commit

 

History

History
64 lines (50 loc) · 930 Bytes

no-empty-vue-options.md

File metadata and controls

64 lines (50 loc) · 930 Bytes

Disallow using empty functions or objects as option values in Vue components (no-empty-vue-options)

Empty options, much like unused variables, are often a result of incomplete refactoring and may confuse readers.

This rule will not check empty functions and objects with comments. You can leave empty options with any comments inside to avoid emitting lint errors.

Options

This rule has an object option:

  • "ignores" ignores specified options

Fail

export default {
  methods: {},
}
export default {
  created() {},
}
export default {
  created: () => {},
}

Pass

export default {
  components: {
    Popover,
  },
}
export default {
  components: {
    // pass
  },
}
export default {
  created() {
    // pass
  },
}
/* eslint galaxy/no-empty-vue-options: ["error", { "ignores": ["methods"] }] */
export default {
  methods: {},
}