Skip to content

Commit 919c7d6

Browse files
Akimshamsartem
Akim
andauthored
feat(js-client)!: Adding strictes eslint and ts config to all packages [fixes DXJ-464] (#355)
* introduce eslint * Fix all eslint errors * Eslint fix and some touches * Fix tests * Fix misc errors * change semver * change semver #2 * Fix path * Fix path #2 * freeze lock file in CI * fix package install * Fix formatting of surrounding files * Add empty prettier config * Fix formatting * Fix build errors * Remove unused deps * remove changelog from formatting * deps cleanup * make resource importers async * Refactor * Fix error message * remove comment * more refactoring * Update packages/core/js-client/src/compilerSupport/registerService.ts Co-authored-by: shamsartem <[email protected]> * refactoring * refactoring fix * optimize import * Update packages/@tests/smoke/node/src/index.ts Co-authored-by: shamsartem <[email protected]> * Revert package * Fix pnpm lock * Lint-fix * Fix CI * Update tests * Fix build * Fix import * Use forked threads dep * Use fixed version * Update threads * Fix lint * Fix test * Fix test * Add polyfill for assert * Add subpath import * Fix tests * Fix deps --------- Co-authored-by: shamsartem <[email protected]>
1 parent b469332 commit 919c7d6

File tree

135 files changed

+10712
-9350
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

135 files changed

+10712
-9350
lines changed

.editorconfig

-12
This file was deleted.

.eslintrc.json

+133
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
{
2+
"parser": "@typescript-eslint/parser",
3+
"parserOptions": {
4+
"ecmaVersion": 2022,
5+
"project": ["./tsconfig.eslint.json"],
6+
"sourceType": "module"
7+
},
8+
"extends": [
9+
"eslint:recommended",
10+
"plugin:@typescript-eslint/strict-type-checked",
11+
"plugin:import/recommended",
12+
"plugin:import/typescript",
13+
"prettier"
14+
],
15+
"plugins": [
16+
"@typescript-eslint",
17+
"import",
18+
"license-header",
19+
"unused-imports"
20+
],
21+
"ignorePatterns": ["**/node_modules/**/*", "**/dist/**/*"],
22+
"rules": {
23+
"eqeqeq": [
24+
"error",
25+
"always",
26+
{
27+
"null": "ignore"
28+
}
29+
],
30+
"no-console": ["error"],
31+
"arrow-body-style": ["error", "always"],
32+
"no-empty": [
33+
"error",
34+
{
35+
"allowEmptyCatch": true
36+
}
37+
],
38+
"curly": ["error", "all"],
39+
"no-unused-expressions": ["error"],
40+
"dot-notation": ["off"],
41+
"object-curly-spacing": ["error", "always"],
42+
"padding-line-between-statements": [
43+
"error",
44+
{
45+
"blankLine": "always",
46+
"prev": "multiline-expression",
47+
"next": "*"
48+
},
49+
{
50+
"blankLine": "always",
51+
"prev": "*",
52+
"next": "multiline-expression"
53+
},
54+
{
55+
"blankLine": "always",
56+
"prev": "multiline-block-like",
57+
"next": "*"
58+
},
59+
{
60+
"blankLine": "always",
61+
"prev": "*",
62+
"next": "multiline-block-like"
63+
},
64+
{
65+
"blankLine": "always",
66+
"prev": "multiline-const",
67+
"next": "*"
68+
},
69+
{
70+
"blankLine": "always",
71+
"prev": "*",
72+
"next": "multiline-const"
73+
},
74+
{
75+
"blankLine": "always",
76+
"prev": "multiline-let",
77+
"next": "*"
78+
},
79+
{
80+
"blankLine": "always",
81+
"prev": "*",
82+
"next": "multiline-let"
83+
},
84+
{
85+
"blankLine": "any",
86+
"prev": "case",
87+
"next": "case"
88+
}
89+
],
90+
"import/extensions": ["error", "ignorePackages"],
91+
"import/no-unresolved": "off",
92+
"import/no-cycle": ["error"],
93+
"import/order": [
94+
"error",
95+
{
96+
"newlines-between": "always",
97+
"alphabetize": {
98+
"order": "asc",
99+
"caseInsensitive": true
100+
}
101+
}
102+
],
103+
"node/no-unsupported-features/es-syntax": "off",
104+
"node/no-unpublished-import": "off",
105+
"node/no-missing-import": "off",
106+
"@typescript-eslint/explicit-member-accessibility": [
107+
"error",
108+
{
109+
"accessibility": "no-public"
110+
}
111+
],
112+
"@typescript-eslint/strict-boolean-expressions": [
113+
"error",
114+
{
115+
"allowString": false,
116+
"allowNumber": false,
117+
"allowNullableObject": false,
118+
"allowNullableBoolean": false,
119+
"allowNullableString": false,
120+
"allowNullableNumber": false,
121+
"allowAny": false
122+
}
123+
],
124+
"@typescript-eslint/consistent-type-assertions": [
125+
"error",
126+
{
127+
"assertionStyle": "never"
128+
}
129+
],
130+
"unused-imports/no-unused-imports": "error",
131+
"license-header/header": ["error", "./resources/license-header.js"]
132+
}
133+
}

.github/workflows/tests.yml

+6-3
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,11 @@ jobs:
8888
registry-url: "https://npm.fluence.dev"
8989
cache: "pnpm"
9090

91+
- run: pnpm -r i
92+
- run: pnpm -r build
93+
- run: pnpm lint-check
94+
95+
9196
- name: Override dependencies
9297
uses: fluencelabs/github-actions/pnpm-set-dependency@main
9398
with:
@@ -97,10 +102,8 @@ jobs:
97102
"@fluencelabs/marine-js": "${{ inputs.marine-js-version }}"
98103
}
99104
100-
- run: pnpm -r --no-frozen-lockfile i
101-
- run: pnpm -r build
105+
- run: pnpm -r i
102106
- run: pnpm -r test
103-
104107
- name: Dump rust-peer logs
105108
if: always()
106109
uses: jwalton/gh-docker-logs@v2

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
*.log
22
.idea
3+
.eslintcache
34

45
# Dependency directories
56
node_modules/

.prettierignore

+9
Original file line numberDiff line numberDiff line change
@@ -1 +1,10 @@
11
.github
2+
.eslintcache
3+
pnpm-lock.yaml
4+
5+
**/node_modules
6+
**/dist
7+
**/build
8+
**/public
9+
10+
**/CHANGELOG.md

.prettierrc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}

.prettierrc.cjs

-8
This file was deleted.

CONTRIBUTING.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ Things you need to know:
1010

1111
### Contributor License Agreement
1212

13-
When you contribute, you have to be aware that your contribution is covered by **[Apache License 2.0](./LICENSE)**, but might relicensed under few other software licenses mentioned in the **Contributor License Agreement**. In particular, you need to agree to the Contributor License Agreement. If you agree to its content, you simply have to click on the link posted by the CLA assistant as a comment to the pull request. Click it to check the CLA, then accept it on the following screen if you agree to it. The CLA assistant will save this decision for upcoming contributions and will notify you if there is any change to the CLA in the meantime.
13+
When you contribute, you have to be aware that your contribution is covered by **[Apache License 2.0](./LICENSE)**, but might relicensed under few other software licenses mentioned in the **Contributor License Agreement**. In particular, you need to agree to the Contributor License Agreement. If you agree to its content, you simply have to click on the link posted by the CLA assistant as a comment to the pull request. Click it to check the CLA, then accept it on the following screen if you agree to it. The CLA assistant will save this decision for upcoming contributions and will notify you if there is any change to the CLA in the meantime.

0 commit comments

Comments
 (0)