Skip to content

Commit 4a15a85

Browse files
committed
feat: napi-rs@1
1 parent 8e51b89 commit 4a15a85

File tree

28 files changed

+884
-534
lines changed

28 files changed

+884
-534
lines changed

.cargo/config

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[target.aarch64-unknown-linux-gnu]
2+
linker = "aarch64-linux-gnu-gcc"

.eslintrc.yml

Lines changed: 83 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,19 @@ rules:
4646
},
4747
]
4848

49+
# https://github.com/benmosher/eslint-plugin-import/pull/334
50+
'import/no-duplicates': 2
4951
'import/first': 2
5052
'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+
]
5162

5263
'sonarjs/cognitive-complexity': 0
5364
'sonarjs/no-duplicate-string': 0
@@ -68,12 +79,81 @@ overrides:
6879
parserOptions:
6980
project: ./tsconfig.json
7081
rules:
71-
# eslint will treat TS type as undefined stuff
7282
'no-undef': 0
73-
74-
# conflict function override
83+
# TypeScript declare merge
84+
'no-redeclare': 0
85+
'no-useless-constructor': 0
86+
'no-unused-vars': 0
7587
'no-dupe-class-members': 0
88+
'no-case-declarations': 0
89+
'no-duplicate-imports': 0
90+
# TypeScript Interface and Type
91+
'no-use-before-define': 0
7692

93+
'@typescript-eslint/adjacent-overload-signatures': 2
94+
'@typescript-eslint/await-thenable': 2
95+
'@typescript-eslint/consistent-type-assertions': 2
96+
'@typescript-eslint/ban-types':
97+
[
98+
'error',
99+
{
100+
'types':
101+
{
102+
'String': { 'message': 'Use string instead', 'fixWith': 'string' },
103+
'Number': { 'message': 'Use number instead', 'fixWith': 'number' },
104+
'Boolean': { 'message': 'Use boolean instead', 'fixWith': 'boolean' },
105+
'Function': { 'message': 'Use explicit type instead' },
106+
},
107+
},
108+
]
109+
'@typescript-eslint/explicit-member-accessibility':
110+
[
111+
'error',
112+
{
113+
accessibility: 'explicit',
114+
overrides:
115+
{
116+
accessors: 'no-public',
117+
constructors: 'no-public',
118+
methods: 'no-public',
119+
properties: 'no-public',
120+
parameterProperties: 'explicit',
121+
},
122+
},
123+
]
124+
'@typescript-eslint/method-signature-style': 2
125+
'@typescript-eslint/no-floating-promises': 2
126+
'@typescript-eslint/no-implied-eval': 2
127+
'@typescript-eslint/no-for-in-array': 2
128+
'@typescript-eslint/no-inferrable-types': 2
129+
'@typescript-eslint/no-invalid-void-type': 2
130+
'@typescript-eslint/no-misused-new': 2
131+
'@typescript-eslint/no-misused-promises': 2
132+
'@typescript-eslint/no-namespace': 2
133+
'@typescript-eslint/no-non-null-asserted-optional-chain': 2
134+
'@typescript-eslint/no-throw-literal': 2
135+
'@typescript-eslint/no-unnecessary-boolean-literal-compare': 2
136+
'@typescript-eslint/prefer-for-of': 2
137+
'@typescript-eslint/prefer-nullish-coalescing': 2
138+
'@typescript-eslint/switch-exhaustiveness-check': 2
139+
'@typescript-eslint/prefer-optional-chain': 2
140+
'@typescript-eslint/prefer-readonly': 2
141+
'@typescript-eslint/prefer-string-starts-ends-with': 0
142+
'@typescript-eslint/no-array-constructor': 2
143+
'@typescript-eslint/require-await': 2
144+
'@typescript-eslint/return-await': 2
145+
'@typescript-eslint/ban-ts-comment':
146+
[2, { 'ts-expect-error': false, 'ts-ignore': true, 'ts-nocheck': true, 'ts-check': false }]
147+
'@typescript-eslint/naming-convention':
148+
[
149+
2,
150+
{
151+
selector: 'memberLike',
152+
format: ['camelCase', 'PascalCase'],
153+
modifiers: ['private'],
154+
leadingUnderscore: 'forbid',
155+
},
156+
]
77157
'@typescript-eslint/no-unused-vars':
78158
[2, { varsIgnorePattern: '^_', argsIgnorePattern: '^_', ignoreRestSiblings: true }]
79159
'@typescript-eslint/member-ordering':

0 commit comments

Comments
 (0)