Skip to content

Commit

Permalink
chore: use recommended no-var-requires (faker-js#360)
Browse files Browse the repository at this point in the history
  • Loading branch information
Shinigami92 authored and demipel8 committed Mar 11, 2022
1 parent 52668e4 commit 137f489
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 1 deletion.
1 change: 0 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ module.exports = defineConfig({
'@typescript-eslint/no-unsafe-call': 'off',
'@typescript-eslint/no-unsafe-member-access': 'off',
'@typescript-eslint/no-unsafe-return': 'warn',
'@typescript-eslint/no-var-requires': 'warn',
'@typescript-eslint/restrict-plus-operands': 'warn',
'@typescript-eslint/restrict-template-expressions': [
'error',
Expand Down
3 changes: 3 additions & 0 deletions test/finance.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,9 @@ describe('finance', () => {
});

describe('iban()', () => {
// eslint-disable-next-line @typescript-eslint/no-var-requires
const ibanLib = require('../dist/cjs/iban');

it('returns a random yet formally correct IBAN number', () => {
const iban =
// @ts-expect-error
Expand Down Expand Up @@ -414,6 +416,7 @@ describe('finance', () => {
});

describe('bic()', () => {
// eslint-disable-next-line @typescript-eslint/no-var-requires
const ibanLib = require('../dist/cjs/iban');
it('returns a random yet formally correct BIC number', () => {
const bic = faker.finance.bic();
Expand Down
3 changes: 3 additions & 0 deletions test/finance_iban.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ describe('finance_iban.js', () => {
// Account Code 16 digits
// Total Length 24 chars

// eslint-disable-next-line @typescript-eslint/no-var-requires
const ibanLib = require('../dist/cjs/iban');

it('IBAN for Pakistan is correct', () => {
Expand Down Expand Up @@ -165,6 +166,7 @@ describe('finance_iban.js', () => {
// Chiffre d'indicatif national 0
// Numéro de compte bancaire 0519786457841326

// eslint-disable-next-line @typescript-eslint/no-var-requires
const ibanLib = require('../dist/cjs/iban');

it('IBAN for Turkish is correct', () => {
Expand Down Expand Up @@ -238,6 +240,7 @@ describe('finance_iban.js', () => {

// example IBAN AZ21 NABZ 0000 0000 1370 1000 1944

// eslint-disable-next-line @typescript-eslint/no-var-requires
const ibanLib = require('../dist/cjs/iban');

it('IBAN for Azerbaijan is correct', () => {
Expand Down
1 change: 1 addition & 0 deletions test/locale-imports.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import allLocales from '../src/locales';
describe('locale imports', () => {
for (const locale in allLocales) {
it(`should be possible to directly require('@faker-js/faker/locale/${locale}')`, () => {
// eslint-disable-next-line @typescript-eslint/no-var-requires
const faker = require(`../dist/cjs/locale/${locale}`);

expect(faker).toBeDefined();
Expand Down

0 comments on commit 137f489

Please sign in to comment.