Skip to content

Commit

Permalink
Merge branch 'anuraghazra:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
kapsner authored Oct 4, 2023
2 parents 3d9e41a + 558af5c commit 83c2b9c
Show file tree
Hide file tree
Showing 96 changed files with 8,947 additions and 3,347 deletions.
235 changes: 235 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,235 @@
{
"env": {
"node": true,
"browser": true,
"es2021": true
},
"extends": [
// "eslint:recommended",
"prettier"
],
"parserOptions": {
"sourceType": "module",
"ecmaVersion": 2022
},
"rules": {
// Possible Errors (overrides from recommended set)

// "no-extra-parens": "error",
"no-unexpected-multiline": "error",

// All JSDoc comments must be valid

"valid-jsdoc": [ "error", {
"requireReturn": true,
"requireReturnDescription": true,
"requireParamDescription": true,
"prefer": {
"return": "returns"
}
}],

// Best Practices

// Allowed a getter without setter, but all setters require getters

"accessor-pairs": [ "error", {
"getWithoutSet": false,
"setWithoutGet": true
}],
"block-scoped-var": "warn",
"consistent-return": "error",
"curly": "error",
// "default-case": "warn",

// the dot goes with the property when doing multiline

// "dot-location": [ "warn", "property" ],
// "dot-notation": "warn",
// "eqeqeq": [ "error", "smart" ],
// "guard-for-in": "warn",
// "no-alert": "error",
// "no-caller": "error",
// "no-case-declarations": "warn",
// "no-div-regex": "warn",
// "no-else-return": "warn",
// "no-empty-label": "warn",
// "no-empty-pattern": "warn",
// "no-eq-null": "warn",
// "no-eval": "error",
// "no-extend-native": "error",
// "no-extra-bind": "warn",
// "no-floating-decimal": "warn",
// "no-implicit-coercion": [ "warn", {
// "boolean": true,
// "number": true,
// "string": true
// }],
// "no-implied-eval": "error",
// "no-invalid-this": "error",
// "no-iterator": "error",
// "no-labels": "warn",
// "no-lone-blocks": "warn",
// "no-loop-func": "error",
// "no-magic-numbers": "warn",
// "no-multi-spaces": "error",
// "no-multi-str": "warn",
// "no-native-reassign": "error",
// "no-new-func": "error",
// "no-new-wrappers": "error",
// "no-new": "error",
// "no-octal-escape": "error",
// "no-param-reassign": "error",
// "no-process-env": "warn",
// "no-proto": "error",
// "no-redeclare": "error",
// "no-return-assign": "error",
// "no-script-url": "error",
// "no-self-compare": "error",
// "no-throw-literal": "error",
// "no-unused-expressions": "error",
// "no-useless-call": "error",
// "no-useless-concat": "error",
// "no-void": "warn",

// Produce warnings when something is commented as TODO or FIXME

"no-warning-comments": [ "warn", {
"terms": [ "TODO", "FIXME" ],
"location": "start"
}],
// "no-with": "warn",
// "radix": "warn",
// "vars-on-top": "error",

// Enforces the style of wrapped functions
// "wrap-iife": [ "error", "outside" ],
// "yoda": "error",

// Strict Mode - for ES6, never use strict.
// "strict": [ "error", "never" ],

// Variables

// "init-declarations": [ "error", "always" ],
// "no-catch-shadow": "warn",
// "no-delete-var": "error",
// "no-label-var": "error",
// "no-shadow-restricted-names": "error",
// "no-shadow": "warn",

// We require all vars to be initialized (see init-declarations)
// If we NEED a var to be initialized to undefined, it needs to be explicit

"no-undef-init": "off",
"no-undef": "error",
"no-undefined": "off",
"no-unused-vars": "warn",

// Disallow hoisting - let & const don't allow hoisting anyhow

"no-use-before-define": "error",

// Node.js and CommonJS

// "callback-return": [ "warn", [ "callback", "next" ]],
// "global-require": "error",
// "handle-callback-err": "warn",
// "no-mixed-requires": "warn",
// "no-new-require": "error",

// Use path.concat instead

// "no-path-concat": "error",
// "no-process-exit": "error",
// "no-restricted-modules": "off",
// "no-sync": "warn",

// ECMAScript 6 support

// "arrow-body-style": [ "error", "always" ],
// "arrow-parens": [ "error", "always" ],
// "arrow-spacing": [ "error", { "before": true, "after": true }],
// "constructor-super": "error",
// "generator-star-spacing": [ "error", "before" ],
// "no-arrow-condition": "error",
// "no-class-assign": "error",
// "no-const-assign": "error",
// "no-dupe-class-members": "error",
"no-this-before-super": "error",
// "no-var": "warn",
"object-shorthand": [ "warn" ],
// "prefer-arrow-callback": "warn",
// "prefer-spread": "warn",
// "prefer-template": "warn",
// "require-yield": "error",

// Stylistic - everything here is a warning because of style.

// "array-bracket-spacing": [ "warn", "always" ],
// "block-spacing": [ "warn", "always" ],
// "brace-style": [ "warn", "1tbs", { "allowSingleLine": false } ],
// "camelcase": "warn",
// "comma-spacing": [ "warn", { "before": false, "after": true } ],
// "comma-style": [ "warn", "last" ],
// "computed-property-spacing": [ "warn", "never" ],
// "consistent-this": [ "warn", "self" ],
// "eol-last": "warn",
// "func-names": "warn",
// "func-style": [ "warn", "declaration" ],
// "id-length": [ "warn", { "min": 2, "max": 32 } ],
// "indent": [ "warn", 4 ],
// "jsx-quotes": [ "warn", "prefer-double" ],
// "linebreak-style": [ "warn", "unix" ],
// "lines-around-comment": [ "warn", { "beforeBlockComment": true } ],
// "max-depth": [ "warn", 8 ],
// "max-len": [ "warn", 132 ],
// "max-nested-callbacks": [ "warn", 8 ],
// "max-params": [ "warn", 8 ],
// "new-cap": "warn",
// "new-parens": "warn",
// "no-array-constructor": "warn",
// "no-bitwise": "off",
// "no-continue": "off",
// "no-inline-comments": "off",
// "no-lonely-if": "warn",
// "no-mixed-spaces-and-tabs": "warn",
// "no-multiple-empty-lines": "warn",
// "no-negated-condition": "off",
// "no-nested-ternary": "warn",
// "no-new-object": "warn",
// "no-plusplus": "off",
// "no-spaced-func": "warn",
// "no-ternary": "off",
// "no-trailing-spaces": "warn",
// "no-underscore-dangle": "warn",
"no-unneeded-ternary": "warn",
// "object-curly-spacing": [ "warn", "always" ],
// "one-var": "off",
// "operator-assignment": [ "warn", "never" ],
// "operator-linebreak": [ "warn", "after" ],
// "padded-blocks": [ "warn", "never" ],
// "quote-props": [ "warn", "consistent-as-needed" ],
// "quotes": [ "warn", "single" ],
"require-jsdoc": [ "warn", {
"require": {
"FunctionDeclaration": true,
"MethodDefinition": true,
"ClassDeclaration": false
}
}]
// "semi-spacing": [ "warn", { "before": false, "after": true }],
// "semi": [ "error", "always" ],
// "sort-vars": "off",
// "space-after-keywords": [ "warn", "always" ],
// "space-before-blocks": [ "warn", "always" ],
// "space-before-function-paren": [ "warn", "never" ],
// "space-before-keywords": [ "warn", "always" ],
// "space-in-parens": [ "warn", "never" ],
// "space-infix-ops": [ "warn", { "int32Hint": true } ],
// "space-return-throw-case": "error",
// "space-unary-ops": "error",
// "spaced-comment": [ "warn", "always" ],
// "wrap-regex": "warn"
}
}
15 changes: 15 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
version: 2
updates:
# Maintain dependencies for NPM
- package-ecosystem: npm
directory: "/"
schedule:
interval: weekly
open-pull-requests-limit: 10

# Maintain dependencies for GitHub Actions
- package-ecosystem: github-actions
directory: "/"
schedule:
interval: weekly
open-pull-requests-limit: 10
52 changes: 50 additions & 2 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,52 @@
themes: themes/index.js
doc-translation: docs/*
card-i18n: src/translations.js
documentation: readme.md
card-i18n:
- src/translations.js
- src/common/I18n.js
documentation:
- readme.md
- CONTRIBUTING.md
- CODE_OF_CONDUCT.md
- SECURITY.md
dependencies:
- package.json
- package-lock.json
lang-card:
- api/top-langs.js
- src/cards/top-languages-card.js
- src/fetchers/top-languages-fetcher.js
- tests/fetchTopLanguages.test.js
- tests/renderTopLanguagesCard.test.js
- tests/top-langs.test.js
repo-card:
- api/pin.js
- src/cards/repo-card.js
- src/fetchers/repo-fetcher.js
- tests/fetchRepo.test.js
- tests/renderRepoCard.test.js
- tests/pin.test.js
stats-card:
- api/index.js
- src/cards/stats-card.js
- src/fetchers/stats-fetcher.js
- tests/fetchStats.test.js
- tests/renderStatsCard.test.js
- tests/api.test.js
wakatime-card:
- api/wakatime.js
- src/cards/wakatime-card.js
- src/fetchers/wakatime-fetcher.js
- tests/fetchWakatime.test.js
- tests/renderWakatimeCard.test.js
gist-card:
- api/gist.js
- src/cards/gist-card.js
- src/fetchers/gist-fetcher.js
- tests/fetchGist.test.js
- tests/renderGistCard.test.js
- tests/gist.test.js
ranks: src/calculateRank.js
ci:
- .github/workflows/*
- scripts/*
infrastructure: .eslintrc.js
4 changes: 2 additions & 2 deletions .github/workflows/deploy-prep.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ jobs:
if: github.repository == 'anuraghazra/github-readme-stats'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
- name: Deployment Prep
run: python ./.github/workflows/deploy-prep.py
- uses: stefanzweifel/git-auto-commit-action@v4
- uses: stefanzweifel/git-auto-commit-action@3ea6ae190baf489ba007f7c92608f33ce20ef04a # v4.16.0
with:
branch: vercel
create_branch: true
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/e2e-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ name: Test Deployment
on:
deployment_status:

permissions: read-all

jobs:
e2eTests:
if:
Expand All @@ -12,13 +14,13 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.x]
node-version: [18.x]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0

- name: Setup Node
uses: actions/setup-node@v3
uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1
with:
node-version: ${{ matrix.node-version }}
cache: npm
Expand Down
19 changes: 17 additions & 2 deletions .github/workflows/empty-issues-closer.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,31 @@ on:
- opened
- edited

permissions:
actions: read
checks: read
contents: read
deployments: read
issues: write
discussions: read
packages: read
pages: read
pull-requests: read
repository-projects: read
security-events: read
statuses: read

jobs:
closeEmptyIssuesAndTemplates:
if: github.repository == 'anuraghazra/github-readme-stats'
name: Close empty issues
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3 # NOTE: Retrieve issue templates.
# NOTE: Retrieve issue templates.
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0

- name: Run empty issues closer action
uses: rickstaa/empty-issues-closer-action@v1
uses: rickstaa/empty-issues-closer-action@c73b7528ed1cc311e72b65fe6f270d96548355ff # v1.1.25
env:
github_token: ${{ secrets.GITHUB_TOKEN }}
with:
Expand Down
Loading

1 comment on commit 83c2b9c

@vercel
Copy link

@vercel vercel bot commented on 83c2b9c Oct 4, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.