Skip to content

Commit

Permalink
infra(unicorn): no-for-loop (#2490)
Browse files Browse the repository at this point in the history
  • Loading branch information
ST-DDT authored Oct 24, 2023
1 parent 79c0f25 commit 74f6bbd
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
1 change: 0 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ module.exports = defineConfig({
'unicorn/no-array-callback-reference': 'off',
'unicorn/no-array-reduce': 'off',
'unicorn/no-await-expression-member': 'off',
'unicorn/no-for-loop': 'off',
'unicorn/no-negated-condition': 'off',
'unicorn/no-object-as-default-parameter': 'off',
'unicorn/no-useless-switch-case': 'off',
Expand Down
4 changes: 2 additions & 2 deletions src/modules/finance/iban.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1398,8 +1398,8 @@ const iban: Iban = {
],
mod97: (digitStr) => {
let m = 0;
for (let i = 0; i < digitStr.length; i++) {
m = (m * 10 + +digitStr[i]) % 97;
for (const element of digitStr) {
m = (m * 10 + +element) % 97;
}

return m;
Expand Down
6 changes: 3 additions & 3 deletions test/docs/versions.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ describe.runIf(isFakerOrigin())('docs versions', () => {
semver.valid(version)
);
const latestMajorRelease = semver.major(releaseVersions[0].version);
for (let i = 0; i < releaseVersions.length; i++) {
const { version, link } = releaseVersions[i];
for (const [index, value] of releaseVersions.entries()) {
const { version, link } = value;
const oldMajorVersion = semver.major(version);
expect(oldMajorVersion).toBe(latestMajorRelease - i);
expect(oldMajorVersion).toBe(latestMajorRelease - index);
expect(link).toBe(`https://v${oldMajorVersion}.fakerjs.dev/`);
}
});
Expand Down

0 comments on commit 74f6bbd

Please sign in to comment.