Skip to content
This repository was archived by the owner on Nov 22, 2020. It is now read-only.

Commit 5c1c44c

Browse files
committed
Update stats and lint rules
1 parent a32b618 commit 5c1c44c

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

.eslintrc.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ module.exports = {
4646
'array-callback-return': 'error',
4747
complexity: 'warn',
4848
'consistent-return': 'error',
49-
curly: ['error', 'multi-line', 'consistent'],
49+
curly: ['error', 'multi'],
5050
'dot-location': ['error', 'property'],
5151
'dot-notation': 'error',
5252
eqeqeq: 'error',
@@ -121,7 +121,6 @@ module.exports = {
121121
'no-trailing-spaces': 'error',
122122
'no-unneeded-ternary': 'error',
123123
'no-whitespace-before-property': 'error',
124-
'nonblock-statement-body-position': 'error',
125124
'object-curly-spacing': ['error', 'always'],
126125
'operator-assignment': 'error',
127126
'operator-linebreak': ['error', 'after'],

src/components/Stats.vue

+10
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@
1616
<h3>{{ contributors }}</h3>
1717
<span>Contributors</span>
1818
</a>
19+
<a v-if="usedBy" href="https://github.com/dbots-pkg/dbots.js/network/dependents?package_id=UGFja2FnZS0zNzA1MzQ1MA%3D%3D" class="stat-card">
20+
<h3>{{ usedBy }}</h3>
21+
<span>GitHub repos using dbots.js</span>
22+
</a>
1923
<a href="https://github.com/dbots-pkg/dbots.js/commits/master" class="stat-card">
2024
<h3>{{ commits }}</h3>
2125
<span>Commits to master</span>
@@ -58,6 +62,7 @@ const data = {
5862
forks: '',
5963
commits: '100+',
6064
versions: '10+',
65+
usedBy: '10+',
6166
size: '~24',
6267
fetching: false,
6368
};
@@ -86,6 +91,7 @@ export default {
8691
commiters,
8792
versions,
8893
size,
94+
usedBy,
8995
] = await Promise.all([
9096
fetch(
9197
'https://api.npmjs.org/downloads/range/2013-08-21:2100-08-21/dbots'
@@ -104,6 +110,7 @@ export default {
104110
fetch(
105111
'https://bundlephobia.com/api/size?package=dbots&record=true'
106112
).then(json, noop),
113+
fetch('https://api.snaz.in/v2/github/used-by/dbots-pkg/dbots.js').then(json, noop),
107114
]);
108115
109116
if (downloads) {
@@ -137,6 +144,9 @@ export default {
137144
138145
if (size)
139146
this.size = (size.size / 1000).toFixed(1);
147+
148+
if (usedBy)
149+
this.usedBy = usedBy.used_by.value.toLocaleString();
140150
},
141151
},
142152
};

0 commit comments

Comments
 (0)