refactor: Add a few lint rules to test files in /spec (#9815)

This commit is contained in:
Manuel
2025-07-04 20:24:08 +02:00
committed by GitHub
parent 207d241b39
commit 2c29756038
9 changed files with 57 additions and 49 deletions

View File

@@ -647,7 +647,6 @@ describe('Email Verification Token Expiration:', () => {
it_id('b6c87f35-d887-477d-bc86-a9217a424f53')(it)('setting the email on the user should set a new email verification token and new expiration date for the token when expire email verify token flag is set', async () => { it_id('b6c87f35-d887-477d-bc86-a9217a424f53')(it)('setting the email on the user should set a new email verification token and new expiration date for the token when expire email verify token flag is set', async () => {
const user = new Parse.User(); const user = new Parse.User();
let userBeforeEmailReset;
let sendEmailOptions; let sendEmailOptions;
const sendPromise = resolvingPromise(); const sendPromise = resolvingPromise();
@@ -680,7 +679,7 @@ describe('Email Verification Token Expiration:', () => {
return results[0]; return results[0];
}); });
expect(typeof userFromDb).toBe('object'); expect(typeof userFromDb).toBe('object');
userBeforeEmailReset = userFromDb; const userBeforeEmailReset = userFromDb;
// trigger another token generation by setting the email // trigger another token generation by setting the email
user.set('email', 'user@parse.com'); user.set('email', 'user@parse.com');
@@ -713,7 +712,6 @@ describe('Email Verification Token Expiration:', () => {
const user = new Parse.User(); const user = new Parse.User();
let sendEmailOptions; let sendEmailOptions;
let sendVerificationEmailCallCount = 0; let sendVerificationEmailCallCount = 0;
let userBeforeRequest;
const promise1 = resolvingPromise(); const promise1 = resolvingPromise();
const promise2 = resolvingPromise(); const promise2 = resolvingPromise();
const emailAdapter = { const emailAdapter = {
@@ -748,7 +746,7 @@ describe('Email Verification Token Expiration:', () => {
return results[0]; return results[0];
}); });
// store this user before we make our email request // store this user before we make our email request
userBeforeRequest = newUser; const userBeforeRequest = newUser;
expect(sendVerificationEmailCallCount).toBe(1); expect(sendVerificationEmailCallCount).toBe(1);

View File

@@ -48,10 +48,20 @@ module.exports = [
}, },
}, },
rules: { rules: {
"no-console": "off", indent: ["error", 2, { SwitchCase: 1 }],
"no-var": "error", "linebreak-style": ["error", "unix"],
"no-unused-vars": "off", "no-trailing-spaces": "error",
"eol-last": "error",
"space-in-parens": ["error", "never"],
"no-multiple-empty-lines": "warn",
"prefer-const": "error",
"space-infix-ops": "error",
"no-useless-escape": "off", "no-useless-escape": "off",
} "require-atomic-updates": "off",
"object-curly-spacing": ["error", "always"],
curly: ["error", "all"],
"block-spacing": ["error", "always"],
"no-unused-vars": "off",
},
}, },
]; ];