repo
stringlengths
5
106
file_url
stringlengths
78
301
file_path
stringlengths
4
211
content
stringlengths
0
32.8k
language
stringclasses
1 value
license
stringclasses
7 values
commit_sha
stringlengths
40
40
retrieved_at
stringdate
2026-01-04 14:56:49
2026-01-05 02:23:25
truncated
bool
2 classes
leonardomso/33-js-concepts
https://github.com/leonardomso/33-js-concepts/blob/5cda73bac940173b77d19a23a208fea234ca6c33/index.js
index.js
/* 33 JavaScript Concepts is a project created to help JavaScript developers master their skills. It is a compilation of fundamental JavaScript concepts that are important and fundamental. This project was inspired by an article written by Stephen Curtis. Any kind of contribution is welcome. Feel free ...
javascript
MIT
5cda73bac940173b77d19a23a208fea234ca6c33
2026-01-04T14:56:49.684692Z
false
leonardomso/33-js-concepts
https://github.com/leonardomso/33-js-concepts/blob/5cda73bac940173b77d19a23a208fea234ca6c33/vitest.config.js
vitest.config.js
import { defineConfig } from 'vitest/config' export default defineConfig({ test: { include: ['tests/**/*.test.js'], globals: false, environment: 'node' } })
javascript
MIT
5cda73bac940173b77d19a23a208fea234ca6c33
2026-01-04T14:56:49.684692Z
false
leonardomso/33-js-concepts
https://github.com/leonardomso/33-js-concepts/blob/5cda73bac940173b77d19a23a208fea234ca6c33/tests/async-javascript/callbacks/callbacks.test.js
tests/async-javascript/callbacks/callbacks.test.js
import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest' describe('Callbacks', () => { // ============================================================ // OPENING EXAMPLES // From callbacks.mdx lines 9-22, 139-155 // ============================================================ describe('...
javascript
MIT
5cda73bac940173b77d19a23a208fea234ca6c33
2026-01-04T14:56:49.684692Z
true
leonardomso/33-js-concepts
https://github.com/leonardomso/33-js-concepts/blob/5cda73bac940173b77d19a23a208fea234ca6c33/tests/async-javascript/callbacks/callbacks.dom.test.js
tests/async-javascript/callbacks/callbacks.dom.test.js
/** * @vitest-environment jsdom */ import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest' // ============================================================ // DOM EVENT HANDLER CALLBACKS // From callbacks.mdx lines 401-434 // Pattern 1: Event Handlers // ==============================================...
javascript
MIT
5cda73bac940173b77d19a23a208fea234ca6c33
2026-01-04T14:56:49.684692Z
false
leonardomso/33-js-concepts
https://github.com/leonardomso/33-js-concepts/blob/5cda73bac940173b77d19a23a208fea234ca6c33/tests/functional-programming/higher-order-functions/higher-order-functions.test.js
tests/functional-programming/higher-order-functions/higher-order-functions.test.js
import { describe, it, expect, vi } from 'vitest' describe('Higher-Order Functions', () => { describe('Functions that accept functions as arguments', () => { it('should execute the passed function', () => { const mockFn = vi.fn() function doTwice(action) { action() action() ...
javascript
MIT
5cda73bac940173b77d19a23a208fea234ca6c33
2026-01-04T14:56:49.684692Z
false
leonardomso/33-js-concepts
https://github.com/leonardomso/33-js-concepts/blob/5cda73bac940173b77d19a23a208fea234ca6c33/tests/functional-programming/map-reduce-filter/map-reduce-filter.test.js
tests/functional-programming/map-reduce-filter/map-reduce-filter.test.js
import { describe, it, expect } from 'vitest' describe('map, reduce, filter', () => { describe('map()', () => { it('should transform every element in the array', () => { const numbers = [1, 2, 3, 4] const doubled = numbers.map(n => n * 2) expect(doubled).toEqual([2, 4, 6, 8]) }) ...
javascript
MIT
5cda73bac940173b77d19a23a208fea234ca6c33
2026-01-04T14:56:49.684692Z
false
leonardomso/33-js-concepts
https://github.com/leonardomso/33-js-concepts/blob/5cda73bac940173b77d19a23a208fea234ca6c33/tests/functional-programming/pure-functions/pure-functions.test.js
tests/functional-programming/pure-functions/pure-functions.test.js
import { describe, it, expect } from 'vitest' describe('Pure Functions', () => { describe('Rule 1: Same Input → Same Output', () => { it('should always return the same result for the same inputs', () => { // Pure function: deterministic function add(a, b) { return a + b } expect(...
javascript
MIT
5cda73bac940173b77d19a23a208fea234ca6c33
2026-01-04T14:56:49.684692Z
false
leonardomso/33-js-concepts
https://github.com/leonardomso/33-js-concepts/blob/5cda73bac940173b77d19a23a208fea234ca6c33/tests/functional-programming/recursion/recursion.test.js
tests/functional-programming/recursion/recursion.test.js
import { describe, it, expect } from 'vitest' import { JSDOM } from 'jsdom' describe('Recursion', () => { describe('Base Case Handling', () => { it('should return immediately when base case is met', () => { function countdown(n) { if (n <= 0) return 'done' return countdown(n - 1) } ...
javascript
MIT
5cda73bac940173b77d19a23a208fea234ca6c33
2026-01-04T14:56:49.684692Z
false
leonardomso/33-js-concepts
https://github.com/leonardomso/33-js-concepts/blob/5cda73bac940173b77d19a23a208fea234ca6c33/tests/functional-programming/currying-composition/currying-composition.test.js
tests/functional-programming/currying-composition/currying-composition.test.js
import { describe, it, expect } from 'vitest' describe('Currying & Composition', () => { describe('Basic Currying', () => { describe('Manual Currying with Arrow Functions', () => { it('should create a curried function with arrow syntax', () => { const add = a => b => c => a + b + c ...
javascript
MIT
5cda73bac940173b77d19a23a208fea234ca6c33
2026-01-04T14:56:49.684692Z
true
leonardomso/33-js-concepts
https://github.com/leonardomso/33-js-concepts/blob/5cda73bac940173b77d19a23a208fea234ca6c33/tests/web-platform/http-fetch/http-fetch.test.js
tests/web-platform/http-fetch/http-fetch.test.js
import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest' // ============================================================================= // HTTP & FETCH - TEST SUITE // Tests for code examples from docs/concepts/http-fetch.mdx // Uses Node 20+ native fetch with Vitest mocking // ======================...
javascript
MIT
5cda73bac940173b77d19a23a208fea234ca6c33
2026-01-04T14:56:49.684692Z
true
leonardomso/33-js-concepts
https://github.com/leonardomso/33-js-concepts/blob/5cda73bac940173b77d19a23a208fea234ca6c33/tests/web-platform/dom/dom.test.js
tests/web-platform/dom/dom.test.js
/** * @vitest-environment jsdom */ import { describe, it, expect, beforeEach } from 'vitest' // ============================================================================= // DOM AND LAYOUT TREES - TEST SUITE // Tests for code examples from docs/concepts/dom.mdx // ================================================...
javascript
MIT
5cda73bac940173b77d19a23a208fea234ca6c33
2026-01-04T14:56:49.684692Z
true
leonardomso/33-js-concepts
https://github.com/leonardomso/33-js-concepts/blob/5cda73bac940173b77d19a23a208fea234ca6c33/tests/advanced-topics/data-structures/data-structures.test.js
tests/advanced-topics/data-structures/data-structures.test.js
import { describe, it, expect } from 'vitest' describe('Data Structures', () => { describe('Arrays', () => { it('should access elements by index in O(1)', () => { const arr = ['a', 'b', 'c', 'd', 'e'] expect(arr[0]).toBe('a') expect(arr[2]).toBe('c') expect(arr[4]).toBe('e') })...
javascript
MIT
5cda73bac940173b77d19a23a208fea234ca6c33
2026-01-04T14:56:49.684692Z
false
leonardomso/33-js-concepts
https://github.com/leonardomso/33-js-concepts/blob/5cda73bac940173b77d19a23a208fea234ca6c33/tests/advanced-topics/modern-js-syntax/modern-js-syntax.test.js
tests/advanced-topics/modern-js-syntax/modern-js-syntax.test.js
import { describe, it, expect } from 'vitest' describe('Modern JavaScript Syntax (ES6+)', () => { // =========================================== // ARROW FUNCTIONS // =========================================== describe('Arrow Functions', () => { it('should have concise syntax for single expressions', (...
javascript
MIT
5cda73bac940173b77d19a23a208fea234ca6c33
2026-01-04T14:56:49.684692Z
false
leonardomso/33-js-concepts
https://github.com/leonardomso/33-js-concepts/blob/5cda73bac940173b77d19a23a208fea234ca6c33/tests/advanced-topics/regular-expressions/regular-expressions.test.js
tests/advanced-topics/regular-expressions/regular-expressions.test.js
import { describe, it, expect } from 'vitest' describe('Regular Expressions', () => { describe('Creating Regex', () => { it('should create regex with literal syntax', () => { const pattern = /hello/ expect(pattern.test('hello world')).toBe(true) expect(pattern.test('world')).toBe(false) }) ...
javascript
MIT
5cda73bac940173b77d19a23a208fea234ca6c33
2026-01-04T14:56:49.684692Z
false
leonardomso/33-js-concepts
https://github.com/leonardomso/33-js-concepts/blob/5cda73bac940173b77d19a23a208fea234ca6c33/tests/advanced-topics/es-modules/es-modules.test.js
tests/advanced-topics/es-modules/es-modules.test.js
import { describe, it, expect, vi } from 'vitest' describe('ES Modules', () => { // =========================================== // Part 1: Live Bindings // =========================================== describe('Part 1: Live Bindings', () => { describe('ESM Live Bindings vs CommonJS Value Copies', () => { ...
javascript
MIT
5cda73bac940173b77d19a23a208fea234ca6c33
2026-01-04T14:56:49.684692Z
true
leonardomso/33-js-concepts
https://github.com/leonardomso/33-js-concepts/blob/5cda73bac940173b77d19a23a208fea234ca6c33/tests/advanced-topics/algorithms-big-o/algorithms-big-o.test.js
tests/advanced-topics/algorithms-big-o/algorithms-big-o.test.js
import { describe, it, expect } from 'vitest' // ============================================ // SEARCHING ALGORITHMS // ============================================ // Linear Search - O(n) function linearSearch(arr, target) { for (let i = 0; i < arr.length; i++) { if (arr[i] === target) return i } return -...
javascript
MIT
5cda73bac940173b77d19a23a208fea234ca6c33
2026-01-04T14:56:49.684692Z
false
leonardomso/33-js-concepts
https://github.com/leonardomso/33-js-concepts/blob/5cda73bac940173b77d19a23a208fea234ca6c33/tests/advanced-topics/design-patterns/design-patterns.test.js
tests/advanced-topics/design-patterns/design-patterns.test.js
import { describe, it, expect, vi, beforeEach } from 'vitest' describe('Design Patterns', () => { describe('Module Pattern', () => { it('should encapsulate private state using closures', () => { // IIFE-based module pattern const Counter = (function () { let count = 0 // Private variable ...
javascript
MIT
5cda73bac940173b77d19a23a208fea234ca6c33
2026-01-04T14:56:49.684692Z
false
leonardomso/33-js-concepts
https://github.com/leonardomso/33-js-concepts/blob/5cda73bac940173b77d19a23a208fea234ca6c33/tests/advanced-topics/error-handling/error-handling.test.js
tests/advanced-topics/error-handling/error-handling.test.js
import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest' describe('Error Handling', () => { // ============================================================ // TRY/CATCH/FINALLY BASICS // ============================================================ describe('try/catch/finally Basics', () =...
javascript
MIT
5cda73bac940173b77d19a23a208fea234ca6c33
2026-01-04T14:56:49.684692Z
false
leonardomso/33-js-concepts
https://github.com/leonardomso/33-js-concepts/blob/5cda73bac940173b77d19a23a208fea234ca6c33/tests/functions-execution/event-loop/event-loop.test.js
tests/functions-execution/event-loop/event-loop.test.js
import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest' describe('Event Loop, Timers and Scheduling', () => { // ============================================================ // SYNCHRONOUS EXECUTION // ============================================================ describe('Synchronous Exe...
javascript
MIT
5cda73bac940173b77d19a23a208fea234ca6c33
2026-01-04T14:56:49.684692Z
true
leonardomso/33-js-concepts
https://github.com/leonardomso/33-js-concepts/blob/5cda73bac940173b77d19a23a208fea234ca6c33/tests/functions-execution/async-await/async-await.test.js
tests/functions-execution/async-await/async-await.test.js
import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest' describe('async/await', () => { // ============================================================ // THE async KEYWORD // ============================================================ describe('The async Keyword', () => { it('shoul...
javascript
MIT
5cda73bac940173b77d19a23a208fea234ca6c33
2026-01-04T14:56:49.684692Z
false
leonardomso/33-js-concepts
https://github.com/leonardomso/33-js-concepts/blob/5cda73bac940173b77d19a23a208fea234ca6c33/tests/functions-execution/promises/promises.test.js
tests/functions-execution/promises/promises.test.js
import { describe, it, expect, vi } from 'vitest' describe('Promises', () => { describe('Basic Promise Creation', () => { it('should create a fulfilled Promise with resolve()', async () => { const promise = new Promise((resolve) => { resolve('success') }) const result = await pro...
javascript
MIT
5cda73bac940173b77d19a23a208fea234ca6c33
2026-01-04T14:56:49.684692Z
false
leonardomso/33-js-concepts
https://github.com/leonardomso/33-js-concepts/blob/5cda73bac940173b77d19a23a208fea234ca6c33/tests/functions-execution/generators-iterators/generators-iterators.test.js
tests/functions-execution/generators-iterators/generators-iterators.test.js
import { describe, it, expect } from 'vitest' describe('Generators & Iterators', () => { describe('Basic Iterator Protocol', () => { it('should follow the iterator protocol with { value, done }', () => { function createIterator(arr) { let index = 0 return { next() { if...
javascript
MIT
5cda73bac940173b77d19a23a208fea234ca6c33
2026-01-04T14:56:49.684692Z
false
leonardomso/33-js-concepts
https://github.com/leonardomso/33-js-concepts/blob/5cda73bac940173b77d19a23a208fea234ca6c33/tests/functions-execution/iife-modules/iife-modules.test.js
tests/functions-execution/iife-modules/iife-modules.test.js
import { describe, it, expect, vi } from 'vitest' describe('IIFE, Modules and Namespaces', () => { // =========================================== // Part 1: IIFE — The Self-Running Function // =========================================== describe('Part 1: IIFE — The Self-Running Function', () => { describe...
javascript
MIT
5cda73bac940173b77d19a23a208fea234ca6c33
2026-01-04T14:56:49.684692Z
true
leonardomso/33-js-concepts
https://github.com/leonardomso/33-js-concepts/blob/5cda73bac940173b77d19a23a208fea234ca6c33/tests/fundamentals/primitive-types/primitive-types.test.js
tests/fundamentals/primitive-types/primitive-types.test.js
import { describe, it, expect } from 'vitest' describe('Primitive Types', () => { describe('String', () => { it('should create strings with single quotes, double quotes, and backticks', () => { let single = 'Hello' let double = "World" let backtick = `Hello World` expect(single).toBe('He...
javascript
MIT
5cda73bac940173b77d19a23a208fea234ca6c33
2026-01-04T14:56:49.684692Z
false
leonardomso/33-js-concepts
https://github.com/leonardomso/33-js-concepts/blob/5cda73bac940173b77d19a23a208fea234ca6c33/tests/fundamentals/scope-and-closures/scope-and-closures.test.js
tests/fundamentals/scope-and-closures/scope-and-closures.test.js
import { describe, it, expect } from 'vitest' describe('Scope and Closures', () => { describe('Scope Basics', () => { describe('Preventing Naming Conflicts', () => { it('should keep variables separate in different functions', () => { function countApples() { let count = 0 count+...
javascript
MIT
5cda73bac940173b77d19a23a208fea234ca6c33
2026-01-04T14:56:49.684692Z
false
leonardomso/33-js-concepts
https://github.com/leonardomso/33-js-concepts/blob/5cda73bac940173b77d19a23a208fea234ca6c33/tests/fundamentals/type-coercion/type-coercion.test.js
tests/fundamentals/type-coercion/type-coercion.test.js
import { describe, it, expect } from 'vitest' describe('Type Coercion', () => { describe('Explicit vs Implicit Coercion', () => { describe('Explicit Coercion', () => { it('should convert to number explicitly', () => { expect(Number("42")).toBe(42) expect(parseInt("42px")).toBe(42) e...
javascript
MIT
5cda73bac940173b77d19a23a208fea234ca6c33
2026-01-04T14:56:49.684692Z
false
leonardomso/33-js-concepts
https://github.com/leonardomso/33-js-concepts/blob/5cda73bac940173b77d19a23a208fea234ca6c33/tests/fundamentals/equality-operators/equality-operators.test.js
tests/fundamentals/equality-operators/equality-operators.test.js
import { describe, it, expect } from 'vitest' describe('Equality and Type Checking', () => { describe('Three Equality Operators Overview', () => { it('should demonstrate different results for same comparison', () => { const num = 1 const str = "1" expect(num == str).toBe(true) // coerces strin...
javascript
MIT
5cda73bac940173b77d19a23a208fea234ca6c33
2026-01-04T14:56:49.684692Z
false
leonardomso/33-js-concepts
https://github.com/leonardomso/33-js-concepts/blob/5cda73bac940173b77d19a23a208fea234ca6c33/tests/fundamentals/javascript-engines/javascript-engines.test.js
tests/fundamentals/javascript-engines/javascript-engines.test.js
import { describe, it, expect } from 'vitest' describe('JavaScript Engines', () => { describe('Basic Examples from Documentation', () => { it('should demonstrate basic function execution (opening example)', () => { // From the opening of the documentation function greet(name) { return "Hello,...
javascript
MIT
5cda73bac940173b77d19a23a208fea234ca6c33
2026-01-04T14:56:49.684692Z
false
leonardomso/33-js-concepts
https://github.com/leonardomso/33-js-concepts/blob/5cda73bac940173b77d19a23a208fea234ca6c33/tests/fundamentals/value-reference-types/value-reference-types.test.js
tests/fundamentals/value-reference-types/value-reference-types.test.js
import { describe, it, expect } from 'vitest' describe('Value Types and Reference Types', () => { describe('Copying Primitives', () => { it('should create independent copies when copying primitives', () => { let a = 10 let b = a // b gets a COPY of the value 10 b = 20 // changing b has NO effe...
javascript
MIT
5cda73bac940173b77d19a23a208fea234ca6c33
2026-01-04T14:56:49.684692Z
false
leonardomso/33-js-concepts
https://github.com/leonardomso/33-js-concepts/blob/5cda73bac940173b77d19a23a208fea234ca6c33/tests/fundamentals/call-stack/call-stack.test.js
tests/fundamentals/call-stack/call-stack.test.js
import { describe, it, expect } from 'vitest' describe('Call Stack', () => { describe('Basic Function Calls', () => { it('should execute nested function calls and return correct greeting', () => { function createGreeting(name) { return "Hello, " + name + "!" } function greet(name) { ...
javascript
MIT
5cda73bac940173b77d19a23a208fea234ca6c33
2026-01-04T14:56:49.684692Z
false
leonardomso/33-js-concepts
https://github.com/leonardomso/33-js-concepts/blob/5cda73bac940173b77d19a23a208fea234ca6c33/tests/object-oriented/this-call-apply-bind/this-call-apply-bind.test.js
tests/object-oriented/this-call-apply-bind/this-call-apply-bind.test.js
import { describe, it, expect } from 'vitest' describe('this, call, apply and bind', () => { describe('Documentation Examples', () => { describe('Introduction: The Pronoun I Analogy', () => { it('should demonstrate this referring to different objects', () => { const alice = { name: "Al...
javascript
MIT
5cda73bac940173b77d19a23a208fea234ca6c33
2026-01-04T14:56:49.684692Z
true
leonardomso/33-js-concepts
https://github.com/leonardomso/33-js-concepts/blob/5cda73bac940173b77d19a23a208fea234ca6c33/tests/object-oriented/inheritance-polymorphism/inheritance-polymorphism.test.js
tests/object-oriented/inheritance-polymorphism/inheritance-polymorphism.test.js
import { describe, it, expect } from 'vitest' describe('Inheritance & Polymorphism', () => { // ============================================================ // BASE CLASSES FOR TESTING // ============================================================ class Character { constructor(name, health = 100) { ...
javascript
MIT
5cda73bac940173b77d19a23a208fea234ca6c33
2026-01-04T14:56:49.684692Z
false
leonardomso/33-js-concepts
https://github.com/leonardomso/33-js-concepts/blob/5cda73bac940173b77d19a23a208fea234ca6c33/tests/object-oriented/factories-classes/factories-classes.test.js
tests/object-oriented/factories-classes/factories-classes.test.js
import { describe, it, expect } from 'vitest' describe('Factories and Classes', () => { // =========================================== // Opening Example: Factory vs Class // =========================================== describe('Opening Example: Factory vs Class', () => { it('should create objects with fa...
javascript
MIT
5cda73bac940173b77d19a23a208fea234ca6c33
2026-01-04T14:56:49.684692Z
true
leonardomso/33-js-concepts
https://github.com/leonardomso/33-js-concepts/blob/5cda73bac940173b77d19a23a208fea234ca6c33/tests/object-oriented/object-creation-prototypes/object-creation-prototypes.test.js
tests/object-oriented/object-creation-prototypes/object-creation-prototypes.test.js
import { describe, it, expect } from 'vitest' describe('Object Creation & Prototypes', () => { describe('Opening Hook - Inherited Methods', () => { it('should have inherited methods from Object.prototype', () => { // You create a simple object const player = { name: 'Alice', health: 100 } // B...
javascript
MIT
5cda73bac940173b77d19a23a208fea234ca6c33
2026-01-04T14:56:49.684692Z
false
airbnb/javascript
https://github.com/airbnb/javascript/blob/0e2ef178a26ba9ac3495402a182891ad8096d3a0/packages/eslint-config-airbnb/base.js
packages/eslint-config-airbnb/base.js
module.exports = { extends: ['eslint-config-airbnb-base'].map(require.resolve), rules: {}, };
javascript
MIT
0e2ef178a26ba9ac3495402a182891ad8096d3a0
2026-01-04T14:56:49.223287Z
false
airbnb/javascript
https://github.com/airbnb/javascript/blob/0e2ef178a26ba9ac3495402a182891ad8096d3a0/packages/eslint-config-airbnb/index.js
packages/eslint-config-airbnb/index.js
module.exports = { extends: [ 'eslint-config-airbnb-base', './rules/react', './rules/react-a11y', ].map(require.resolve), rules: {} };
javascript
MIT
0e2ef178a26ba9ac3495402a182891ad8096d3a0
2026-01-04T14:56:49.223287Z
false
airbnb/javascript
https://github.com/airbnb/javascript/blob/0e2ef178a26ba9ac3495402a182891ad8096d3a0/packages/eslint-config-airbnb/legacy.js
packages/eslint-config-airbnb/legacy.js
module.exports = { extends: ['eslint-config-airbnb-base/legacy'].map(require.resolve), rules: {}, };
javascript
MIT
0e2ef178a26ba9ac3495402a182891ad8096d3a0
2026-01-04T14:56:49.223287Z
false
airbnb/javascript
https://github.com/airbnb/javascript/blob/0e2ef178a26ba9ac3495402a182891ad8096d3a0/packages/eslint-config-airbnb/whitespace.js
packages/eslint-config-airbnb/whitespace.js
/* eslint global-require: 0 */ const { isArray } = Array; const { entries } = Object; const { CLIEngine } = require('eslint'); if (CLIEngine) { /* eslint no-inner-declarations: 0 */ const whitespaceRules = require('./whitespaceRules'); const baseConfig = require('.'); const severities = ['off', 'warn', 'err...
javascript
MIT
0e2ef178a26ba9ac3495402a182891ad8096d3a0
2026-01-04T14:56:49.223287Z
false
airbnb/javascript
https://github.com/airbnb/javascript/blob/0e2ef178a26ba9ac3495402a182891ad8096d3a0/packages/eslint-config-airbnb/whitespaceRules.js
packages/eslint-config-airbnb/whitespaceRules.js
module.exports = [ 'array-bracket-newline', 'array-bracket-spacing', 'array-element-newline', 'arrow-spacing', 'block-spacing', 'comma-spacing', 'computed-property-spacing', 'dot-location', 'eol-last', 'func-call-spacing', 'function-paren-newline', 'generator-star-spacing', 'implicit-arrow-lin...
javascript
MIT
0e2ef178a26ba9ac3495402a182891ad8096d3a0
2026-01-04T14:56:49.223287Z
false
airbnb/javascript
https://github.com/airbnb/javascript/blob/0e2ef178a26ba9ac3495402a182891ad8096d3a0/packages/eslint-config-airbnb/hooks.js
packages/eslint-config-airbnb/hooks.js
module.exports = { extends: [ './rules/react-hooks.js', ].map(require.resolve), rules: {} };
javascript
MIT
0e2ef178a26ba9ac3495402a182891ad8096d3a0
2026-01-04T14:56:49.223287Z
false
airbnb/javascript
https://github.com/airbnb/javascript/blob/0e2ef178a26ba9ac3495402a182891ad8096d3a0/packages/eslint-config-airbnb/whitespace-async.js
packages/eslint-config-airbnb/whitespace-async.js
#!/usr/bin/env node const { isArray } = Array; const { entries } = Object; const { ESLint } = require('eslint'); const baseConfig = require('.'); const whitespaceRules = require('./whitespaceRules'); const severities = ['off', 'warn', 'error']; function getSeverity(ruleConfig) { if (isArray(ruleConfig)) { ret...
javascript
MIT
0e2ef178a26ba9ac3495402a182891ad8096d3a0
2026-01-04T14:56:49.223287Z
false
airbnb/javascript
https://github.com/airbnb/javascript/blob/0e2ef178a26ba9ac3495402a182891ad8096d3a0/packages/eslint-config-airbnb/rules/react-hooks.js
packages/eslint-config-airbnb/rules/react-hooks.js
module.exports = { plugins: [ 'react-hooks', ], parserOptions: { ecmaFeatures: { jsx: true, }, }, rules: { // Enforce Rules of Hooks // https://github.com/facebook/react/blob/c11015ff4f610ac2924d1fc6d569a17657a404fd/packages/eslint-plugin-react-hooks/src/RulesOfHooks.js 'react-...
javascript
MIT
0e2ef178a26ba9ac3495402a182891ad8096d3a0
2026-01-04T14:56:49.223287Z
false
airbnb/javascript
https://github.com/airbnb/javascript/blob/0e2ef178a26ba9ac3495402a182891ad8096d3a0/packages/eslint-config-airbnb/rules/react.js
packages/eslint-config-airbnb/rules/react.js
const baseStyleRules = require('eslint-config-airbnb-base/rules/style').rules; const dangleRules = baseStyleRules['no-underscore-dangle']; module.exports = { plugins: [ 'react', ], parserOptions: { ecmaFeatures: { jsx: true, }, }, // View link below for react rules documentation // htt...
javascript
MIT
0e2ef178a26ba9ac3495402a182891ad8096d3a0
2026-01-04T14:56:49.223287Z
false
airbnb/javascript
https://github.com/airbnb/javascript/blob/0e2ef178a26ba9ac3495402a182891ad8096d3a0/packages/eslint-config-airbnb/rules/react-a11y.js
packages/eslint-config-airbnb/rules/react-a11y.js
module.exports = { plugins: [ 'jsx-a11y', 'react' ], parserOptions: { ecmaFeatures: { jsx: true, }, }, rules: { // ensure emoji are accessible // https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/master/docs/rules/accessible-emoji.md // disabled; rule is deprecated ...
javascript
MIT
0e2ef178a26ba9ac3495402a182891ad8096d3a0
2026-01-04T14:56:49.223287Z
false
airbnb/javascript
https://github.com/airbnb/javascript/blob/0e2ef178a26ba9ac3495402a182891ad8096d3a0/packages/eslint-config-airbnb/test/test-base.js
packages/eslint-config-airbnb/test/test-base.js
import fs from 'fs'; import path from 'path'; import test from 'tape'; const base = require('../base'); const files = { base }; const rulesDir = path.join(__dirname, '../rules'); fs.readdirSync(rulesDir).forEach((name) => { if (name === 'react.js' || name === 'react-a11y.js') { return; } // eslint-disable...
javascript
MIT
0e2ef178a26ba9ac3495402a182891ad8096d3a0
2026-01-04T14:56:49.223287Z
false
airbnb/javascript
https://github.com/airbnb/javascript/blob/0e2ef178a26ba9ac3495402a182891ad8096d3a0/packages/eslint-config-airbnb/test/requires.js
packages/eslint-config-airbnb/test/requires.js
/* eslint strict: 0, global-require: 0 */ 'use strict'; const test = require('tape'); test('all entry points parse', (t) => { t.doesNotThrow(() => require('..'), 'index does not throw'); t.doesNotThrow(() => require('../base'), 'base does not throw'); t.doesNotThrow(() => require('../legacy'), 'legacy does not...
javascript
MIT
0e2ef178a26ba9ac3495402a182891ad8096d3a0
2026-01-04T14:56:49.223287Z
false
airbnb/javascript
https://github.com/airbnb/javascript/blob/0e2ef178a26ba9ac3495402a182891ad8096d3a0/packages/eslint-config-airbnb/test/test-react-order.js
packages/eslint-config-airbnb/test/test-react-order.js
import test from 'tape'; import { CLIEngine, ESLint } from 'eslint'; import eslintrc from '..'; import reactRules from '../rules/react'; import reactA11yRules from '../rules/react-a11y'; const rules = { // It is okay to import devDependencies in tests. 'import/no-extraneous-dependencies': [2, { devDependencies: tr...
javascript
MIT
0e2ef178a26ba9ac3495402a182891ad8096d3a0
2026-01-04T14:56:49.223287Z
false
airbnb/javascript
https://github.com/airbnb/javascript/blob/0e2ef178a26ba9ac3495402a182891ad8096d3a0/packages/eslint-config-airbnb-base/index.js
packages/eslint-config-airbnb-base/index.js
module.exports = { extends: [ './rules/best-practices', './rules/errors', './rules/node', './rules/style', './rules/variables', './rules/es6', './rules/imports', './rules/strict', ].map(require.resolve), parserOptions: { ecmaVersion: 2018, sourceType: 'module', }, rules...
javascript
MIT
0e2ef178a26ba9ac3495402a182891ad8096d3a0
2026-01-04T14:56:49.223287Z
false
airbnb/javascript
https://github.com/airbnb/javascript/blob/0e2ef178a26ba9ac3495402a182891ad8096d3a0/packages/eslint-config-airbnb-base/legacy.js
packages/eslint-config-airbnb-base/legacy.js
module.exports = { extends: [ './rules/best-practices', './rules/errors', './rules/node', './rules/style', './rules/variables' ].map(require.resolve), env: { browser: true, node: true, amd: false, mocha: false, jasmine: false }, rules: { 'comma-dangle': ['error', 'n...
javascript
MIT
0e2ef178a26ba9ac3495402a182891ad8096d3a0
2026-01-04T14:56:49.223287Z
false
airbnb/javascript
https://github.com/airbnb/javascript/blob/0e2ef178a26ba9ac3495402a182891ad8096d3a0/packages/eslint-config-airbnb-base/whitespace.js
packages/eslint-config-airbnb-base/whitespace.js
/* eslint global-require: 0 */ const { isArray } = Array; const { entries } = Object; const { CLIEngine } = require('eslint'); if (CLIEngine) { /* eslint no-inner-declarations: 0 */ const whitespaceRules = require('./whitespaceRules'); const baseConfig = require('.'); const severities = ['off', 'warn', 'err...
javascript
MIT
0e2ef178a26ba9ac3495402a182891ad8096d3a0
2026-01-04T14:56:49.223287Z
false
airbnb/javascript
https://github.com/airbnb/javascript/blob/0e2ef178a26ba9ac3495402a182891ad8096d3a0/packages/eslint-config-airbnb-base/whitespaceRules.js
packages/eslint-config-airbnb-base/whitespaceRules.js
module.exports = [ 'array-bracket-newline', 'array-bracket-spacing', 'array-element-newline', 'arrow-spacing', 'block-spacing', 'comma-spacing', 'computed-property-spacing', 'dot-location', 'eol-last', 'func-call-spacing', 'function-paren-newline', 'generator-star-spacing', 'implicit-arrow-lin...
javascript
MIT
0e2ef178a26ba9ac3495402a182891ad8096d3a0
2026-01-04T14:56:49.223287Z
false
airbnb/javascript
https://github.com/airbnb/javascript/blob/0e2ef178a26ba9ac3495402a182891ad8096d3a0/packages/eslint-config-airbnb-base/whitespace-async.js
packages/eslint-config-airbnb-base/whitespace-async.js
#!/usr/bin/env node const { isArray } = Array; const { entries } = Object; const { ESLint } = require('eslint'); const baseConfig = require('.'); const whitespaceRules = require('./whitespaceRules'); const severities = ['off', 'warn', 'error']; function getSeverity(ruleConfig) { if (isArray(ruleConfig)) { ret...
javascript
MIT
0e2ef178a26ba9ac3495402a182891ad8096d3a0
2026-01-04T14:56:49.223287Z
false
airbnb/javascript
https://github.com/airbnb/javascript/blob/0e2ef178a26ba9ac3495402a182891ad8096d3a0/packages/eslint-config-airbnb-base/rules/best-practices.js
packages/eslint-config-airbnb-base/rules/best-practices.js
module.exports = { rules: { // enforces getter/setter pairs in objects // https://eslint.org/docs/rules/accessor-pairs 'accessor-pairs': 'off', // enforces return statements in callbacks of array's methods // https://eslint.org/docs/rules/array-callback-return 'array-callback-return': ['error...
javascript
MIT
0e2ef178a26ba9ac3495402a182891ad8096d3a0
2026-01-04T14:56:49.223287Z
false
airbnb/javascript
https://github.com/airbnb/javascript/blob/0e2ef178a26ba9ac3495402a182891ad8096d3a0/packages/eslint-config-airbnb-base/rules/variables.js
packages/eslint-config-airbnb-base/rules/variables.js
const confusingBrowserGlobals = require('confusing-browser-globals'); module.exports = { rules: { // enforce or disallow variable initializations at definition 'init-declarations': 'off', // disallow the catch clause parameter name being the same as a variable in the outer scope 'no-catch-shadow': '...
javascript
MIT
0e2ef178a26ba9ac3495402a182891ad8096d3a0
2026-01-04T14:56:49.223287Z
false
airbnb/javascript
https://github.com/airbnb/javascript/blob/0e2ef178a26ba9ac3495402a182891ad8096d3a0/packages/eslint-config-airbnb-base/rules/strict.js
packages/eslint-config-airbnb-base/rules/strict.js
module.exports = { rules: { // babel inserts `'use strict';` for us strict: ['error', 'never'] } };
javascript
MIT
0e2ef178a26ba9ac3495402a182891ad8096d3a0
2026-01-04T14:56:49.223287Z
false
airbnb/javascript
https://github.com/airbnb/javascript/blob/0e2ef178a26ba9ac3495402a182891ad8096d3a0/packages/eslint-config-airbnb-base/rules/style.js
packages/eslint-config-airbnb-base/rules/style.js
module.exports = { rules: { // enforce line breaks after opening and before closing array brackets // https://eslint.org/docs/rules/array-bracket-newline // TODO: enable? semver-major 'array-bracket-newline': ['off', 'consistent'], // object option alternative: { multiline: true, minItems: 3 } //...
javascript
MIT
0e2ef178a26ba9ac3495402a182891ad8096d3a0
2026-01-04T14:56:49.223287Z
false
airbnb/javascript
https://github.com/airbnb/javascript/blob/0e2ef178a26ba9ac3495402a182891ad8096d3a0/packages/eslint-config-airbnb-base/rules/imports.js
packages/eslint-config-airbnb-base/rules/imports.js
module.exports = { env: { es6: true }, parserOptions: { ecmaVersion: 6, sourceType: 'module' }, plugins: [ 'import' ], settings: { 'import/resolver': { node: { extensions: ['.mjs', '.js', '.json'] } }, 'import/extensions': [ '.js', '.mjs', ...
javascript
MIT
0e2ef178a26ba9ac3495402a182891ad8096d3a0
2026-01-04T14:56:49.223287Z
false
airbnb/javascript
https://github.com/airbnb/javascript/blob/0e2ef178a26ba9ac3495402a182891ad8096d3a0/packages/eslint-config-airbnb-base/rules/es6.js
packages/eslint-config-airbnb-base/rules/es6.js
module.exports = { env: { es6: true }, parserOptions: { ecmaVersion: 6, sourceType: 'module', ecmaFeatures: { generators: false, objectLiteralDuplicateProperties: false } }, rules: { // enforces no braces where they can be omitted // https://eslint.org/docs/rules/arrow...
javascript
MIT
0e2ef178a26ba9ac3495402a182891ad8096d3a0
2026-01-04T14:56:49.223287Z
false
airbnb/javascript
https://github.com/airbnb/javascript/blob/0e2ef178a26ba9ac3495402a182891ad8096d3a0/packages/eslint-config-airbnb-base/rules/node.js
packages/eslint-config-airbnb-base/rules/node.js
module.exports = { env: { node: true }, rules: { // enforce return after a callback 'callback-return': 'off', // require all requires be top-level // https://eslint.org/docs/rules/global-require 'global-require': 'error', // enforces error handling in callbacks (node environment) ...
javascript
MIT
0e2ef178a26ba9ac3495402a182891ad8096d3a0
2026-01-04T14:56:49.223287Z
false
airbnb/javascript
https://github.com/airbnb/javascript/blob/0e2ef178a26ba9ac3495402a182891ad8096d3a0/packages/eslint-config-airbnb-base/rules/errors.js
packages/eslint-config-airbnb-base/rules/errors.js
module.exports = { rules: { // Enforce “for” loop update clause moving the counter in the right direction // https://eslint.org/docs/rules/for-direction 'for-direction': 'error', // Enforces that a return statement is present in property getters // https://eslint.org/docs/rules/getter-return ...
javascript
MIT
0e2ef178a26ba9ac3495402a182891ad8096d3a0
2026-01-04T14:56:49.223287Z
false
airbnb/javascript
https://github.com/airbnb/javascript/blob/0e2ef178a26ba9ac3495402a182891ad8096d3a0/packages/eslint-config-airbnb-base/test/test-base.js
packages/eslint-config-airbnb-base/test/test-base.js
import fs from 'fs'; import path from 'path'; import test from 'tape'; import index from '..'; const files = { ...{ index } }; // object spread is to test parsing const rulesDir = path.join(__dirname, '../rules'); fs.readdirSync(rulesDir).forEach((name) => { // eslint-disable-next-line import/no-dynamic-require ...
javascript
MIT
0e2ef178a26ba9ac3495402a182891ad8096d3a0
2026-01-04T14:56:49.223287Z
false
airbnb/javascript
https://github.com/airbnb/javascript/blob/0e2ef178a26ba9ac3495402a182891ad8096d3a0/packages/eslint-config-airbnb-base/test/requires.js
packages/eslint-config-airbnb-base/test/requires.js
/* eslint strict: 0, global-require: 0 */ 'use strict'; const test = require('tape'); test('all entry points parse', (t) => { t.doesNotThrow(() => require('..'), 'index does not throw'); t.doesNotThrow(() => require('../legacy'), 'legacy does not throw'); t.doesNotThrow(() => require('../whitespace'), 'whitesp...
javascript
MIT
0e2ef178a26ba9ac3495402a182891ad8096d3a0
2026-01-04T14:56:49.223287Z
false
anuraghazra/github-readme-stats
https://github.com/anuraghazra/github-readme-stats/blob/8108ba1417faaad7182399e01dd724777adc63e5/express.js
express.js
import "dotenv/config"; import statsCard from "./api/index.js"; import repoCard from "./api/pin.js"; import langCard from "./api/top-langs.js"; import wakatimeCard from "./api/wakatime.js"; import gistCard from "./api/gist.js"; import express from "express"; const app = express(); const router = express.Router(); rou...
javascript
MIT
8108ba1417faaad7182399e01dd724777adc63e5
2026-01-04T14:56:49.628708Z
false
anuraghazra/github-readme-stats
https://github.com/anuraghazra/github-readme-stats/blob/8108ba1417faaad7182399e01dd724777adc63e5/jest.e2e.config.js
jest.e2e.config.js
export default { clearMocks: true, transform: {}, testEnvironment: "node", coverageProvider: "v8", testMatch: ["<rootDir>/tests/e2e/**/*.test.js"], };
javascript
MIT
8108ba1417faaad7182399e01dd724777adc63e5
2026-01-04T14:56:49.628708Z
false
anuraghazra/github-readme-stats
https://github.com/anuraghazra/github-readme-stats/blob/8108ba1417faaad7182399e01dd724777adc63e5/jest.bench.config.js
jest.bench.config.js
export default { clearMocks: true, transform: {}, testEnvironment: "jsdom", coverageProvider: "v8", testPathIgnorePatterns: ["<rootDir>/node_modules/", "<rootDir>/tests/e2e/"], modulePathIgnorePatterns: ["<rootDir>/node_modules/", "<rootDir>/tests/e2e/"], coveragePathIgnorePatterns: [ "<rootDir>/node_...
javascript
MIT
8108ba1417faaad7182399e01dd724777adc63e5
2026-01-04T14:56:49.628708Z
false
anuraghazra/github-readme-stats
https://github.com/anuraghazra/github-readme-stats/blob/8108ba1417faaad7182399e01dd724777adc63e5/jest.config.js
jest.config.js
export default { clearMocks: true, transform: {}, testEnvironment: "jsdom", coverageProvider: "v8", testPathIgnorePatterns: ["<rootDir>/node_modules/", "<rootDir>/tests/e2e/"], modulePathIgnorePatterns: ["<rootDir>/node_modules/", "<rootDir>/tests/e2e/"], coveragePathIgnorePatterns: [ "<rootDir>/node_...
javascript
MIT
8108ba1417faaad7182399e01dd724777adc63e5
2026-01-04T14:56:49.628708Z
false
anuraghazra/github-readme-stats
https://github.com/anuraghazra/github-readme-stats/blob/8108ba1417faaad7182399e01dd724777adc63e5/scripts/generate-theme-doc.js
scripts/generate-theme-doc.js
import fs from "fs"; import { themes } from "../themes/index.js"; const TARGET_FILE = "./themes/README.md"; const REPO_CARD_LINKS_FLAG = "<!-- REPO_CARD_LINKS -->"; const STAT_CARD_LINKS_FLAG = "<!-- STATS_CARD_LINKS -->"; const STAT_CARD_TABLE_FLAG = "<!-- STATS_CARD_TABLE -->"; const REPO_CARD_TABLE_FLAG = "<!-- RE...
javascript
MIT
8108ba1417faaad7182399e01dd724777adc63e5
2026-01-04T14:56:49.628708Z
false
anuraghazra/github-readme-stats
https://github.com/anuraghazra/github-readme-stats/blob/8108ba1417faaad7182399e01dd724777adc63e5/scripts/close-stale-theme-prs.js
scripts/close-stale-theme-prs.js
/** * @file Script that can be used to close stale theme PRs that have a `invalid` label. */ import * as dotenv from "dotenv"; dotenv.config(); import { debug, setFailed } from "@actions/core"; import github from "@actions/github"; import { RequestError } from "@octokit/request-error"; import { getGithubToken, getRe...
javascript
MIT
8108ba1417faaad7182399e01dd724777adc63e5
2026-01-04T14:56:49.628708Z
false
anuraghazra/github-readme-stats
https://github.com/anuraghazra/github-readme-stats/blob/8108ba1417faaad7182399e01dd724777adc63e5/scripts/preview-theme.js
scripts/preview-theme.js
/** * @file This script is used to preview the theme on theme PRs. */ import * as dotenv from "dotenv"; dotenv.config(); import { debug, setFailed } from "@actions/core"; import github from "@actions/github"; import ColorContrastChecker from "color-contrast-checker"; import { info } from "console"; import Hjson from...
javascript
MIT
8108ba1417faaad7182399e01dd724777adc63e5
2026-01-04T14:56:49.628708Z
false
anuraghazra/github-readme-stats
https://github.com/anuraghazra/github-readme-stats/blob/8108ba1417faaad7182399e01dd724777adc63e5/scripts/generate-langs-json.js
scripts/generate-langs-json.js
import axios from "axios"; import fs from "fs"; import jsYaml from "js-yaml"; const LANGS_FILEPATH = "./src/common/languageColors.json"; //Retrieve languages from github linguist repository yaml file //@ts-ignore axios .get( "https://raw.githubusercontent.com/github/linguist/master/lib/linguist/languages.yml", ...
javascript
MIT
8108ba1417faaad7182399e01dd724777adc63e5
2026-01-04T14:56:49.628708Z
false
anuraghazra/github-readme-stats
https://github.com/anuraghazra/github-readme-stats/blob/8108ba1417faaad7182399e01dd724777adc63e5/scripts/helpers.js
scripts/helpers.js
/** * @file Contains helper functions used in the scripts. */ import { getInput } from "@actions/core"; const OWNER = "anuraghazra"; const REPO = "github-readme-stats"; /** * Retrieve information about the repository that ran the action. * * @param {Object} ctx Action context. * @returns {Object} Repository in...
javascript
MIT
8108ba1417faaad7182399e01dd724777adc63e5
2026-01-04T14:56:49.628708Z
false
anuraghazra/github-readme-stats
https://github.com/anuraghazra/github-readme-stats/blob/8108ba1417faaad7182399e01dd724777adc63e5/src/index.js
src/index.js
export * from "./common/index.js"; export * from "./cards/index.js";
javascript
MIT
8108ba1417faaad7182399e01dd724777adc63e5
2026-01-04T14:56:49.628708Z
false
anuraghazra/github-readme-stats
https://github.com/anuraghazra/github-readme-stats/blob/8108ba1417faaad7182399e01dd724777adc63e5/src/calculateRank.js
src/calculateRank.js
/** * Calculates the exponential cdf. * * @param {number} x The value. * @returns {number} The exponential cdf. */ function exponential_cdf(x) { return 1 - 2 ** -x; } /** * Calculates the log normal cdf. * * @param {number} x The value. * @returns {number} The log normal cdf. */ function log_normal_cdf(x) ...
javascript
MIT
8108ba1417faaad7182399e01dd724777adc63e5
2026-01-04T14:56:49.628708Z
false
anuraghazra/github-readme-stats
https://github.com/anuraghazra/github-readme-stats/blob/8108ba1417faaad7182399e01dd724777adc63e5/src/translations.js
src/translations.js
// @ts-check import { encodeHTML } from "./common/html.js"; /** * Retrieves stat card labels in the available locales. * * @param {object} props Function arguments. * @param {string} props.name The name of the locale. * @param {string} props.apostrophe Whether to use apostrophe or not. * @returns {object} The l...
javascript
MIT
8108ba1417faaad7182399e01dd724777adc63e5
2026-01-04T14:56:49.628708Z
true
anuraghazra/github-readme-stats
https://github.com/anuraghazra/github-readme-stats/blob/8108ba1417faaad7182399e01dd724777adc63e5/src/cards/repo.js
src/cards/repo.js
// @ts-check import { Card } from "../common/Card.js"; import { getCardColors } from "../common/color.js"; import { kFormatter, wrapTextMultiline } from "../common/fmt.js"; import { encodeHTML } from "../common/html.js"; import { I18n } from "../common/I18n.js"; import { icons } from "../common/icons.js"; import { cla...
javascript
MIT
8108ba1417faaad7182399e01dd724777adc63e5
2026-01-04T14:56:49.628708Z
false
anuraghazra/github-readme-stats
https://github.com/anuraghazra/github-readme-stats/blob/8108ba1417faaad7182399e01dd724777adc63e5/src/cards/gist.js
src/cards/gist.js
// @ts-check import { measureText, flexLayout, iconWithLabel, createLanguageNode, } from "../common/render.js"; import Card from "../common/Card.js"; import { getCardColors } from "../common/color.js"; import { kFormatter, wrapTextMultiline } from "../common/fmt.js"; import { encodeHTML } from "../common/html....
javascript
MIT
8108ba1417faaad7182399e01dd724777adc63e5
2026-01-04T14:56:49.628708Z
false
anuraghazra/github-readme-stats
https://github.com/anuraghazra/github-readme-stats/blob/8108ba1417faaad7182399e01dd724777adc63e5/src/cards/index.js
src/cards/index.js
export { renderRepoCard } from "./repo.js"; export { renderStatsCard } from "./stats.js"; export { renderTopLanguages } from "./top-languages.js"; export { renderWakatimeCard } from "./wakatime.js";
javascript
MIT
8108ba1417faaad7182399e01dd724777adc63e5
2026-01-04T14:56:49.628708Z
false
anuraghazra/github-readme-stats
https://github.com/anuraghazra/github-readme-stats/blob/8108ba1417faaad7182399e01dd724777adc63e5/src/cards/wakatime.js
src/cards/wakatime.js
// @ts-check import { Card } from "../common/Card.js"; import { getCardColors } from "../common/color.js"; import { I18n } from "../common/I18n.js"; import { clampValue, lowercaseTrim } from "../common/ops.js"; import { createProgressNode, flexLayout } from "../common/render.js"; import { wakatimeCardLocales } from "....
javascript
MIT
8108ba1417faaad7182399e01dd724777adc63e5
2026-01-04T14:56:49.628708Z
false
anuraghazra/github-readme-stats
https://github.com/anuraghazra/github-readme-stats/blob/8108ba1417faaad7182399e01dd724777adc63e5/src/cards/top-languages.js
src/cards/top-languages.js
// @ts-check import { Card } from "../common/Card.js"; import { getCardColors } from "../common/color.js"; import { formatBytes } from "../common/fmt.js"; import { I18n } from "../common/I18n.js"; import { chunkArray, clampValue, lowercaseTrim } from "../common/ops.js"; import { createProgressNode, flexLayout, m...
javascript
MIT
8108ba1417faaad7182399e01dd724777adc63e5
2026-01-04T14:56:49.628708Z
false
anuraghazra/github-readme-stats
https://github.com/anuraghazra/github-readme-stats/blob/8108ba1417faaad7182399e01dd724777adc63e5/src/cards/stats.js
src/cards/stats.js
// @ts-check import { Card } from "../common/Card.js"; import { getCardColors } from "../common/color.js"; import { CustomError } from "../common/error.js"; import { kFormatter } from "../common/fmt.js"; import { I18n } from "../common/I18n.js"; import { icons, rankIcon } from "../common/icons.js"; import { clampValue...
javascript
MIT
8108ba1417faaad7182399e01dd724777adc63e5
2026-01-04T14:56:49.628708Z
false
anuraghazra/github-readme-stats
https://github.com/anuraghazra/github-readme-stats/blob/8108ba1417faaad7182399e01dd724777adc63e5/src/common/envs.js
src/common/envs.js
// @ts-check const whitelist = process.env.WHITELIST ? process.env.WHITELIST.split(",") : undefined; const gistWhitelist = process.env.GIST_WHITELIST ? process.env.GIST_WHITELIST.split(",") : undefined; const excludeRepositories = process.env.EXCLUDE_REPO ? process.env.EXCLUDE_REPO.split(",") : []; expo...
javascript
MIT
8108ba1417faaad7182399e01dd724777adc63e5
2026-01-04T14:56:49.628708Z
false
anuraghazra/github-readme-stats
https://github.com/anuraghazra/github-readme-stats/blob/8108ba1417faaad7182399e01dd724777adc63e5/src/common/ops.js
src/common/ops.js
// @ts-check import toEmoji from "emoji-name-map"; /** * Returns boolean if value is either "true" or "false" else the value as it is. * * @param {string | boolean} value The value to parse. * @returns {boolean | undefined } The parsed value. */ const parseBoolean = (value) => { if (typeof value === "boolean")...
javascript
MIT
8108ba1417faaad7182399e01dd724777adc63e5
2026-01-04T14:56:49.628708Z
false
anuraghazra/github-readme-stats
https://github.com/anuraghazra/github-readme-stats/blob/8108ba1417faaad7182399e01dd724777adc63e5/src/common/index.js
src/common/index.js
// @ts-check export { blacklist } from "./blacklist.js"; export { Card } from "./Card.js"; export { I18n } from "./I18n.js"; export { icons } from "./icons.js"; export { retryer } from "./retryer.js"; export { ERROR_CARD_LENGTH, renderError, flexLayout, measureText, } from "./render.js";
javascript
MIT
8108ba1417faaad7182399e01dd724777adc63e5
2026-01-04T14:56:49.628708Z
false
anuraghazra/github-readme-stats
https://github.com/anuraghazra/github-readme-stats/blob/8108ba1417faaad7182399e01dd724777adc63e5/src/common/cache.js
src/common/cache.js
// @ts-check import { clampValue } from "./ops.js"; const MIN = 60; const HOUR = 60 * MIN; const DAY = 24 * HOUR; /** * Common durations in seconds. */ const DURATIONS = { ONE_MINUTE: MIN, FIVE_MINUTES: 5 * MIN, TEN_MINUTES: 10 * MIN, FIFTEEN_MINUTES: 15 * MIN, THIRTY_MINUTES: 30 * MIN, TWO_HOURS: 2 *...
javascript
MIT
8108ba1417faaad7182399e01dd724777adc63e5
2026-01-04T14:56:49.628708Z
false
anuraghazra/github-readme-stats
https://github.com/anuraghazra/github-readme-stats/blob/8108ba1417faaad7182399e01dd724777adc63e5/src/common/error.js
src/common/error.js
// @ts-check /** * @type {string} A general message to ask user to try again later. */ const TRY_AGAIN_LATER = "Please try again later"; /** * @type {Object<string, string>} A map of error types to secondary error messages. */ const SECONDARY_ERROR_MESSAGES = { MAX_RETRY: "You can deploy own instance or wai...
javascript
MIT
8108ba1417faaad7182399e01dd724777adc63e5
2026-01-04T14:56:49.628708Z
false
anuraghazra/github-readme-stats
https://github.com/anuraghazra/github-readme-stats/blob/8108ba1417faaad7182399e01dd724777adc63e5/src/common/http.js
src/common/http.js
// @ts-check import axios from "axios"; /** * Send GraphQL request to GitHub API. * * @param {import('axios').AxiosRequestConfig['data']} data Request data. * @param {import('axios').AxiosRequestConfig['headers']} headers Request headers. * @returns {Promise<any>} Request response. */ const request = (data, hea...
javascript
MIT
8108ba1417faaad7182399e01dd724777adc63e5
2026-01-04T14:56:49.628708Z
false
anuraghazra/github-readme-stats
https://github.com/anuraghazra/github-readme-stats/blob/8108ba1417faaad7182399e01dd724777adc63e5/src/common/I18n.js
src/common/I18n.js
// @ts-check const FALLBACK_LOCALE = "en"; /** * I18n translation class. */ class I18n { /** * Constructor. * * @param {Object} options Options. * @param {string=} options.locale Locale. * @param {any} options.translations Translations. */ constructor({ locale, translations }) { this.local...
javascript
MIT
8108ba1417faaad7182399e01dd724777adc63e5
2026-01-04T14:56:49.628708Z
false
anuraghazra/github-readme-stats
https://github.com/anuraghazra/github-readme-stats/blob/8108ba1417faaad7182399e01dd724777adc63e5/src/common/blacklist.js
src/common/blacklist.js
const blacklist = [ "renovate-bot", "technote-space", "sw-yx", "YourUsername", "[YourUsername]", ]; export { blacklist }; export default blacklist;
javascript
MIT
8108ba1417faaad7182399e01dd724777adc63e5
2026-01-04T14:56:49.628708Z
false
anuraghazra/github-readme-stats
https://github.com/anuraghazra/github-readme-stats/blob/8108ba1417faaad7182399e01dd724777adc63e5/src/common/render.js
src/common/render.js
// @ts-check import { SECONDARY_ERROR_MESSAGES, TRY_AGAIN_LATER } from "./error.js"; import { getCardColors } from "./color.js"; import { encodeHTML } from "./html.js"; import { clampValue } from "./ops.js"; /** * Auto layout utility, allows us to layout things vertically or horizontally with * proper gaping. * *...
javascript
MIT
8108ba1417faaad7182399e01dd724777adc63e5
2026-01-04T14:56:49.628708Z
false
anuraghazra/github-readme-stats
https://github.com/anuraghazra/github-readme-stats/blob/8108ba1417faaad7182399e01dd724777adc63e5/src/common/retryer.js
src/common/retryer.js
// @ts-check import { CustomError } from "./error.js"; import { logger } from "./log.js"; // Script variables. // Count the number of GitHub API tokens available. const PATs = Object.keys(process.env).filter((key) => /PAT_\d*$/.exec(key), ).length; const RETRIES = process.env.NODE_ENV === "test" ? 7 : PATs; /** ...
javascript
MIT
8108ba1417faaad7182399e01dd724777adc63e5
2026-01-04T14:56:49.628708Z
false
anuraghazra/github-readme-stats
https://github.com/anuraghazra/github-readme-stats/blob/8108ba1417faaad7182399e01dd724777adc63e5/src/common/icons.js
src/common/icons.js
// @ts-check const icons = { star: `<path fill-rule="evenodd" d="M8 .25a.75.75 0 01.673.418l1.882 3.815 4.21.612a.75.75 0 01.416 1.279l-3.046 2.97.719 4.192a.75.75 0 01-1.088.791L8 12.347l-3.766 1.98a.75.75 0 01-1.088-.79l.72-4.194L.818 6.374a.75.75 0 01.416-1.28l4.21-.611L7.327.668A.75.75 0 018 .25zm0 2.445L6.615 5...
javascript
MIT
8108ba1417faaad7182399e01dd724777adc63e5
2026-01-04T14:56:49.628708Z
false
anuraghazra/github-readme-stats
https://github.com/anuraghazra/github-readme-stats/blob/8108ba1417faaad7182399e01dd724777adc63e5/src/common/html.js
src/common/html.js
// @ts-check /** * Encode string as HTML. * * @see https://stackoverflow.com/a/48073476/10629172 * * @param {string} str String to encode. * @returns {string} Encoded string. */ const encodeHTML = (str) => { return str .replace(/[\u00A0-\u9999<>&](?!#)/gim, (i) => { return "&#" + i.charCodeAt(0) + "...
javascript
MIT
8108ba1417faaad7182399e01dd724777adc63e5
2026-01-04T14:56:49.628708Z
false
anuraghazra/github-readme-stats
https://github.com/anuraghazra/github-readme-stats/blob/8108ba1417faaad7182399e01dd724777adc63e5/src/common/color.js
src/common/color.js
// @ts-check import { themes } from "../../themes/index.js"; /** * Checks if a string is a valid hex color. * * @param {string} hexColor String to check. * @returns {boolean} True if the given string is a valid hex color. */ const isValidHexColor = (hexColor) => { return new RegExp( /^([A-Fa-f0-9]{8}|[A-Fa...
javascript
MIT
8108ba1417faaad7182399e01dd724777adc63e5
2026-01-04T14:56:49.628708Z
false
anuraghazra/github-readme-stats
https://github.com/anuraghazra/github-readme-stats/blob/8108ba1417faaad7182399e01dd724777adc63e5/src/common/log.js
src/common/log.js
// @ts-check const noop = () => {}; /** * Return console instance based on the environment. * * @type {Console | {log: () => void, error: () => void}} */ const logger = process.env.NODE_ENV === "test" ? { log: noop, error: noop } : console; export { logger }; export default logger;
javascript
MIT
8108ba1417faaad7182399e01dd724777adc63e5
2026-01-04T14:56:49.628708Z
false
anuraghazra/github-readme-stats
https://github.com/anuraghazra/github-readme-stats/blob/8108ba1417faaad7182399e01dd724777adc63e5/src/common/fmt.js
src/common/fmt.js
// @ts-check import wrap from "word-wrap"; import { encodeHTML } from "./html.js"; /** * Retrieves num with suffix k(thousands) precise to given decimal places. * * @param {number} num The number to format. * @param {number=} precision The number of decimal places to include. * @returns {string|number} The forma...
javascript
MIT
8108ba1417faaad7182399e01dd724777adc63e5
2026-01-04T14:56:49.628708Z
false
anuraghazra/github-readme-stats
https://github.com/anuraghazra/github-readme-stats/blob/8108ba1417faaad7182399e01dd724777adc63e5/src/common/access.js
src/common/access.js
// @ts-check import { renderError } from "./render.js"; import { blacklist } from "./blacklist.js"; import { whitelist, gistWhitelist } from "./envs.js"; const NOT_WHITELISTED_USERNAME_MESSAGE = "This username is not whitelisted"; const NOT_WHITELISTED_GIST_MESSAGE = "This gist ID is not whitelisted"; const BLACKLIST...
javascript
MIT
8108ba1417faaad7182399e01dd724777adc63e5
2026-01-04T14:56:49.628708Z
false
anuraghazra/github-readme-stats
https://github.com/anuraghazra/github-readme-stats/blob/8108ba1417faaad7182399e01dd724777adc63e5/src/common/Card.js
src/common/Card.js
// @ts-check import { encodeHTML } from "./html.js"; import { flexLayout } from "./render.js"; class Card { /** * Creates a new card instance. * * @param {object} args Card arguments. * @param {number=} args.width Card width. * @param {number=} args.height Card height. * @param {number=} args.bord...
javascript
MIT
8108ba1417faaad7182399e01dd724777adc63e5
2026-01-04T14:56:49.628708Z
false
anuraghazra/github-readme-stats
https://github.com/anuraghazra/github-readme-stats/blob/8108ba1417faaad7182399e01dd724777adc63e5/src/fetchers/repo.js
src/fetchers/repo.js
// @ts-check import { MissingParamError } from "../common/error.js"; import { request } from "../common/http.js"; import { retryer } from "../common/retryer.js"; /** * Repo data fetcher. * * @param {object} variables Fetcher variables. * @param {string} token GitHub token. * @returns {Promise<import('axios').Axi...
javascript
MIT
8108ba1417faaad7182399e01dd724777adc63e5
2026-01-04T14:56:49.628708Z
false
anuraghazra/github-readme-stats
https://github.com/anuraghazra/github-readme-stats/blob/8108ba1417faaad7182399e01dd724777adc63e5/src/fetchers/gist.js
src/fetchers/gist.js
// @ts-check import { retryer } from "../common/retryer.js"; import { MissingParamError } from "../common/error.js"; import { request } from "../common/http.js"; const QUERY = ` query gistInfo($gistName: String!) { viewer { gist(name: $gistName) { description owner { ...
javascript
MIT
8108ba1417faaad7182399e01dd724777adc63e5
2026-01-04T14:56:49.628708Z
false
anuraghazra/github-readme-stats
https://github.com/anuraghazra/github-readme-stats/blob/8108ba1417faaad7182399e01dd724777adc63e5/src/fetchers/wakatime.js
src/fetchers/wakatime.js
// @ts-check import axios from "axios"; import { CustomError, MissingParamError } from "../common/error.js"; /** * WakaTime data fetcher. * * @param {{username: string, api_domain: string }} props Fetcher props. * @returns {Promise<import("./types").WakaTimeData>} WakaTime data response. */ const fetchWakatimeSt...
javascript
MIT
8108ba1417faaad7182399e01dd724777adc63e5
2026-01-04T14:56:49.628708Z
false