Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ end_of_line = lf
indent_size = 2
indent_style = tab
insert_final_newline = true
max_line_length = 130
max_line_length = 155
trim_trailing_whitespace = true

[*.md]
max_line_length = 130
max_line_length = 155
trim_trailing_whitespace = true
55 changes: 29 additions & 26 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,27 +1,30 @@
{
"env": {
"browser": true,
"commonjs": true,
"es2021": true
},
"extends": [
"eslint:recommended",
"airbnb-base"
],
"parserOptions": {
"ecmaVersion": 12
},
"rules": {
"indent": ["error", "tab"],
"no-tabs": ["error", { "allowIndentationTabs": true }],
"max-len": ["error", { "code": 130 }],
"no-var": "error",
"semi": "error",
"no-multi-spaces": "error",
"space-in-parens": "error",
"no-multiple-empty-lines": "error",
"prefer-const": "error",
"no-use-before-define": "error"
}
}

"env": {
"browser": true,
"commonjs": true,
"es2021": true
},
"extends": ["eslint:recommended", "airbnb-base"],
"parserOptions": {
"ecmaVersion": 12
},
"rules": {
"indent": ["error", "tab"],
"no-tabs": ["warn", { "allowIndentationTabs": true }],
"max-len": ["error", { "code": 155 }],
"no-var": "error",
"semi": "error",
"no-multi-spaces": "error",
"space-in-parens": "error",
"no-multiple-empty-lines": "error",
"prefer-const": "error",
"no-use-before-define": "error",
"max-classes-per-file": ["warn", 1],
"no-plusplus": "off",
"no-param-reassign": "warn",
"no-restricted-syntax": "warn",
"no-continue": "warn",
"no-bitwise": "off",
"guard-for-in": "warn"
}
}
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ install:
- npm install
script:
- npm run test
- npm run lint
- eslint src test --ext .js
12 changes: 8 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,15 @@
"version": "1.0.0",
"description": "Solutions for HackerRank Problems in Javascript.",
"main": "index.js",
"nyc": {
"all": true,
"include": [
"src/**/*.js"
]
},
"scripts": {
"test": "mocha --recursive",
"report": "nyc mocha --recursive",
"prepare": "husky install",
"lint": "prettier --write **/*.*js && eslint --fix "
"test": "nyc mocha --recursive",
"prepare": "husky install"
},
"lint-staged": {
"*.js": [
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion test/Arrays/birthday-cake-candles.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const birthdayCakeCandles = require("../../Arrays/birthday-cake-candles");
const birthdayCakeCandles = require("../../src/Arrays/birthday-cake-candles");
const { describe, it } = require("mocha");
const { expect } = require("chai");

Expand Down
2 changes: 1 addition & 1 deletion test/Arrays/left-rotation.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const leftRotation = require('../../Arrays/left-rotation')
const leftRotation = require('../../src/Arrays/left-rotation')
const { describe, it } = require('mocha')
const { expect } = require('chai')

Expand Down
2 changes: 1 addition & 1 deletion test/Data Structures/cycle-detection.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const { hasCycle, Node } = require('../../Data Structures/cycle-detection');
const { hasCycle, Node } = require('../../src/Data Structures/cycle-detection');
const { describe, it } = require('mocha');
const { expect } = require('chai');

Expand Down
2 changes: 1 addition & 1 deletion test/Data Structures/reverse-doubly-linked-list.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const { reverse, DoublyLinkedListNode, DoublyLinkedList } = require('../../Data Structures/reverse-doubly-linked-list');
const { reverse, DoublyLinkedListNode, DoublyLinkedList } = require('../../src/Data Structures/reverse-doubly-linked-list');
const { describe, it } = require('mocha')
const { expect } = require('chai')

Expand Down
2 changes: 1 addition & 1 deletion test/Numbers/plus-minus.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const plusMinus = require('../../Numbers/plus-minus')
const plusMinus = require('../../src/Numbers/plus-minus')
const { describe, it } = require('mocha')
const { expect } = require('chai')

Expand Down
2 changes: 1 addition & 1 deletion test/Strings/hackerrank-in-string.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const hackerrankInString = require("../../Strings/hackerrank-in-string");
const hackerrankInString = require("../../src/Strings/hackerrank-in-string");
const { describe, it } = require("mocha");
const { expect } = require("chai");

Expand Down
2 changes: 1 addition & 1 deletion test/Strings/repeated-string.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const repeatedString = require("../../Strings/repeated-string");
const repeatedString = require("../../src/Strings/repeated-string");
const { describe, it } = require("mocha");
const { expect } = require("chai");

Expand Down
2 changes: 1 addition & 1 deletion test/Strings/strong-password.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const passwordStrengthMinimumNumber = require("../../Strings/strong-password");
const passwordStrengthMinimumNumber = require("../../src/Strings/strong-password");
const { describe, it } = require("mocha");
const { expect } = require("chai");

Expand Down
2 changes: 1 addition & 1 deletion test/Strings/time-conversion.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const timeConversion = require("../../Strings/time-conversion");
const timeConversion = require("../../src/Strings/time-conversion");
const { describe, it } = require("mocha");
const { expect } = require("chai");

Expand Down