Skip to content

Commit

Permalink
run linter and add eslint mocha plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
mistermoe authored and frankhinek committed Jun 13, 2023
1 parent c5f803d commit 1501eab
Show file tree
Hide file tree
Showing 14 changed files with 111 additions and 18 deletions.
5 changes: 3 additions & 2 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ module.exports = {
ecmaVersion : 2022,
sourceType : 'module'
},
plugins : ['@typescript-eslint'],
plugins : ['@typescript-eslint', 'mocha'],
env : {
node : true,
es2022 : true,
Expand Down Expand Up @@ -50,6 +50,7 @@ module.exports = {
'@typescript-eslint/no-explicit-any' : 'off',
'no-trailing-spaces' : ['error'],
'@typescript-eslint/no-non-null-assertion' : 'off',
'@typescript-eslint/ban-ts-comment' : 'off'
'@typescript-eslint/ban-ts-comment' : 'off',
'mocha/no-exclusive-tests' : 'warn'
}
};
96 changes: 96 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions packages/credentials/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@
"chai": "4.3.7",
"esbuild": "0.16.7",
"eslint": "8.39.0",
"eslint-plugin-mocha": "10.1.0",
"karma": "6.4.1",
"karma-chai": "0.1.0",
"karma-chrome-launcher": "3.1.1",
Expand Down
1 change: 1 addition & 0 deletions packages/crypto/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@
"chai-as-promised": "7.1.1",
"esbuild": "0.16.17",
"eslint": "8.39.0",
"eslint-plugin-mocha": "10.1.0",
"karma": "6.4.1",
"karma-chai": "0.1.0",
"karma-chrome-launcher": "3.1.1",
Expand Down
1 change: 1 addition & 0 deletions packages/dids/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@
"chai-as-promised": "7.1.1",
"esbuild": "0.16.17",
"eslint": "8.39.0",
"eslint-plugin-mocha": "10.1.0",
"karma": "6.4.1",
"karma-chai": "0.1.0",
"karma-chrome-launcher": "3.1.1",
Expand Down
1 change: 1 addition & 0 deletions packages/web5-agent/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@
"chai-as-promised": "7.1.1",
"esbuild": "0.16.17",
"eslint": "8.39.0",
"eslint-plugin-mocha": "10.1.0",
"karma": "6.4.1",
"karma-chai": "0.1.0",
"karma-chrome-launcher": "3.1.1",
Expand Down
1 change: 0 additions & 1 deletion packages/web5-agent/src/web5-agent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import {
RecordsDeleteMessage
} from '@tbd54566975/dwn-sdk-js';

import type { JsonRpcResponse } from './json-rpc.js';
export interface Web5Agent {
processDwnRequest(request: ProcessDwnRequest): Promise<DwnResponse>
sendDwnRequest(request: SendDwnRequest): Promise<DwnResponse>;
Expand Down
3 changes: 2 additions & 1 deletion packages/web5-proxy-agent/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@
"chai-as-promised": "7.1.1",
"esbuild": "0.16.17",
"eslint": "8.39.0",
"eslint-plugin-mocha": "10.1.0",
"karma": "6.4.1",
"karma-chai": "0.1.0",
"karma-chrome-launcher": "3.1.1",
Expand All @@ -109,5 +110,5 @@
},
"overrides": {
"socket.io-parser@>4.0.4 <4.2.3": "4.2.3"
}
}
}
1 change: 1 addition & 0 deletions packages/web5-user-agent/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@
"chai-as-promised": "7.1.1",
"esbuild": "0.16.17",
"eslint": "8.39.0",
"eslint-plugin-mocha": "10.1.0",
"karma": "6.4.1",
"karma-chai": "0.1.0",
"karma-chrome-launcher": "3.1.1",
Expand Down
2 changes: 0 additions & 2 deletions packages/web5-user-agent/src/sync-manager.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import type { Profile } from './profile-manager.js';

export interface SyncManager {
registerProfile(did: string): Promise<void>;
push(): Promise<void>;
Expand Down
5 changes: 2 additions & 3 deletions packages/web5-user-agent/tests/node/web5-user-agent.spec.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { expect } from 'chai';
import { TestAgent } from '../common/utils/test-user-agent.js';


let testAgent: TestAgent;
let did: string;

describe('[Node only] Web5UserAgent', () => {
before(async () => {
Expand All @@ -11,7 +10,7 @@ describe('[Node only] Web5UserAgent', () => {

beforeEach(async () => {
await testAgent.clearStorage();
({ did } = await testAgent.createProfile());
// ({ did } = await testAgent.createProfile());
});

after(async () => {
Expand Down
3 changes: 2 additions & 1 deletion packages/web5/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@
"chai-as-promised": "7.1.1",
"esbuild": "0.16.17",
"eslint": "8.39.0",
"eslint-plugin-mocha": "10.1.0",
"karma": "6.4.1",
"karma-chai": "0.1.0",
"karma-chrome-launcher": "3.1.1",
Expand All @@ -123,4 +124,4 @@
"overrides": {
"socket.io-parser@>4.0.4 <4.2.3": "4.2.3"
}
}
}
7 changes: 0 additions & 7 deletions packages/web5/tests/web5-did.spec.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
import { expect } from 'chai';
import { Web5 } from '../src/web5.js';

let testAgent;
let web5: Web5;
let did: string;

describe('web5.did', () => {
xit('tests needed');
});
2 changes: 1 addition & 1 deletion packages/web5/tests/web5-vc.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ let vc: VcApi;
let did: string;
let testProfileOptions: TestProfileOptions;

describe.only('web5.vc', () => {
describe('web5.vc', () => {
before(async () => {
testAgent = await TestAgent.create();
});
Expand Down

0 comments on commit 1501eab

Please sign in to comment.