Skip to content

Commit 894ad47

Browse files
committed
chore: prettier
1 parent 1353882 commit 894ad47

File tree

13 files changed

+48106
-152
lines changed

13 files changed

+48106
-152
lines changed

.pnp.cjs

Lines changed: 45946 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.pnp.loader.mjs

Lines changed: 2126 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.vscode/settings.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,4 @@
77
"titleBar.inactiveForeground": "#ffffff" // change this color!
88
},
99
"editor.fontSize": 13,
10-
"jestrunner.jestCommand": "npm run test:nocov"
1110
}

.yarn/install-state.gz

3.1 MB
Binary file not shown.

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ filing an issue on GitHub.
9595

9696
## Authors
9797

98-
- Nejc Muršič ( [GitHub][github], [LinkedIn][linkedin] )
98+
- Nejc M. ( [GitHub][github], [LinkedIn][linkedin] )
9999

100100
## Contributors
101101

@@ -104,7 +104,7 @@ filing an issue on GitHub.
104104
<!-- markdownlint-disable -->
105105
<table>
106106
<tr>
107-
<td align="center"><a href="/nejcm"><img src="https://avatars3.githubusercontent.com/u/1865210?v=4" width="100px" alt="Nejc"/><br /><sub><b>Nejc Muršič</b></sub></a><br /><a href="/nejcm/js-algorithms/commits?author=nejcm" title="Code">💻</a> <a href="/nejcm/js-algorithms/commits?author=nejcm" title="Documentation">📖</a> <a href="#infra" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a> <a href="/nejcm/js-algorithms/commits?author=nejcm" title="Tests">⚠️</a></td>
107+
<td align="center"><a href="/nejcm"><img src="https://avatars3.githubusercontent.com/u/1865210?v=4" width="100px" alt="Nejc"/><br /><sub><b>Nejc M.</b></sub></a><br /><a href="/nejcm/js-algorithms/commits?author=nejcm" title="Code">💻</a> <a href="/nejcm/js-algorithms/commits?author=nejcm" title="Documentation">📖</a> <a href="#infra" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a> <a href="/nejcm/js-algorithms/commits?author=nejcm" title="Tests">⚠️</a></td>
108108
</tr>
109109
</table>
110110

package.json

Lines changed: 14 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -32,33 +32,28 @@
3232
"clean": "rimraf dist coverage",
3333
"format": "prettier ./src --write",
3434
"lint": "eslint ./src/**/*.{js,jsx,ts,tsx}",
35-
"lint:fix": "npm run lint --fix",
36-
"test": "npm run lint && jest",
35+
"lint:fix": "yarn lint --fix",
36+
"test": "yarn lint && jest",
3737
"test:nocov": "jest --coverage=false",
3838
"test:cov": "jest --coverage --colors && jest-coverage-badges",
3939
"test:build": "jest --coverage --colors --silent && jest-coverage-badges",
4040
"test:watch": "jest --watch",
4141
"docz:clean": "rimraf .docz && docz clean",
4242
"docz:dev": "docz dev",
43-
"docz:build": "npm run docz:clean && docz build",
44-
"start": "npm run docz:dev",
45-
"validate": "npm run format && npm run lint && npm run test:build",
46-
"setup": "npm install && npm run validate",
43+
"docz:build": "yarn docz:clean && docz build",
44+
"start": "yarn docz:dev",
45+
"validate": "yarn format && yarn lint && yarn test:build",
46+
"setup": "yarn install && yarn validate",
4747
"semantic-release": "semantic-release"
4848
},
49-
"husky": {
50-
"hooks": {
51-
"pre-commit": "lint-staged"
52-
}
53-
},
54-
"peerDependencies": {},
55-
"dependencies": {},
5649
"devDependencies": {
57-
"babel-core": "^6.26.3",
50+
"@babel/helper-plugin-utils": "^7.27.1",
5851
"@babel/plugin-proposal-class-properties": "^7.10.4",
5952
"@babel/plugin-transform-react-jsx": "7.10.4",
6053
"@babel/plugin-transform-runtime": "^7.11.0",
6154
"@babel/plugin-transform-typescript": "^7.11.0",
55+
"@babel/preset-env": "^7.27.2",
56+
"@babel/preset-react": "^7.27.1",
6257
"@babel/preset-typescript": "^7.10.4",
6358
"@emotion/core": "^10.0.28",
6459
"@emotion/styled": "^10.0.27",
@@ -71,12 +66,13 @@
7166
"@semantic-release/release-notes-generator": "^9.0.1",
7267
"@testing-library/jest-dom": "^5.11.2",
7368
"@testing-library/react": "^10.4.8",
74-
"@testing-library/react-hooks": "^3.4.1",
69+
"@testing-library/react-hooks": "3.4.1",
7570
"@testing-library/user-event": "^12.1.1",
7671
"@types/jest": "^26.0.9",
7772
"@types/react": "^16.9.45",
7873
"@typescript-eslint/eslint-plugin": "^3.8.0",
7974
"@typescript-eslint/parser": "^3.8.0",
75+
"babel-core": "^6.26.3",
8076
"babel-loader": "^8.1.0",
8177
"babel-plugin-minify-dead-code-elimination": "^0.5.1",
8278
"babel-plugin-no-side-effect-class-properties": "^0.0.7",
@@ -99,7 +95,6 @@
9995
"eslint-plugin-react": "^7.20.5",
10096
"eslint-plugin-react-hooks": "^4.0.8",
10197
"eslint-plugin-standard": "^4.0.1",
102-
"husky": "^4.2.5",
10398
"identity-obj-proxy": "^3.0.0",
10499
"jest": "^26.2.2",
105100
"jest-coverage-badges": "^1.1.2",
@@ -110,10 +105,10 @@
110105
"jest-watch-typeahead": "^0.6.0",
111106
"kcd-scripts": "^6.2.4",
112107
"lint-staged": "^10.2.11",
108+
"prettier": "^2.0.5",
113109
"prop-types": "^15.7.2",
114110
"react": "^16.13.1",
115111
"react-dom": "^16.13.1",
116-
"prettier": "^2.0.5",
117112
"rimraf": "^3.0.2",
118113
"semantic-release": "^17.1.1",
119114
"sirv-cli": "^1.0.5",
@@ -122,5 +117,6 @@
122117
"ts-loader": "^8.0.2",
123118
"tslib": "^2.0.1",
124119
"typescript": "^3.9.7"
125-
}
120+
},
121+
"packageManager": "yarn@4.9.1+sha512.f95ce356460e05be48d66401c1ae64ef84d163dd689964962c6888a9810865e39097a5e9de748876c2e0bf89b232d583c33982773e9903ae7a76257270986538"
126122
}

src/algorithms/graph/topological-sort/index.test.ts

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,7 @@ describe('TopologicalSort', () => {
4545
graph.addEdge(6, 8);
4646

4747
expect(topologicalSort(graph)?.map((v) => v.key)).toEqual([
48-
0,
49-
1,
50-
4,
51-
3,
52-
5,
53-
6,
54-
8,
55-
7,
56-
2,
48+
0, 1, 4, 3, 5, 6, 8, 7, 2,
5749
]);
5850
});
5951
});

src/algorithms/pattern/TestData.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ const Tester = {
44
testWrong: (algorithm: (opts?: Options) => Algorithm, options?: Options): void => {
55
const alg = algorithm(options);
66
// This is only to force typescript to accept the parameter to test it
7-
expect(alg.run((null as unknown) as string, '').result).toEqual(-1);
8-
expect(alg.run((undefined as unknown) as string, '0').result).toEqual(-1);
9-
expect(alg.run('Test', (undefined as unknown) as string).result).toEqual(-1);
7+
expect(alg.run(null as unknown as string, '').result).toEqual(-1);
8+
expect(alg.run(undefined as unknown as string, '0').result).toEqual(-1);
9+
expect(alg.run('Test', undefined as unknown as string).result).toEqual(-1);
1010
},
1111
testStrings: (algorithm: (opts?: Options) => Algorithm, options?: Options): void => {
1212
const alg = algorithm(options);

src/algorithms/searching/TestData.ts

Lines changed: 5 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -25,30 +25,7 @@ export const notFoundAboveSortedNumber = {
2525
result: [],
2626
};
2727
export const numbersSortedArray = [
28-
1,
29-
2,
30-
3,
31-
4,
32-
5,
33-
6,
34-
7,
35-
8,
36-
9,
37-
10,
38-
11,
39-
12,
40-
13,
41-
14,
42-
15,
43-
16,
44-
16,
45-
16,
46-
16,
47-
16,
48-
17,
49-
18,
50-
18,
51-
19,
28+
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 16, 16, 16, 16, 17, 18, 18, 19,
5229
20,
5330
];
5431
export const containedNumber = {
@@ -64,24 +41,7 @@ export const notFoundNumber = {
6441
result: [],
6542
};
6643
export const numbersArray = [
67-
20,
68-
15,
69-
1,
70-
8,
71-
7,
72-
12,
73-
11,
74-
5,
75-
15,
76-
9,
77-
7,
78-
-19,
79-
-2,
80-
18,
81-
3,
82-
-4,
83-
4,
84-
0,
44+
20, 15, 1, 8, 7, 12, 11, 5, 15, 9, 7, -19, -2, 18, 3, -4, 4, 0,
8545
];
8646

8747
export const containedString = {
@@ -116,10 +76,8 @@ const Tester = {
11676
): void => {
11777
const alg = algorithm(options);
11878
// This is only to force typescript to accept the parameter to test it
119-
expect(alg.run(((null as unknown) as unknown[]) as number[], 0).result).toEqual([]);
120-
expect(alg.run(((undefined as unknown) as unknown[]) as number[], 1).result).toEqual(
121-
[],
122-
);
79+
expect(alg.run(null as unknown as unknown[] as number[], 0).result).toEqual([]);
80+
expect(alg.run(undefined as unknown as unknown[] as number[], 1).result).toEqual([]);
12381
},
12482
testNumbers: (
12583
algorithm: (opts?: Options<number>) => Algorithm<number>,
@@ -209,9 +167,7 @@ const Tester = {
209167
expect(alg.run(['aa', 'a'], 'bc').result).toEqual([1]);
210168
expect(alg.run(['aa', 'aa'], 'bc').result).toEqual([]);
211169
expect(alg.run(['aa', 'bbbb', 'cc', 'd', 'eeeee', 'fff'], 'xxx').result).toEqual([
212-
0,
213-
2,
214-
3,
170+
0, 2, 3,
215171
]);
216172
},
217173
testTiming: (algorithm: () => Algorithm<number>): void => {

src/algorithms/sorting/TestData.ts

Lines changed: 3 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1,70 +1,13 @@
11
import {Algorithm, Options} from './Algorithm';
22

33
export const sortedArr = [
4-
1,
5-
2,
6-
3,
7-
4,
8-
5,
9-
6,
10-
7,
11-
8,
12-
9,
13-
10,
14-
11,
15-
12,
16-
13,
17-
14,
18-
15,
19-
16,
20-
17,
21-
18,
22-
19,
23-
20,
4+
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
245
];
256
export const reverseArr = [
26-
20,
27-
19,
28-
18,
29-
17,
30-
16,
31-
15,
32-
14,
33-
13,
34-
12,
35-
11,
36-
10,
37-
9,
38-
8,
39-
7,
40-
6,
41-
5,
42-
4,
43-
3,
44-
2,
45-
1,
7+
20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1,
468
];
479
export const notSortedArr = [
48-
15,
49-
8,
50-
5,
51-
12,
52-
10,
53-
1,
54-
16,
55-
9,
56-
11,
57-
7,
58-
20,
59-
3,
60-
2,
61-
6,
62-
17,
63-
18,
64-
4,
65-
13,
66-
14,
67-
19,
10+
15, 8, 5, 12, 10, 1, 16, 9, 11, 7, 20, 3, 2, 6, 17, 18, 4, 13, 14, 19,
6811
];
6912
export const equalArr = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1];
7013
export const negativeArr = [-1, 0, 5, -10, 20, 13, -7, 3, 2, -3];

0 commit comments

Comments
 (0)