Gathering detailed insights and metrics for @jay-es/eslint-plugin-vue-sort-components
Gathering detailed insights and metrics for @jay-es/eslint-plugin-vue-sort-components
A plugin for ESLint to keep order of component names
npm install @jay-es/eslint-plugin-vue-sort-components
Typescript
Module System
Node Version
NPM Version
68.1
Supply Chain
98.6
Quality
75.5
Maintenance
100
Vulnerability
100
License
TypeScript (90.52%)
JavaScript (8.39%)
Shell (1.09%)
Total Downloads
19,220
Last Day
49
Last Week
192
Last Month
566
Last Year
1,783
1 Stars
406 Commits
1 Watching
1 Branches
1 Contributors
Minified
Minified + Gzipped
Latest Version
0.4.1
Package Id
@jay-es/eslint-plugin-vue-sort-components@0.4.1
Unpacked Size
7.03 kB
Size
2.40 kB
File Count
4
NPM Version
9.6.7
Node Version
18.16.0
Publised On
27 Sept 2023
Cumulative downloads
Total Downloads
Last day
444.4%
49
Compared to previous day
Last week
326.7%
192
Compared to previous week
Last month
12.7%
566
Compared to previous month
Last year
-79.8%
1,783
Compared to previous year
eslint-plugin-vue-sort-components
A plugin for ESLint to keep order of component names.
The rule is auto-fixable.
1$ npm install --save-dev eslint @jay-es/eslint-plugin-vue-sort-components
or
1$ yarn add -dev @jay-es/eslint-plugin-vue-sort-components
Add plugin:@jay-es/vue-sort-components/recommended
to the extends section of your .eslintrc
configuration file.
1{ 2 "extends": [ 3 // ... 4 "plugin:@jay-es/vue-sort-components/recommended" 5 ] 6}
Add @jay-es/vue-sort-components
to the plugins section of your .eslintrc
configuration file.
1{ 2 "plugins": ["@jay-es/vue-sort-components"] 3}
Then configure the rule under the rules section.
1{ 2 "rules": { 3 "@jay-es/vue-sort-components/vue-sort-components": "error" 4 } 5}
This rule checks property definitions of object expressions named components
and verifies that all keys are sorted alphabetically.
:thumbsdown: Examples of incorrect code for this rule:
1export default defineComponent({ 2 components: { Foo, Bar, Baz }, 3}); 4 5// spreads must be grouped at the top 6export default defineComponent({ 7 components: { Bar, Baz, Foo, ...others }, 8}); 9 10// not only in Vue-specific context 11const myObject = { 12 components: { Foo, Bar, Baz }, 13};
:thumbsup: Examples of correct code for this rule:
1export default defineComponent({ 2 components: { Bar, Baz, Foo }, 3}); 4 5// spreads must be grouped at the top 6export default defineComponent({ 7 components: { ...others, Bar, Baz, Foo }, 8}); 9 10// not only in Vue-specific context 11const myObject = { 12 components: { Bar, Baz, Foo }, 13};
This rule accepts a configuration object:
1{ 2 "@jay-es/vue-sort-components/vue-sort-components": ["error", { sortSpreads: false }] 3}
sortSpreads
- if true
, enforce spread properties to be sorted. Default is false
.:thumbsdown: Examples of incorrect code for the { sortSpreads: true }
option:
1export default defineComponent({ 2 components: { ...others2, ...others1, Bar, Baz }, 3});
:thumbsup: Examples of correct code for the { sortSpreads: true }
option:
1export default defineComponent({ 2 components: { ...others1, ...others2, Bar, Baz }, 3});
No vulnerabilities found.
No security vulnerabilities found.