Skip to content

Commit 6e82d54

Browse files
Merge pull request #45 from basics/feature/eslint
Feature/eslint
2 parents 1168f98 + f8c2a92 commit 6e82d54

File tree

10 files changed

+308
-15
lines changed

10 files changed

+308
-15
lines changed

.vscode/extensions.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
"yzhang.markdown-all-in-one",
1313
"formulahendry.auto-close-tag",
1414
"formulahendry.auto-rename-tag",
15-
"naumovs.color-highlight"
15+
"naumovs.color-highlight",
16+
"humao.rest-client"
1617
]
17-
}
18+
}

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,8 @@
5858
- [x] implemented test samples
5959
- [x] mock browser events (with marble definitions)
6060
- [x] mock requests (with marble definition)
61-
- [x] true async handling
61+
- [x] true async handling
62+
- [x] implemented curl test (.http-file)
6263
- browserslist
6364
- [x] embedded but currently not needed
6465
- git

eslint.config.js

Lines changed: 39 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,16 @@
11
import js from '@eslint/js';
2-
import globals from 'globals';
2+
// https://github.com/nickdeis/eslint-plugin-no-secrets
3+
import noSecrets from 'eslint-plugin-no-secrets';
4+
// https://github.com/azat-io/eslint-plugin-perfectionist
5+
import perfectionist from 'eslint-plugin-perfectionist';
6+
// https://github.com/prettier/eslint-plugin-prettier
37
import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended';
8+
// https://github.com/eslint-community/eslint-plugin-security
49
import eslintPluginSecurity from 'eslint-plugin-security';
5-
import eslintPluginVitest from 'eslint-plugin-vitest';
10+
// https://github.com/vitest-dev/eslint-plugin-vitest
11+
import vitest from 'eslint-plugin-vitest';
12+
import globals from 'globals';
13+
614
import eslintIgnores from './eslint.ignores.js';
715

816
export default [
@@ -19,16 +27,43 @@ export default [
1927
}
2028
},
2129
plugins: {
22-
eslintPluginVitest
30+
vitest,
31+
'no-secrets': noSecrets,
32+
perfectionist
2333
},
2434
rules: {
2535
'block-spacing': 'error',
2636
complexity: ['error', { max: 7 }],
37+
camelcase: 'error',
2738
// 'import/order': ['error', { groups: ['builtin', 'external', 'parent', 'sibling', 'index'] }],
2839
'no-console': 'warn',
2940
'no-debugger': 'warn',
3041
'no-multiple-empty-lines': ['error', { max: 1, maxEOF: 1 }],
31-
'no-unused-vars': 'warn'
42+
'no-unused-vars': 'warn',
43+
'no-secrets/no-secrets': 'error',
44+
'perfectionist/sort-imports': [
45+
'error',
46+
{
47+
type: 'alphabetical',
48+
order: 'asc',
49+
ignoreCase: true,
50+
internalPattern: ['~/**'],
51+
newlinesBetween: 'always',
52+
maxLineLength: undefined,
53+
groups: [
54+
'type',
55+
['builtin', 'external'],
56+
'internal-type',
57+
'internal',
58+
['parent-type', 'sibling-type', 'index-type'],
59+
['parent', 'sibling', 'index'],
60+
'object',
61+
'unknown'
62+
],
63+
customGroups: { type: {}, value: {} },
64+
environment: 'node'
65+
}
66+
]
3267
}
3368
}
3469
];

package-lock.json

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

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@
3939
"commitlint": "19.5.0",
4040
"eslint": "9.10.0",
4141
"eslint-config-prettier": "9.1.0",
42+
"eslint-plugin-no-secrets": "^1.0.2",
43+
"eslint-plugin-perfectionist": "^3.6.0",
4244
"eslint-plugin-prettier": "5.2.1",
4345
"eslint-plugin-security": "3.0.1",
4446
"eslint-plugin-vitest": "0.5.4",

packages/observables/src/dom/window.test.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
import { tap } from 'rxjs';
22
import { TestScheduler } from 'rxjs/testing';
3-
import { connectionObservable } from './window.js';
4-
import { mockOffline, mockOnline, mockReset } from '../../../test-utils/network.js';
53
import { beforeEach, test, expect, describe, afterEach } from 'vitest';
64

5+
import { mockOffline, mockOnline, mockReset } from '../../../test-utils/network.js';
6+
import { connectionObservable } from './window.js';
7+
78
// HINT: https://betterprogramming.pub/rxjs-testing-write-unit-tests-for-observables-603af959e251
89
describe('DOM/window: network', function () {
910
let testScheduler;
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
2+
# @name post
3+
GET https://dummyjson.com/posts/1 HTTP/1.1
4+
content-type: application/json
5+
6+
###
7+
@userId = {{post.response.body.userId}}
8+
GET https://dummyjson.com/users/{{userId}} HTTP/1.1
9+
content-type: application/json

0 commit comments

Comments
 (0)