PhpStorm 2021.2 Help

Code Inspections in Vue

This topic lists all PhpStorm code inspections available in Vue.

You can toggle specific inspections or change their severity level on the Editor | Inspections page of the IDE settings Ctrl+Alt+S.

Inspection

Description

Default Severity

Data function

Reports a Vue component data property that is not a function. Suggests wrapping an object literal with a function.

When defining a component, data must be declared as a function that returns the initial data object, because the same definition will be used for creating numerous instances. If a plain object is still used for data, that very object will be shared by reference across all instances created! With a data function, every time a new instance is created we can simply call it to return a fresh copy of the initial data.

Warning Warning

Duplicate template/script tag

Reports multiple usages of the template or script tag in a Vue file.

Vue Component specification indicates that each *.vue file can contain at most one template or script block at a time.

Warning Warning

Last modified: 16 July 2021