Skip to content

Commit 94eb8c3

Browse files
committed
Lint setup
Signed-off-by: lovesh <lovesh.bond@gmail.com>
1 parent f583bdd commit 94eb8c3

25 files changed

+2158
-1631
lines changed

.eslintignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# don't ever lint node_modules
2+
node_modules
3+
# don't lint build output (make sure it's set to your correct build folder name)
4+
dist

.eslintrc.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
module.exports = {
2+
root: true,
3+
parser: '@typescript-eslint/parser',
4+
parserOptions: {
5+
tsconfigRootDir: __dirname,
6+
project: ['./tsconfig.json'],
7+
},
8+
plugins: [
9+
'@typescript-eslint',
10+
],
11+
extends: [
12+
'eslint:recommended',
13+
'plugin:@typescript-eslint/recommended',
14+
'plugin:@typescript-eslint/recommended-requiring-type-checking',
15+
'prettier',
16+
],
17+
};

.prettierrc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"semi": true,
3+
"trailingComma": "none",
4+
"singleQuote": true,
5+
"printWidth": 120
6+
}

README.md

Whitespace-only changes.

package.json

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,32 @@
11
{
22
"name": "@docknetwork/crypto-wasm-ts",
33
"version": "0.1.0",
4-
"main": "src/index.ts",
4+
"main": "dist/index.js",
5+
"typings": "dist/index.d.ts",
6+
"scripts": {
7+
"build": "tsc -p .",
8+
"prepare": "husky install",
9+
"pretty": "prettier --config .prettierrc 'src/**/*.ts' --write"
10+
},
511
"license": "Apache-2.0",
612
"private": false,
713
"dependencies": {
8-
"@types/node": "^16.11.6",
9-
"@types/jest": "24.0.18",
10-
"typescript": "^4.4.4",
1114
"@docknetwork/crypto-wasm": "file:../crypto-wasm",
12-
"@typescript-eslint/eslint-plugin": "^5.0.0",
13-
"@typescript-eslint/parser": "^5.0.0",
14-
"eslint": "^8.0.0",
15+
"@types/jest": "24.0.18",
16+
"@types/node": "^16.11.6",
17+
"@typescript-eslint/eslint-plugin": "^5.3.0",
18+
"@typescript-eslint/parser": "^5.3.0",
19+
"eslint": "^8.1.0",
1520
"eslint-plugin-import": "^2.20.2",
1621
"jest": "^27.3.0",
17-
"ts-jest": "^27.0.7",
18-
"husky": "4.2.5",
1922
"prettier": "2.0.4",
20-
"pretty-quick": "2.0.1"
23+
"pretty-quick": "2.0.1",
24+
"ts-jest": "^27.0.7",
25+
"typescript": "^4.4.4"
2126
},
2227
"devDependencies": {
28+
"eslint-config-prettier": "^8.3.0",
29+
"husky": "^7.0.4",
2330
"ts-node": "^10.4.0"
2431
}
2532
}

src/accumulator/IAccumulatorState.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,20 @@
33
* members. It is advised to update the state when elements are added or removed from the accumulator.
44
*/
55
export interface IAccumulatorState {
6-
add(element: Uint8Array): Promise<void>;
7-
remove(element: Uint8Array): Promise<void>;
6+
add(element: Uint8Array): Promise<void>;
7+
remove(element: Uint8Array): Promise<void>;
88

9-
/**
10-
* Check if element is a member of the state.
11-
* @param element
12-
*/
13-
has(element: Uint8Array): Promise<boolean>;
9+
/**
10+
* Check if element is a member of the state.
11+
* @param element
12+
*/
13+
has(element: Uint8Array): Promise<boolean>;
1414
}
1515

1616
/**
1717
* Additional interface for universal accumulator to expose a method that allows to iterate over the
1818
* accumulator members.
1919
*/
2020
export interface IUniversalAccumulatorState extends IAccumulatorState {
21-
elements(): Promise<Iterable<Uint8Array>>;
21+
elements(): Promise<Iterable<Uint8Array>>;
2222
}

src/accumulator/IInitialElementsStore.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
* This persistence layer should not be modified once the accumulator is initialized. It is only read after initialization.
44
*/
55
export interface IInitialElementsStore {
6-
add(element: Uint8Array): Promise<void>;
7-
has(element: Uint8Array): Promise<boolean>;
6+
add(element: Uint8Array): Promise<void>;
7+
has(element: Uint8Array): Promise<boolean>;
88
}

0 commit comments

Comments
 (0)