Skip to content

Commit

Permalink
chore: to fix lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Rombelirk committed Apr 30, 2024
1 parent 7ffabb6 commit 1146404
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 16 deletions.
1 change: 0 additions & 1 deletion packages/application-config/src/load-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { MissingOrInvalidConfigError } from './errors';
import type { JSONSchemaForCustomApplicationConfigurationFiles } from './schemas/generated/custom-application.schema';
import type { JSONSchemaForCustomViewConfigurationFiles } from './schemas/generated/custom-view.schema';


function doesFileExist(path: string): boolean {
try {
fs.accessSync(path);
Expand Down
4 changes: 2 additions & 2 deletions packages/codemod/test/transforms.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ import { runSnapshotTest } from 'jscodeshift/dist/testUtils';

const fixturesPath = path.join(__dirname, 'fixtures');

const doesFileExist = (filePath) => {
const doesFileExist = (filePath: string): boolean => {
try {
fs.accessSync(filePath);
return true;
} catch (e) {
return false;
}
}
};

describe.each`
transformName | fixtureName
Expand Down
2 changes: 1 addition & 1 deletion packages/create-mc-app/src/tasks/download-template.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import execa from 'execa';
import { Listr, type ListrTask } from 'listr2';
import { applicationTypes } from '../constants';
import type { TCliTaskOptions } from '../types';
import { throwIfTemplateVersionDoesNotExist } from '../validations';
import { doesFileExist } from '../utils';
import { throwIfTemplateVersionDoesNotExist } from '../validations';

const filesToBeRemoved = ['CHANGELOG.md'];

Expand Down
2 changes: 1 addition & 1 deletion packages/create-mc-app/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const doesFileExist = (path: string): boolean => {
} catch (error) {
return false;
}
}
};

const shouldUseYarn = () => {
try {
Expand Down
8 changes: 4 additions & 4 deletions packages/l10n/scripts/generate-l10n-data.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ const prettierConfig = prettier.resolveConfig.sync();

const doesFileExist = (filePath) => {
try {
fs.accessSync(filePath)
return true
fs.accessSync(filePath);
return true;
} catch (e) {
return false
return false;
}
}
};

const L10N_KEYS = {
COUNTRY: 'country',
Expand Down
14 changes: 7 additions & 7 deletions packages/mc-scripts/src/utils/does-file-exist.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import fs from 'node:fs';

function doesFileExist(path: string): boolean {
try {
fs.accessSync(path);
return true;
} catch (error) {
return false;
}
try {
fs.accessSync(path);
return true;
} catch (error) {
return false;
}
}

export default doesFileExist;
export default doesFileExist;

0 comments on commit 1146404

Please sign in to comment.