eslint-plugin-galaxy
v1.35.0
Published
Various ESLint rules in one plugin.
Downloads
7,406
Readme
eslint-plugin-galaxy
Various ESLint rules in one plugin.
Installation
npm install --save-dev eslint-plugin-galaxy
Usage
// .eslintrc.js
module.exports = {
extends: {
'plugin:galaxy/recommended',
// for Vue
'plugin:galaxy/recommended-vue',
}
}
Rules
compat
- Avoid using incompatible featuresesm-bundler
- Enforce ES Module bundler APIs instead of Node APIsimport-extensions
- Ensure consistent use of file extension within the import path 🔧max-nested-destructuring
- Enforce a maximum depth that destructuring can be nestedmulti-branch-curly
- Require following curly brace conventions for statements with multiple branches 🔧no-for-in
- Disallow for-in statementsno-misused-globals
- Disallow global variables that may be misusedno-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 appropriatelyno-unnecessary-optional-chain
- Disallow unnecessary optional chain ✅ 🔧no-unsafe-number
- Disallow optional chain in numerical calculationno-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()
✅
For TypeScript
no-as-any
- Disallowany
type assertions
For Vue
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 appropriatelyno-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 Vuexno-vue-sfc-text-node
- Disallow text nodes in Vue SFC files ✅ 🔧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 unusedvue-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.