Skip to content

Commit 6ecf940

Browse files
fix(eslint): added sorted import and modified files
1 parent 1168f98 commit 6ecf940

File tree

8 files changed

+297
-14
lines changed

8 files changed

+297
-14
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+
}

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;

packages/observables/src/fetch/request.test.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
import { requestObservable } from './request.js';
21
import fetchMock from 'fetch-mock';
32
import { afterEach, test, describe, beforeEach, expect } from 'vitest';
43

4+
import { requestObservable } from './request.js';
5+
56
describe('request observable with default operators', function () {
67
beforeEach(function () {
78
fetchMock.get(

packages/operators/src/request/retry.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import {
1010
tap,
1111
throwError
1212
} from 'rxjs';
13+
1314
import { connectionObservable } from '../../../observables/src/dom/window.js';
1415

1516
const defaultTimeout = count => Math.min(60000, Math.pow(count, 2) * 1000);

0 commit comments

Comments
 (0)