mirror of
https://github.com/toeverything/AFFiNE.git
synced 2024-11-22 07:21:56 +03:00
fix: add no-useless-promise-resolve-reject rule (#5111)
This commit is contained in:
parent
d267029761
commit
45690c2756
@ -210,6 +210,7 @@ const config = {
|
||||
'unicorn/prefer-dom-node-dataset': 'error',
|
||||
'unicorn/prefer-dom-node-append': 'error',
|
||||
'unicorn/prefer-array-some': 'error',
|
||||
'unicorn/no-useless-promise-resolve-reject': 'error',
|
||||
'sonarjs/no-all-duplicated-branches': 'error',
|
||||
'sonarjs/no-element-overwrite': 'error',
|
||||
'sonarjs/no-empty-collection': 'error',
|
||||
|
@ -33,7 +33,7 @@
|
||||
"lint:eslint:fix": "yarn lint:eslint --fix",
|
||||
"lint:prettier": "prettier --ignore-unknown --cache --check .",
|
||||
"lint:prettier:fix": "prettier --ignore-unknown --cache --write .",
|
||||
"lint:ox": "oxlint --deny-warnings --import-plugin -D correctness -D nursery -D prefer-array-some -A no-undef -A consistent-type-exports -A default -A named -A ban-ts-comment",
|
||||
"lint:ox": "oxlint --deny-warnings --import-plugin -D correctness -D nursery -D prefer-array-some -D no-useless-promise-resolve-reject -A no-undef -A consistent-type-exports -A default -A named -A ban-ts-comment",
|
||||
"lint": "yarn lint:eslint && yarn lint:prettier",
|
||||
"lint:fix": "yarn lint:eslint:fix && yarn lint:prettier:fix",
|
||||
"test": "vitest --run",
|
||||
|
@ -65,9 +65,7 @@ test.afterEach.always(async t => {
|
||||
|
||||
test('should get blob size limit', async t => {
|
||||
const { resolver } = t.context;
|
||||
fakeUserService.getStorageQuotaById.returns(
|
||||
Promise.resolve(100 * 1024 * 1024 * 1024)
|
||||
);
|
||||
fakeUserService.getStorageQuotaById.resolves(100 * 1024 * 1024 * 1024);
|
||||
const res = await resolver.checkBlobSize(new FakePrisma().fakeUser, '', 100);
|
||||
t.not(res, false);
|
||||
// @ts-expect-error
|
||||
|
@ -81,7 +81,7 @@ export async function bootstrapPluginSystem(
|
||||
logger.debug(`registering plugin ${pluginName}`);
|
||||
logger.debug(`package.json: ${packageJson}`);
|
||||
if (!release && !runtimeConfig.enablePlugin) {
|
||||
return Promise.resolve();
|
||||
return;
|
||||
}
|
||||
const baseURL = url;
|
||||
const entryURL = `${baseURL}/${core}`;
|
||||
@ -95,7 +95,7 @@ export async function bootstrapPluginSystem(
|
||||
const loadedAssetName = `${pluginName}_${asset}`;
|
||||
// todo(himself65): add assets into shadow dom
|
||||
if (loadedAssets.has(loadedAssetName)) {
|
||||
return Promise.resolve();
|
||||
return;
|
||||
}
|
||||
if (asset.endsWith('.css')) {
|
||||
loadedAssets.add(loadedAssetName);
|
||||
@ -111,7 +111,7 @@ export async function bootstrapPluginSystem(
|
||||
}
|
||||
return null;
|
||||
} else {
|
||||
return Promise.resolve();
|
||||
return;
|
||||
}
|
||||
})
|
||||
);
|
||||
|
@ -255,6 +255,6 @@ export const fetchWithTraceReport = async (
|
||||
requestId,
|
||||
...(event ? { event } : {}),
|
||||
});
|
||||
return await Promise.reject(err);
|
||||
throw err;
|
||||
}
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user