Various ESLint rules in one plugin.
npm install --save-dev eslint-plugin-galaxy
// .eslintrc.js
module.exports = {
extends: {
'plugin:galaxy/recommended',
// for Vue
'plugin:galaxy/recommended-vue',
}
}
-
compat
- Avoid using incompatible features -
esm-bundler
- Enforce ES Module bundler APIs instead of Node APIs -
import-extensions
- Ensure consistent use of file extension within the import path 🔧 -
max-nested-destructuring
- Enforce a maximum depth that destructuring can be nested -
multi-branch-curly
- Require following curly brace conventions for statements with multiple branches 🔧 -
no-for-in
- Disallow for-in statements -
no-misused-globals
- Disallow global variables that may be misused -
no-prototype-as-value
- Disallow using prototype of functions as values ✅ -
no-restricted-barrel-imports
- Disallow specified barrel modules when loaded byimport
🔧 -
no-restricted-floating-promises
- Enforce Promises with specified syntax to be handled appropriately -
no-unnecessary-optional-chain
- Disallow unnecessary optional chain ✅ 🔧 -
no-unsafe-window-open
- Disallow unsafewindow.open()
✅ 🔧 -
non-control-statement-curly
- Require following curly brace conventions for non-control statements 🔧 -
valid-indexof-return
- Disallow boolean cast of returning value of.indexOf()
✅
-
no-as-any
- Disallowany
type assertions
-
conventional-vue-keys-order
- Enforce properties in Vue component options to be sorted in conventional order 🔧 -
no-ambiguous-vue-default-props
- Disallow using empty functions as default values of Vue props 🔧 -
no-deprecated-vue-deep-combinator
- Disallow using deprecated Vue::v-deep
combinators 🔧 -
no-duplicate-vue-store-mappings
- Disallow duplicate store mapping functions in Vue components 🔧 -
no-duplicate-vuex-properties
- Disallow duplicate properties from Vuex ✅ -
no-empty-vue-options
- Disallow using empty functions or objects as option values in Vue components ✅ -
no-invalid-vue-inject-keys
- Require valid keys in Vueinject
options ✅ -
no-invalid-vue-prop-keys
- Require valid keys in Vueprops
options ✅ -
no-restricted-vue-unhandled-promises
- Enforce Promises in Vue functions with specified syntax to be handled appropriately -
no-shared-vue-provide
- Enforce theprovide
option of Vue component to be a function ✅ 🔧 -
no-unknown-vue-options
- Disallow unknown options in Vue components ✅ -
no-unused-vuex-properties
- Disallow unused properties from Vuex ✅ -
require-vue-default-inject
- Require default value for inject ✅ 🔧 -
valid-vue-reactivity-transform-props
- Enforce Vue props with Reactivity Transform to be valid 🔧 -
valid-vue-v-if-with-v-slot
- Enforce validv-if
directives when using withv-slot
✅ -
valid-vuex-properties
- Enforce valid property mappings with Vuex ✅ -
vue-attribute-spacing
- Enforce unified spacing around binding attributes 🔧 -
vue-reactivity-transform-uses-vars
- Prevent variables used in reactivity transform to be marked as unused -
vue-ref-style
- Enforce Vue refs style
✅ means that the rule is contained in plugin:galaxy/recommended
or plugin:galaxy/recommended-vue
.
🔧 means that the rule could be fixed automatically.