Skip to content

Commit 095d67d

Browse files
committed
Initial commit
0 parents  commit 095d67d

Some content is hidden

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

52 files changed

+7106
-0
lines changed

.cargo/config.toml

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
[target.aarch64-unknown-linux-gnu]
2+
linker = "aarch64-linux-gnu-gcc"
3+
4+
[target.armv7-unknown-linux-gnueabihf]
5+
linker = "arm-linux-gnueabihf-gcc"
6+
7+
[target.x86_64-unknown-linux-musl]
8+
rustflags = [
9+
"-C",
10+
"target-feature=-crt-static",
11+
]
12+
13+
[target.aarch64-unknown-linux-musl]
14+
linker = "aarch64-linux-musl-gcc"
15+
rustflags = ["-C", "target-feature=-crt-static"]

.editorconfig

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# EditorConfig helps developers define and maintain consistent
2+
# coding styles between different editors or IDEs
3+
# http://editorconfig.org
4+
root = true
5+
6+
[*]
7+
indent_style = space
8+
indent_size = 2
9+
end_of_line = lf
10+
charset = utf-8
11+
trim_trailing_whitespace = true
12+
insert_final_newline = true
13+
14+
[*.md]
15+
trim_trailing_whitespace = false

.eslintrc.yml

+167
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,167 @@
1+
parser: '@typescript-eslint/parser'
2+
3+
parserOptions:
4+
ecmaFeatures:
5+
jsx: true
6+
ecmaVersion: latest
7+
sourceType: module
8+
project: ./tsconfig.json
9+
10+
env:
11+
browser: true
12+
es6: true
13+
node: true
14+
jest: true
15+
16+
plugins:
17+
- import
18+
- '@typescript-eslint'
19+
20+
extends:
21+
- eslint:recommended
22+
- plugin:prettier/recommended
23+
24+
rules:
25+
# 0 = off, 1 = warn, 2 = error
26+
'space-before-function-paren': 0
27+
'no-useless-constructor': 0
28+
'no-undef': 2
29+
'no-console': [2, { allow: ['error', 'warn', 'info', 'assert'] }]
30+
'comma-dangle': ['error', 'only-multiline']
31+
'no-unused-vars': 0
32+
'no-var': 2
33+
'one-var-declaration-per-line': 2
34+
'prefer-const': 2
35+
'no-const-assign': 2
36+
'no-duplicate-imports': 2
37+
'no-use-before-define': [2, { 'functions': false, 'classes': false }]
38+
'eqeqeq': [2, 'always', { 'null': 'ignore' }]
39+
'no-case-declarations': 0
40+
'no-restricted-syntax':
41+
[
42+
2,
43+
{
44+
'selector': 'BinaryExpression[operator=/(==|===|!=|!==)/][left.raw=true], BinaryExpression[operator=/(==|===|!=|!==)/][right.raw=true]',
45+
'message': Don't compare for equality against boolean literals,
46+
},
47+
]
48+
49+
# https://github.com/benmosher/eslint-plugin-import/pull/334
50+
'import/no-duplicates': 2
51+
'import/first': 2
52+
'import/newline-after-import': 2
53+
'import/order':
54+
[
55+
2,
56+
{
57+
'newlines-between': 'always',
58+
'alphabetize': { 'order': 'asc' },
59+
'groups': ['builtin', 'external', 'internal', 'parent', 'sibling', 'index'],
60+
},
61+
]
62+
63+
overrides:
64+
- files:
65+
- ./**/*{.ts,.tsx}
66+
rules:
67+
'no-unused-vars': [2, { varsIgnorePattern: '^_', argsIgnorePattern: '^_', ignoreRestSiblings: true }]
68+
'no-undef': 0
69+
# TypeScript declare merge
70+
'no-redeclare': 0
71+
'no-useless-constructor': 0
72+
'no-dupe-class-members': 0
73+
'no-case-declarations': 0
74+
'no-duplicate-imports': 0
75+
# TypeScript Interface and Type
76+
'no-use-before-define': 0
77+
78+
'@typescript-eslint/adjacent-overload-signatures': 2
79+
'@typescript-eslint/await-thenable': 2
80+
'@typescript-eslint/consistent-type-assertions': 2
81+
'@typescript-eslint/ban-types':
82+
[
83+
'error',
84+
{
85+
'types':
86+
{
87+
'String': { 'message': 'Use string instead', 'fixWith': 'string' },
88+
'Number': { 'message': 'Use number instead', 'fixWith': 'number' },
89+
'Boolean': { 'message': 'Use boolean instead', 'fixWith': 'boolean' },
90+
'Function': { 'message': 'Use explicit type instead' },
91+
},
92+
},
93+
]
94+
'@typescript-eslint/explicit-member-accessibility':
95+
[
96+
'error',
97+
{
98+
accessibility: 'explicit',
99+
overrides:
100+
{
101+
accessors: 'no-public',
102+
constructors: 'no-public',
103+
methods: 'no-public',
104+
properties: 'no-public',
105+
parameterProperties: 'explicit',
106+
},
107+
},
108+
]
109+
'@typescript-eslint/method-signature-style': 2
110+
'@typescript-eslint/no-floating-promises': 2
111+
'@typescript-eslint/no-implied-eval': 2
112+
'@typescript-eslint/no-for-in-array': 2
113+
'@typescript-eslint/no-inferrable-types': 2
114+
'@typescript-eslint/no-invalid-void-type': 2
115+
'@typescript-eslint/no-misused-new': 2
116+
'@typescript-eslint/no-misused-promises': 2
117+
'@typescript-eslint/no-namespace': 2
118+
'@typescript-eslint/no-non-null-asserted-optional-chain': 2
119+
'@typescript-eslint/no-throw-literal': 2
120+
'@typescript-eslint/no-unnecessary-boolean-literal-compare': 2
121+
'@typescript-eslint/prefer-for-of': 2
122+
'@typescript-eslint/prefer-nullish-coalescing': 2
123+
'@typescript-eslint/switch-exhaustiveness-check': 2
124+
'@typescript-eslint/prefer-optional-chain': 2
125+
'@typescript-eslint/prefer-readonly': 2
126+
'@typescript-eslint/prefer-string-starts-ends-with': 0
127+
'@typescript-eslint/no-array-constructor': 2
128+
'@typescript-eslint/require-await': 2
129+
'@typescript-eslint/return-await': 2
130+
'@typescript-eslint/ban-ts-comment':
131+
[2, { 'ts-expect-error': false, 'ts-ignore': true, 'ts-nocheck': true, 'ts-check': false }]
132+
'@typescript-eslint/naming-convention':
133+
[
134+
2,
135+
{
136+
selector: 'memberLike',
137+
format: ['camelCase', 'PascalCase'],
138+
modifiers: ['private'],
139+
leadingUnderscore: 'forbid',
140+
},
141+
]
142+
'@typescript-eslint/no-unused-vars':
143+
[2, { varsIgnorePattern: '^_', argsIgnorePattern: '^_', ignoreRestSiblings: true }]
144+
'@typescript-eslint/member-ordering':
145+
[
146+
2,
147+
{
148+
default:
149+
[
150+
'public-static-field',
151+
'protected-static-field',
152+
'private-static-field',
153+
'public-static-method',
154+
'protected-static-method',
155+
'private-static-method',
156+
'public-instance-field',
157+
'protected-instance-field',
158+
'private-instance-field',
159+
'public-constructor',
160+
'protected-constructor',
161+
'private-constructor',
162+
'public-instance-method',
163+
'protected-instance-method',
164+
'private-instance-method',
165+
],
166+
},
167+
]

.gitattributes

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Auto detect text files and perform LF normalization
2+
* text=auto
3+
4+
5+
*.ts text eol=lf merge=union
6+
*.tsx text eol=lf merge=union
7+
*.rs text eol=lf merge=union
8+
*.js text eol=lf merge=union
9+
*.json text eol=lf merge=union
10+
*.debug text eol=lf merge=union
11+
12+
# Generated codes
13+
index.js linguist-detectable=false
14+
index.d.ts linguist-detectable=false

0 commit comments

Comments
 (0)