Skip to content

Commit 684ee84

Browse files
committed
merge PR from anuraghazra#2459
Enhance project configuration, dependencies, and docs - Updated ESLint configurations and GitHub Actions workflows for improved code quality and maintainability. - Upgraded dependencies in `package-lock.json` and `package.json`, including major packages like `axios` and `dotenv`. - Enhanced README files in multiple languages to improve clarity and usability. - Introduced new themes and updated translations in `translations.js` for better localization support. - Improved error handling and functionality in various scripts, including `wakatime-fetcher.js` and `calculateRank.js`. - Added new utility functions and updated existing ones for better performance and error handling. - Updated tests to reflect changes in the codebase and ensure comprehensive coverage.
2 parents 522ec4b + 19b1a79 commit 684ee84

File tree

110 files changed

+10522
-4188
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

110 files changed

+10522
-4188
lines changed

.eslintrc.json

Lines changed: 234 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,234 @@
1+
// {
2+
// "env": {
3+
// "node": true,
4+
// "browser": true,
5+
// "es2021": true
6+
// },
7+
// "extends": [
8+
// // "eslint:recommended",
9+
// "prettier"
10+
// ],
11+
// "parserOptions": {
12+
// "sourceType": "module",
13+
// "ecmaVersion": 2022
14+
// },
15+
// "rules": {
16+
// // Possible Errors (overrides from recommended set)
17+
18+
// // "no-extra-parens": "error",
19+
// "no-unexpected-multiline": "error",
20+
21+
// // All JSDoc comments must be valid
22+
23+
// "valid-jsdoc": [ "error", {
24+
// "requireReturn": true,
25+
// "requireReturnDescription": true,
26+
// "requireParamDescription": true,
27+
// "prefer": {
28+
// "return": "returns"
29+
// }
30+
// }],
31+
32+
// // Best Practices
33+
34+
// // Allowed a getter without setter, but all setters require getters
35+
36+
// "accessor-pairs": [ "error", {
37+
// "getWithoutSet": false,
38+
// "setWithoutGet": true
39+
// }],
40+
// "block-scoped-var": "warn",
41+
// "consistent-return": "error",
42+
// "curly": "error",
43+
// // "default-case": "warn",
44+
45+
// // the dot goes with the property when doing multiline
46+
47+
// // "dot-location": [ "warn", "property" ],
48+
// // "dot-notation": "warn",
49+
// // "eqeqeq": [ "error", "smart" ],
50+
// // "guard-for-in": "warn",
51+
// "no-alert": "error",
52+
// "no-caller": "error",
53+
// // "no-case-declarations": "warn",
54+
// // "no-div-regex": "warn",
55+
// // "no-else-return": "warn",
56+
// // "no-empty-label": "warn",
57+
// // "no-empty-pattern": "warn",
58+
// // "no-eq-null": "warn",
59+
// // "no-eval": "error",
60+
// // "no-extend-native": "error",
61+
// // "no-extra-bind": "warn",
62+
// // "no-floating-decimal": "warn",
63+
// // "no-implicit-coercion": [ "warn", {
64+
// // "boolean": true,
65+
// // "number": true,
66+
// // "string": true
67+
// // }],
68+
// // "no-implied-eval": "error",
69+
// // "no-invalid-this": "error",
70+
// // "no-iterator": "error",
71+
// // "no-labels": "warn",
72+
// // "no-lone-blocks": "warn",
73+
// // "no-loop-func": "error",
74+
// // "no-magic-numbers": "warn",
75+
// // "no-multi-spaces": "error",
76+
// // "no-multi-str": "warn",
77+
// // "no-native-reassign": "error",
78+
// // "no-new-func": "error",
79+
// // "no-new-wrappers": "error",
80+
// // "no-new": "error",
81+
// // "no-octal-escape": "error",
82+
// // "no-param-reassign": "error",
83+
// // "no-process-env": "warn",
84+
// // "no-proto": "error",
85+
// // "no-redeclare": "error",
86+
// // "no-return-assign": "error",
87+
// // "no-script-url": "error",
88+
// // "no-self-compare": "error",
89+
// // "no-throw-literal": "error",
90+
// // "no-unused-expressions": "error",
91+
// // "no-useless-call": "error",
92+
// // "no-useless-concat": "error",
93+
// // "no-void": "warn",
94+
95+
// // Produce warnings when something is commented as TODO or FIXME
96+
97+
// "no-warning-comments": [ "warn", {
98+
// "terms": [ "TODO", "FIXME" ],
99+
// "location": "start"
100+
// }],
101+
// "no-with": "warn",
102+
// "radix": "warn",
103+
// // "vars-on-top": "error",
104+
105+
// // Enforces the style of wrapped functions
106+
// // "wrap-iife": [ "error", "outside" ],
107+
// // "yoda": "error",
108+
109+
// // Strict Mode - for ES6, never use strict.
110+
// // "strict": [ "error", "never" ],
111+
112+
// // Variables
113+
114+
// // "init-declarations": [ "error", "always" ],
115+
// // "no-catch-shadow": "warn",
116+
// "no-delete-var": "error",
117+
// // "no-label-var": "error",
118+
// // "no-shadow-restricted-names": "error",
119+
// // "no-shadow": "warn",
120+
121+
// // We require all vars to be initialized (see init-declarations)
122+
// // If we NEED a var to be initialized to undefined, it needs to be explicit
123+
124+
// "no-undef-init": "off",
125+
// "no-undef": "error",
126+
// "no-undefined": "off",
127+
// "no-unused-vars": "warn",
128+
129+
// // Disallow hoisting - let & const don't allow hoisting anyhow
130+
131+
// "no-use-before-define": "error",
132+
133+
// // Node.js and CommonJS
134+
135+
// // "callback-return": [ "warn", [ "callback", "next" ]],
136+
// // "global-require": "error",
137+
// // "handle-callback-err": "warn",
138+
// // "no-mixed-requires": "warn",
139+
// // "no-new-require": "error",
140+
141+
// // Use path.concat instead
142+
143+
// // "no-path-concat": "error",
144+
// // "no-process-exit": "error",
145+
// // "no-restricted-modules": "off",
146+
// // "no-sync": "warn",
147+
148+
// // ECMAScript 6 support
149+
150+
// // "arrow-body-style": [ "error", "always" ],
151+
// // "arrow-parens": [ "error", "always" ],
152+
// // "arrow-spacing": [ "error", { "before": true, "after": true }],
153+
// "constructor-super": "error",
154+
// // "generator-star-spacing": [ "error", "before" ],
155+
// // "no-arrow-condition": "error",
156+
// "no-class-assign": "error",
157+
// "no-const-assign": "error",
158+
// "no-dupe-class-members": "error",
159+
// "no-this-before-super": "error",
160+
// // "no-var": "warn",
161+
// "object-shorthand": [ "warn" ],
162+
// // "prefer-arrow-callback": "warn",
163+
// // "prefer-spread": "warn",
164+
// // "prefer-template": "warn",
165+
// // "require-yield": "error",
166+
167+
// // Stylistic - everything here is a warning because of style.
168+
169+
// // "array-bracket-spacing": [ "warn", "always" ],
170+
// // "block-spacing": [ "warn", "always" ],
171+
// // "brace-style": [ "warn", "1tbs", { "allowSingleLine": false } ],
172+
// // "camelcase": "warn",
173+
// // "comma-spacing": [ "warn", { "before": false, "after": true } ],
174+
// // "comma-style": [ "warn", "last" ],
175+
// // "computed-property-spacing": [ "warn", "never" ],
176+
// // "consistent-this": [ "warn", "self" ],
177+
// // "eol-last": "warn",
178+
// // "func-names": "warn",
179+
// // "func-style": [ "warn", "declaration" ],
180+
// // "id-length": [ "warn", { "min": 2, "max": 32 } ],
181+
// // "indent": [ "warn", 4 ],
182+
// // "jsx-quotes": [ "warn", "prefer-double" ],
183+
// // "linebreak-style": [ "warn", "unix" ],
184+
// // "lines-around-comment": [ "warn", { "beforeBlockComment": true } ],
185+
// // "max-depth": [ "warn", 8 ],
186+
// // "max-len": [ "warn", 132 ],
187+
// // "max-nested-callbacks": [ "warn", 8 ],
188+
// // "max-params": [ "warn", 8 ],
189+
// // "new-cap": "warn",
190+
// // "new-parens": "warn",
191+
// // "no-array-constructor": "warn",
192+
// // "no-bitwise": "off",
193+
// // "no-continue": "off",
194+
// // "no-inline-comments": "off",
195+
// // "no-lonely-if": "warn",
196+
// "no-mixed-spaces-and-tabs": "warn",
197+
// "no-multiple-empty-lines": "warn",
198+
// "no-negated-condition": "warn",
199+
// // "no-nested-ternary": "warn",
200+
// // "no-new-object": "warn",
201+
// // "no-plusplus": "off",
202+
// // "no-spaced-func": "warn",
203+
// // "no-ternary": "off",
204+
// // "no-trailing-spaces": "warn",
205+
// // "no-underscore-dangle": "warn",
206+
// "no-unneeded-ternary": "warn",
207+
// // "object-curly-spacing": [ "warn", "always" ],
208+
// // "one-var": "off",
209+
// // "operator-assignment": [ "warn", "never" ],
210+
// // "operator-linebreak": [ "warn", "after" ],
211+
// // "padded-blocks": [ "warn", "never" ],
212+
// // "quote-props": [ "warn", "consistent-as-needed" ],
213+
// // "quotes": [ "warn", "single" ],
214+
// "require-jsdoc": [ "warn", {
215+
// "require": {
216+
// "FunctionDeclaration": true,
217+
// "MethodDefinition": true,
218+
// "ClassDeclaration": false
219+
// }
220+
// }],
221+
// // "semi-spacing": [ "warn", { "before": false, "after": true }],
222+
// // "semi": [ "error", "always" ],
223+
// // "sort-vars": "off",
224+
// "keyword-spacing": ["error", { "before": true, "after": true }]
225+
// // "space-before-blocks": [ "warn", "always" ],
226+
// // "space-before-function-paren": [ "warn", "never" ],
227+
// // "space-in-parens": [ "warn", "never" ],
228+
// // "space-infix-ops": [ "warn", { "int32Hint": true } ],
229+
// // "space-return-throw-case": "error",
230+
// // "space-unary-ops": "error",
231+
// // "spaced-comment": [ "warn", "always" ],
232+
// // "wrap-regex": "warn"
233+
// }
234+
// }

.github/dependabot.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
version: 2
2+
updates:
3+
# Maintain dependencies for NPM
4+
- package-ecosystem: npm
5+
directory: "/"
6+
schedule:
7+
interval: weekly
8+
open-pull-requests-limit: 10
9+
commit-message:
10+
prefix: "build(deps)"
11+
prefix-development: "build(deps-dev)"
12+
reviewers:
13+
- "qwerty541"
14+
15+
# Maintain dependencies for GitHub Actions
16+
- package-ecosystem: github-actions
17+
directory: "/"
18+
schedule:
19+
interval: weekly
20+
open-pull-requests-limit: 10
21+
commit-message:
22+
prefix: "ci(deps)"
23+
prefix-development: "ci(deps-dev)"
24+
reviewers:
25+
- "qwerty541"

.github/labeler.yml

Lines changed: 95 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,95 @@
1-
themes: themes/index.js
2-
doc-translation: docs/*
3-
card-i18n: src/translations.js
4-
documentation: readme.md
1+
themes:
2+
- changed-files:
3+
- any-glob-to-any-file:
4+
- themes/index.js
5+
6+
doc-translation:
7+
- changed-files:
8+
- any-glob-to-any-file:
9+
- docs/*
10+
11+
card-i18n:
12+
- changed-files:
13+
- any-glob-to-any-file:
14+
- src/translations.js
15+
- src/common/I18n.js
16+
17+
documentation:
18+
- changed-files:
19+
- any-glob-to-any-file:
20+
- readme.md
21+
- CONTRIBUTING.md
22+
- CODE_OF_CONDUCT.md
23+
- SECURITY.md
24+
25+
dependencies:
26+
- changed-files:
27+
- any-glob-to-any-file:
28+
- package.json
29+
- package-lock.json
30+
31+
lang-card:
32+
- changed-files:
33+
- any-glob-to-any-file:
34+
- api/top-langs.js
35+
- src/cards/top-languages-card.js
36+
- src/fetchers/top-languages-fetcher.js
37+
- tests/fetchTopLanguages.test.js
38+
- tests/renderTopLanguagesCard.test.js
39+
- tests/top-langs.test.js
40+
41+
repo-card:
42+
- changed-files:
43+
- any-glob-to-any-file:
44+
- api/pin.js
45+
- src/cards/repo-card.js
46+
- src/fetchers/repo-fetcher.js
47+
- tests/fetchRepo.test.js
48+
- tests/renderRepoCard.test.js
49+
- tests/pin.test.js
50+
51+
stats-card:
52+
- changed-files:
53+
- any-glob-to-any-file:
54+
- api/index.js
55+
- src/cards/stats-card.js
56+
- src/fetchers/stats-fetcher.js
57+
- tests/fetchStats.test.js
58+
- tests/renderStatsCard.test.js
59+
- tests/api.test.js
60+
61+
wakatime-card:
62+
- changed-files:
63+
- any-glob-to-any-file:
64+
- api/wakatime.js
65+
- src/cards/wakatime-card.js
66+
- src/fetchers/wakatime-fetcher.js
67+
- tests/fetchWakatime.test.js
68+
- tests/renderWakatimeCard.test.js
69+
- tests/wakatime.test.js
70+
71+
gist-card:
72+
- changed-files:
73+
- any-glob-to-any-file:
74+
- api/gist.js
75+
- src/cards/gist-card.js
76+
- src/fetchers/gist-fetcher.js
77+
- tests/fetchGist.test.js
78+
- tests/renderGistCard.test.js
79+
- tests/gist.test.js
80+
81+
ranks:
82+
- changed-files:
83+
- any-glob-to-any-file:
84+
- src/calculateRank.js
85+
86+
ci:
87+
- changed-files:
88+
- any-glob-to-any-file:
89+
- .github/workflows/*
90+
- scripts/*
91+
92+
infrastructure:
93+
- changed-files:
94+
- any-glob-to-any-file:
95+
- .eslintrc.json

0 commit comments

Comments
 (0)