mirror of
https://github.com/CommunitySolidServer/CommunitySolidServer.git
synced 2024-10-03 14:55:10 +00:00
chore: Add eslint:recommended linter rules.
This commit is contained in:
parent
99165e8bc2
commit
14023e4c0c
@ -16,6 +16,7 @@ module.exports = {
|
||||
],
|
||||
extends: [
|
||||
'es/node',
|
||||
'eslint:recommended',
|
||||
'plugin:import/errors',
|
||||
'plugin:import/warnings',
|
||||
'plugin:import/typescript',
|
||||
@ -46,6 +47,7 @@ module.exports = {
|
||||
'new-cap': 'off', // used for RDF constants
|
||||
'no-param-reassign': 'off', // necessary in constructor overloading
|
||||
'no-underscore-dangle': 'off', // conflicts with external libraries
|
||||
'no-unused-vars': 'off', // already checked by @typescript-eslint/no-unused-vars
|
||||
'padding-line-between-statements': 'off',
|
||||
'prefer-named-capture-group': 'off',
|
||||
'tsdoc/syntax': 'error',
|
||||
|
@ -25,13 +25,16 @@ export class SingleThreadedResourceLocker implements ResourceLocker {
|
||||
*/
|
||||
public async acquire(identifier: ResourceIdentifier): Promise<Lock> {
|
||||
this.logger.verbose(`Acquiring lock for ${identifier.path}`);
|
||||
return new Promise(async(resolve): Promise<Lock> =>
|
||||
return new Promise((resolve, reject): void => {
|
||||
this.locks.acquire(identifier.path, (done): void => {
|
||||
this.logger.verbose(`Acquired lock for ${identifier.path}`);
|
||||
resolve({ release: async(): Promise<void> => {
|
||||
this.logger.verbose(`Released lock for ${identifier.path}`);
|
||||
done();
|
||||
} });
|
||||
}));
|
||||
resolve({
|
||||
release: async(): Promise<void> => {
|
||||
this.logger.verbose(`Released lock for ${identifier.path}`);
|
||||
done();
|
||||
},
|
||||
});
|
||||
}).catch(reject);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user