8000 Refactor the project and add generics and getter options by petarvujovic98 · Pull Request #213 · near/near-sdk-js · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Refactor the project and add generics and getter options #213

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 15 commits into from
Sep 20, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
module.exports = {
root: true,
env: {
es2021: true,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The underlying engine quickjs only support es2020: https://bellard.org/quickjs/ so we need es2020 here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ailisp This is just for the code we are writing, doesn't have to do anything with the target for the TypeScript compilation. So we are using newer features in code, or at least we could be, but then the TypeScript compiler will build them to whatever version we choose in the tsconfig.json file.

node: true,
},
overrides: [
{
files: ["./**/*.ts", "./**/*.js"],
extends: [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"prettier",
],
parser: "@typescript-eslint/parser",
parserOptions: {
ecmaVersion: "latest",
sourceType: "module",
project: ["./{t,j}sconfig.json", "./**/{t,j}sconfig.json"],
},
plugins: ["@typescript-eslint"],
rules: {
"@typescript-eslint/no-unused-vars": [
"warn",
{
varsIgnorePattern: "^_",
argsIgnorePattern: "^_",
destructuredArrayIgnorePattern: "^_",
caughtErrorsIgnorePattern: "^_",
},
],
},
},
],
ignorePatterns: [
"./**/node_modules",
"node_modules",
"./**/lib",
"lib",
"./**/build",
"build",
"./**/deps",
"deps",
],
rules: {},
};
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Build
on:
on:
pull_request:
push:
branches:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/examples.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Examples
on:
on:
pull_request:
push:
branches:
Expand Down Expand Up @@ -39,4 +39,4 @@ jobs:
- name: status-message
run: cd examples && yarn build:status-message && yarn test:status-message
- name: parking-lot
run: cd examples && yarn build:parking-lot && yarn test:parking-lot
run: cd examples && yarn build:parking-lot && yarn test:parking-lot
30 changes: 30 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Lint
on:
pull_request:
push:
branches:
- master
- develop
jobs:
lint:
strategy:
matrix:
platform: [ubuntu-latest]
runs-on: ${{ matrix.platform }}
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: "16"
- name: Install modules
run: yarn
- name: Run lint
run: yarn lint
- name: Format code
run: yarn format
- name: Run git status
run: git status
- name: Check that lints where commited
run: test -z "$(git status --porcelain)"
2 changes: 1 addition & 1 deletion .github/workflows/unit-test.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Unit tests
on:
on:
pull_request:
push:
branches:
Expand Down
5 changes: 5 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
deps
build
node_modules
lib

26 changes: 13 additions & 13 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,22 @@ appearance, race, religion, or sexual identity and orientation.
Examples of behavior that contributes to creating a positive environment
include:

* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members
- Using welcoming and inclusive language
- Being respectful of differing viewpoints and experiences
- Gracefully accepting constructive criticism
- Focusing on what is best for the community
- Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery and unwelcome sexual attention or
advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting
- The use of sexualized language or imagery and unwelcome sexual attention or
advances
- Trolling, insulting/derogatory comments, and personal or political attacks
- Public or private harassment
- Publishing others' private information, such as a physical or electronic
address, without explicit permission
- Other conduct which could reasonably be considered inappropriate in a
professional setting

## Our Responsibilities

Expand Down
Loading
0