Skip to content

vuetifyjs/eslint-plugin-vuetify

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

231 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
Vuetify ESLint Plugin Logo

npm version npm downloads License: MIT Discord

eslint-plugin-vuetify

This package helps migrate between Vuetify major versions. It includes rules for v2 โ†’ v3 and v3 โ†’ v4 migrations.

Use eslint-plugin-vuetify@vuetify-2 for v1 to v2.


Support the maintainer of this plugin:

Kael Watts-Deuchar

Become a Patron

Vuetify 4 Migration

Important

We suggest running vuetify-codemods first to automatically apply most migration fixes

This plugin includes four new rules for migrating from Vuetify v3 to v4:

  • no-deprecated-typography โ€” replaces MD2 typography classes (text-h1) with MD3 equivalents (text-display-large)
  • no-legacy-grid-props โ€” converts removed VRow/VCol props (align, justify, dense) to utility classes or renamed props
  • no-elevation-overflow โ€” flags elevation classes and props above the MD3 maximum of 5
  • no-deprecated-snackbar โ€” fixes renamed VSnackbarQueue slots and replaced VSnackbar props

Using the recommended-v4 preset

Enable all v4 migration rules at once:

// eslint.config.js
import vue from 'eslint-plugin-vue'
import vuetify from 'eslint-plugin-vuetify'

export default [
  ...vue.configs['flat/base'],
  ...vuetify.configs['flat/recommended-v4'],
]

Selecting individual rules

You can also enable rules selectively instead of using the preset:

// eslint.config.js
import vue from 'eslint-plugin-vue'
import vuetify from 'eslint-plugin-vuetify'

export default [
  ...vue.configs['flat/base'],
  ...vuetify.configs['flat/base'],
  {
    rules: {
      'vuetify/no-deprecated-typography': 'error',
      'vuetify/no-legacy-grid-props': 'error',
      'vuetify/no-elevation-overflow': 'error',
      'vuetify/no-deprecated-snackbar': 'error',
    }
  }
]

๐Ÿ’ฟ Install

You should have eslint and eslint-plugin-vue set up first.

yarn add eslint-plugin-vuetify -D
# OR
npm install eslint-plugin-vuetify --save-dev
// eslint.config.js
import vue from 'eslint-plugin-vue'
import vuetify from 'eslint-plugin-vuetify'

export default [
  ...vue.configs['flat/base'],
  ...vuetify.configs['flat/base'],
]

ESLint 8 can alternatively use the older configuration format:

// .eslintrc.js
module.exports = {
  extends: [
    'plugin:vue/base',
    'plugin:vuetify/base'
  ]
}

This plugin supports ESLint 8, 9, and 10. ESLint 10 only supports the flat config format (use configs['flat/base'] or configs['flat/recommended']).

NOTE This plugin does not affect pug templates due to a limitation in vue-eslint-parser. I suggest converting your pug templates to HTML with pug-to-html in order to use this plugin.

Rules

Deprecations

These rules will help you avoid deprecated components, props, and classes. They are included in the base preset.

Additional rule (not included in presets):

Grid system

These rules are designed to help migrate to the new grid system in Vuetify v3. They are included in the recommended preset.

Vuetify 4

These rules help migrate from Vuetify v3 to v4. They are included in the recommended-v4 preset.

Custom deprecations

User-configurable rules for deprecating components, props, events, and slots - helpful to enforce standardization.

๐Ÿ’ช Supporting Vuetify

Vuetify is an open source MIT project that has been made possible due to the generous contributions by community backers. If you are interested in supporting this project, please consider:

๐Ÿ“‘ License

MIT

Copyright (c) 2016-present Vuetify LLC

About

๐Ÿงผ Version upgrade automation eslint plugin

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Sponsor this project

  •  

Packages

 
 
 

Contributors