eslint-plugin-quasar
raw JSON → 1.1.0 verified Sat Apr 25 auth: no javascript
Official ESLint plugin for enforcing best practices and aiding migration in Quasar Framework projects. Current version is 1.1.0 (stable), with an alpha cycle leading to 1.0.0. It provides rules to detect deprecated Quasar v0.17 components, directives, CSS, plugins, and properties, and validates props for v1+ components. Key differentiators: official plugin from the Quasar team, focused on migration and prop validation, with legacy and standard configurations. Release cadence is irregular; updates are driven by framework changes.
Common errors
error ESLint couldn't find the plugin "eslint-plugin-quasar". ↓
cause Plugin not installed or not in node_modules.
fix
Run npm install --save-dev eslint-plugin-quasar or ensure it's in devDependencies.
error Configuration for rule "quasar/no-legacy-components" is invalid: Value "error" is not a valid severity. ↓
cause Using string 'error' in older ESLint versions (pre-v6).
fix
Use numeric severity: 2 for error, 1 for warn.
error Definition for rule 'quasar/no-invalid-props' was not found. ↓
cause Incorrect plugin name or rule not available in version.
fix
Ensure plugin is in plugins array and rule name is correct; update to latest version.
error Cannot find module 'eslint-plugin-quasar' ↓
cause Plugin not installed or missing from package.json.
fix
npm install --save-dev eslint-plugin-quasar
Warnings
deprecated The rule 'check-valid-props' has been deprecated since v1.0.0. ↓
fix Replace 'check-valid-props' with 'no-invalid-props'.
gotcha Global ESLint installation requires global plugin installation. ↓
fix Install eslint and plugins locally for consistency: npm install --save-dev eslint eslint-plugin-quasar
gotcha Legacy rules are only for migrating from v0.17 to v1; not relevant for new v1+ projects. ↓
fix Use the standard config and rules for v1+ projects.
breaking In v1.0.0-alpha.13, directive rule required 'v-' prefix; previously it did not. ↓
fix Ensure directives in rules include 'v-' prefix (e.g., 'v-model' instead of 'model').
Install
npm install eslint-plugin-quasar yarn add eslint-plugin-quasar pnpm add eslint-plugin-quasar Imports
- plugin default wrong
plugins: ['eslint-plugin-quasar']correctplugins: ['quasar'] - legacy config wrong
extends: ['quasar/legacy']correctextends: ['plugin:quasar/legacy'] - standard config wrong
extends: ['quasar/standard']correctextends: ['plugin:quasar/standard'] - rule 'no-legacy-components' wrong
rules: { 'no-legacy-components': 'error' }correctrules: { 'quasar/no-legacy-components': 'error' }
Quickstart
// .eslintrc.js
module.exports = {
root: true,
env: {
node: true
},
extends: [
'plugin:quasar/standard'
],
plugins: ['quasar'],
rules: {
'quasar/no-invalid-props': 'error',
'quasar/no-invalid-qfield-usage': 'warn'
}
};