Skip to content

Commit

Permalink
feat(js-client)!: Adding strictes eslint and ts config to all package…
Browse files Browse the repository at this point in the history
…s [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]>
  • Loading branch information
Akim and shamsartem authored Oct 17, 2023
1 parent b469332 commit 919c7d6
Show file tree
Hide file tree
Showing 135 changed files with 10,712 additions and 9,350 deletions.
12 changes: 0 additions & 12 deletions .editorconfig

This file was deleted.

133 changes: 133 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
{
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 2022,
"project": ["./tsconfig.eslint.json"],
"sourceType": "module"
},
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/strict-type-checked",
"plugin:import/recommended",
"plugin:import/typescript",
"prettier"
],
"plugins": [
"@typescript-eslint",
"import",
"license-header",
"unused-imports"
],
"ignorePatterns": ["**/node_modules/**/*", "**/dist/**/*"],
"rules": {
"eqeqeq": [
"error",
"always",
{
"null": "ignore"
}
],
"no-console": ["error"],
"arrow-body-style": ["error", "always"],
"no-empty": [
"error",
{
"allowEmptyCatch": true
}
],
"curly": ["error", "all"],
"no-unused-expressions": ["error"],
"dot-notation": ["off"],
"object-curly-spacing": ["error", "always"],
"padding-line-between-statements": [
"error",
{
"blankLine": "always",
"prev": "multiline-expression",
"next": "*"
},
{
"blankLine": "always",
"prev": "*",
"next": "multiline-expression"
},
{
"blankLine": "always",
"prev": "multiline-block-like",
"next": "*"
},
{
"blankLine": "always",
"prev": "*",
"next": "multiline-block-like"
},
{
"blankLine": "always",
"prev": "multiline-const",
"next": "*"
},
{
"blankLine": "always",
"prev": "*",
"next": "multiline-const"
},
{
"blankLine": "always",
"prev": "multiline-let",
"next": "*"
},
{
"blankLine": "always",
"prev": "*",
"next": "multiline-let"
},
{
"blankLine": "any",
"prev": "case",
"next": "case"
}
],
"import/extensions": ["error", "ignorePackages"],
"import/no-unresolved": "off",
"import/no-cycle": ["error"],
"import/order": [
"error",
{
"newlines-between": "always",
"alphabetize": {
"order": "asc",
"caseInsensitive": true
}
}
],
"node/no-unsupported-features/es-syntax": "off",
"node/no-unpublished-import": "off",
"node/no-missing-import": "off",
"@typescript-eslint/explicit-member-accessibility": [
"error",
{
"accessibility": "no-public"
}
],
"@typescript-eslint/strict-boolean-expressions": [
"error",
{
"allowString": false,
"allowNumber": false,
"allowNullableObject": false,
"allowNullableBoolean": false,
"allowNullableString": false,
"allowNullableNumber": false,
"allowAny": false
}
],
"@typescript-eslint/consistent-type-assertions": [
"error",
{
"assertionStyle": "never"
}
],
"unused-imports/no-unused-imports": "error",
"license-header/header": ["error", "./resources/license-header.js"]
}
}
9 changes: 6 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,11 @@ jobs:
registry-url: "https://npm.fluence.dev"
cache: "pnpm"

- run: pnpm -r i
- run: pnpm -r build
- run: pnpm lint-check


- name: Override dependencies
uses: fluencelabs/github-actions/pnpm-set-dependency@main
with:
Expand All @@ -97,10 +102,8 @@ jobs:
"@fluencelabs/marine-js": "${{ inputs.marine-js-version }}"
}
- run: pnpm -r --no-frozen-lockfile i
- run: pnpm -r build
- run: pnpm -r i
- run: pnpm -r test

- name: Dump rust-peer logs
if: always()
uses: jwalton/gh-docker-logs@v2
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
*.log
.idea
.eslintcache

# Dependency directories
node_modules/
Expand Down
9 changes: 9 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1 +1,10 @@
.github
.eslintcache
pnpm-lock.yaml

**/node_modules
**/dist
**/build
**/public

**/CHANGELOG.md
1 change: 1 addition & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
8 changes: 0 additions & 8 deletions .prettierrc.cjs

This file was deleted.

2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ Things you need to know:

### Contributor License Agreement

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.
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.
Loading

0 comments on commit 919c7d6

Please sign in to comment.