Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 82a379d

Browse files
committedApr 22, 2025·
feat: added @matrixai/lint and removed old linting elements, ran linting with js-lint
1 parent 23cc8c1 commit 82a379d

File tree

8 files changed

+3224
-1047
lines changed

8 files changed

+3224
-1047
lines changed
 

‎.eslintrc

Lines changed: 0 additions & 179 deletions
This file was deleted.

‎README.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22

33
Encrypted filesystem library for TypeScript/JavaScript applications
44

5-
* Virtualised - files, directories, permissions are all virtual constructs, they do not correspond to real filesystems
6-
* Orthogonally Persistent - all writes automatically persisted
7-
* Encrypted-At-Rest - all persistence is encrypted
8-
* Random Read & Write - encryption and decryption operates over fixed-block sizes
9-
* Streamable - files do not need to loaded fully in-memory
10-
* Comprehensive continuous benchmarks in CI/CD
5+
- Virtualised - files, directories, permissions are all virtual constructs, they do not correspond to real filesystems
6+
- Orthogonally Persistent - all writes automatically persisted
7+
- Encrypted-At-Rest - all persistence is encrypted
8+
- Random Read & Write - encryption and decryption operates over fixed-block sizes
9+
- Streamable - files do not need to loaded fully in-memory
10+
- Comprehensive continuous benchmarks in CI/CD
1111

1212
Development based on js-virtualfs: https://github.com/MatrixAI/js-virtualfs
1313

@@ -34,7 +34,7 @@ const efs = await EncryptedFS.createEncryptedFS({
3434

3535
// optionally set up the worker manager for multi-threaded encryption/decryption
3636
const workerManager = await WorkerManager.createWorkerManager<EFSWorkerModule>({
37-
workerFactory: () => spawn(new Worker('./src/workers/efsWorker'))
37+
workerFactory: () => spawn(new Worker('./src/workers/efsWorker')),
3838
});
3939

4040
efs.setWorkerManager(workerManager);
@@ -64,10 +64,10 @@ Internally we use the AES-GCM symmetric encryption using a master `dbKey` that c
6464

6565
The `dbKey` can be generated from several methods:
6666

67-
* `generateKey` - random asynchronous
68-
* `generateKeySync` - random synchronous
69-
* `generateKeyFromPass` - derived from user-provided "password" asynchronous
70-
* `generateKeyFromPassSync` - derived from user-provided "password" synchronous
67+
- `generateKey` - random asynchronous
68+
- `generateKeySync` - random synchronous
69+
- `generateKeyFromPass` - derived from user-provided "password" asynchronous
70+
- `generateKeyFromPassSync` - derived from user-provided "password" synchronous
7171

7272
For example:
7373

@@ -95,9 +95,9 @@ The ciphertext data length is equal to the plaintext block length.
9595

9696
There are some differences between EFS and Node FS:
9797

98-
* User, Group and Other permissions: In EFS User, Group and Other permissions are strictly confined to their permission class. For example, a User in EFS does not have the permissions that a Group or Other has while in Node FS a User also has permissions that Group and Other have.
99-
* Sticky Files: In Node FS, a sticky bit is a permission bit that is set on a file or a directory that lets only the owner of the file/directory or the root user to delete or rename the file. EFS does not support the use of sticky bits.
100-
* Character Devices: Node FS contains Character Devices which can be written to and read from. However, in EFS Character Devices are not supported yet.
98+
- User, Group and Other permissions: In EFS User, Group and Other permissions are strictly confined to their permission class. For example, a User in EFS does not have the permissions that a Group or Other has while in Node FS a User also has permissions that Group and Other have.
99+
- Sticky Files: In Node FS, a sticky bit is a permission bit that is set on a file or a directory that lets only the owner of the file/directory or the root user to delete or rename the file. EFS does not support the use of sticky bits.
100+
- Character Devices: Node FS contains Character Devices which can be written to and read from. However, in EFS Character Devices are not supported yet.
101101

102102
## Development
103103

‎package-lock.json

Lines changed: 3202 additions & 841 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎package.json

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,8 @@
5252
"ts-node": "ts-node",
5353
"tsx": "tsx",
5454
"test": "node ./scripts/test.mjs",
55-
"lint": "eslint '{src,tests,scripts,benches}/**/*.{js,mjs,ts,mts,jsx,tsx}'",
56-
"lintfix": "eslint '{src,tests,scripts,benches}/**/*.{js,mjs,ts,mts,jsx,tsx}' --fix",
57-
"lint-shell": "find ./src ./tests ./scripts -type f -regextype posix-extended -regex '.*\\.(sh)' -exec shellcheck {} +",
55+
"lint": "matrixai-lint",
56+
"lintfix": "matrixai-lint --fix",
5857
"docs": "shx rm -rf ./docs && typedoc --gitRevision master --tsconfig ./tsconfig.build.json --out ./docs src",
5958
"bench": "tsc -p ./tsconfig.build.json && shx rm -rf ./benches/results && tsx ./benches/index.ts"
6059
},
@@ -74,21 +73,17 @@
7473
"util-callbackify": "^1.0.0"
7574
},
7675
"devDependencies": {
76+
"@matrixai/lint": "^0.1.0",
7777
"@fast-check/jest": "^2.1.0",
7878
"@swc/core": "1.3.82",
7979
"@swc/jest": "^0.2.29",
8080
"@types/jest": "^29.5.2",
8181
"@types/node": "^20.5.7",
8282
"@types/node-forge": "^1.0.2",
8383
"@types/readable-stream": "^2.3.11",
84-
"@typescript-eslint/eslint-plugin": "^5.61.0",
85-
"@typescript-eslint/parser": "^5.61.0",
8684
"benny": "^3.7.1",
8785
"common-tags": "^1.8.2",
88-
"eslint": "^8.44.0",
89-
"eslint-config-prettier": "^8.8.0",
90-
"eslint-plugin-import": "^2.27.5",
91-
"eslint-plugin-prettier": "^5.0.0-alpha.2",
86+
"eslint": "^9.0.0",
9287
"fast-check": "^4.0.0",
9388
"jest": "^29.6.2",
9489
"jest-extended": "^4.0.0",

‎src/fd/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
export { default as FileDescriptorManager } from './FileDescriptorManager.js';
22
export { default as FileDescriptor } from './FileDescriptor.js';
33
export * as errors from './errors.js';
4-
export * from './types.js';
4+
export type * from './types.js';

‎src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ export * as inodes from './inodes/index.js';
66
export * as constants from './constants.js';
77
export * as permissions from './permissions.js';
88
export * as utils from './utils.js';
9-
export * from './types.js';
9+
export type * from './types.js';

‎src/inodes/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
export { default as INodeManager } from './INodeManager.js';
2-
export * from './types.js';
2+
export type * from './types.js';
33
export * as utils from './utils.js';
44
export * as errors from './errors.js';

‎src/streams/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
export { default as ReadStream } from './ReadStream.js';
22
export { default as WriteStream } from './WriteStream.js';
3-
export * from './types.js';
3+
export type * from './types.js';

0 commit comments

Comments
 (0)
Please sign in to comment.