Skip to content

Commit

Permalink
Merge pull request #45 from basics/feature/eslint
Browse files Browse the repository at this point in the history
Feature/eslint
  • Loading branch information
StephanGerbeth authored Sep 18, 2024
2 parents 1168f98 + f8c2a92 commit 6e82d54
Show file tree
Hide file tree
Showing 10 changed files with 308 additions and 15 deletions.
5 changes: 3 additions & 2 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"yzhang.markdown-all-in-one",
"formulahendry.auto-close-tag",
"formulahendry.auto-rename-tag",
"naumovs.color-highlight"
"naumovs.color-highlight",
"humao.rest-client"
]
}
}
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@
- [x] implemented test samples
- [x] mock browser events (with marble definitions)
- [x] mock requests (with marble definition)
- [x] true async handling
- [x] true async handling
- [x] implemented curl test (.http-file)
- browserslist
- [x] embedded but currently not needed
- git
Expand Down
43 changes: 39 additions & 4 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
import js from '@eslint/js';
import globals from 'globals';
// https://github.com/nickdeis/eslint-plugin-no-secrets
import noSecrets from 'eslint-plugin-no-secrets';
// https://github.com/azat-io/eslint-plugin-perfectionist
import perfectionist from 'eslint-plugin-perfectionist';
// https://github.com/prettier/eslint-plugin-prettier
import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended';
// https://github.com/eslint-community/eslint-plugin-security
import eslintPluginSecurity from 'eslint-plugin-security';
import eslintPluginVitest from 'eslint-plugin-vitest';
// https://github.com/vitest-dev/eslint-plugin-vitest
import vitest from 'eslint-plugin-vitest';
import globals from 'globals';

import eslintIgnores from './eslint.ignores.js';

export default [
Expand All @@ -19,16 +27,43 @@ export default [
}
},
plugins: {
eslintPluginVitest
vitest,
'no-secrets': noSecrets,
perfectionist
},
rules: {
'block-spacing': 'error',
complexity: ['error', { max: 7 }],
camelcase: 'error',
// 'import/order': ['error', { groups: ['builtin', 'external', 'parent', 'sibling', 'index'] }],
'no-console': 'warn',
'no-debugger': 'warn',
'no-multiple-empty-lines': ['error', { max: 1, maxEOF: 1 }],
'no-unused-vars': 'warn'
'no-unused-vars': 'warn',
'no-secrets/no-secrets': 'error',
'perfectionist/sort-imports': [
'error',
{
type: 'alphabetical',
order: 'asc',
ignoreCase: true,
internalPattern: ['~/**'],
newlinesBetween: 'always',
maxLineLength: undefined,
groups: [
'type',
['builtin', 'external'],
'internal-type',
'internal',
['parent-type', 'sibling-type', 'index-type'],
['parent', 'sibling', 'index'],
'object',
'unknown'
],
customGroups: { type: {}, value: {} },
environment: 'node'
}
]
}
}
];
247 changes: 244 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@
"commitlint": "19.5.0",
"eslint": "9.10.0",
"eslint-config-prettier": "9.1.0",
"eslint-plugin-no-secrets": "^1.0.2",
"eslint-plugin-perfectionist": "^3.6.0",
"eslint-plugin-prettier": "5.2.1",
"eslint-plugin-security": "3.0.1",
"eslint-plugin-vitest": "0.5.4",
Expand Down
5 changes: 3 additions & 2 deletions packages/observables/src/dom/window.test.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { tap } from 'rxjs';
import { TestScheduler } from 'rxjs/testing';
import { connectionObservable } from './window.js';
import { mockOffline, mockOnline, mockReset } from '../../../test-utils/network.js';
import { beforeEach, test, expect, describe, afterEach } from 'vitest';

import { mockOffline, mockOnline, mockReset } from '../../../test-utils/network.js';
import { connectionObservable } from './window.js';

// HINT: https://betterprogramming.pub/rxjs-testing-write-unit-tests-for-observables-603af959e251
describe('DOM/window: network', function () {
let testScheduler;
Expand Down
9 changes: 9 additions & 0 deletions packages/observables/src/fetch/request.http
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@

# @name post
GET https://dummyjson.com/posts/1 HTTP/1.1
content-type: application/json

###
@userId = {{post.response.body.userId}}
GET https://dummyjson.com/users/{{userId}} HTTP/1.1
content-type: application/json
Loading

0 comments on commit 6e82d54

Please sign in to comment.