eslint-plugin-galaxy v1.35.0
eslint-plugin-galaxy
Various ESLint rules in one plugin.
Installation
npm install --save-dev eslint-plugin-galaxyUsage
// .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- Disallowanytype 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-deepcombinators 🔧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 Vueinjectoptions ✅no-invalid-vue-prop-keys- Require valid keys in Vuepropsoptions ✅no-restricted-vue-unhandled-promises- Enforce Promises in Vue functions with specified syntax to be handled appropriatelyno-shared-vue-provide- Enforce theprovideoption 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-ifdirectives 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.
1 year ago
1 year ago
1 year ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
5 years ago
5 years ago