Skip to content

Commit

Permalink
fix linter errors
Browse files Browse the repository at this point in the history
  • Loading branch information
pavjacko committed Jun 27, 2023
1 parent c85f6b5 commit e6d7ffc
Show file tree
Hide file tree
Showing 30 changed files with 67 additions and 65 deletions.
3 changes: 2 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,5 @@ build
.vercel

allure-results
pluginTemplates
pluginTemplates
*.d.ts
5 changes: 4 additions & 1 deletion packages/engine-rn-macos/src/commonEngine.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@ export const waitForBundlerIfRequired = async (c) => {
const bundleAssets = getConfigProp(c, c.platform, 'bundleAssets');
if (bundleAssets === true) return;
// return a new promise that does...nothing, just to keep RNV running while the bundler is running
if (keepRNVRunning) return new Promise(() => {});
if (keepRNVRunning)
return new Promise(() => {
//Do nothing
});
return true;
};

Expand Down
5 changes: 4 additions & 1 deletion packages/engine-rn-tvos/src/commonEngine.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@ export const waitForBundlerIfRequired = async (c) => {
const bundleAssets = getConfigProp(c, c.platform, 'bundleAssets');
if (bundleAssets === true) return;
// return a new promise that does...nothing, just to keep RNV running while the bundler is running
if (keepRNVRunning) return new Promise(() => {});
if (keepRNVRunning)
return new Promise(() => {
//Do nothing
});
return true;
};

Expand Down
12 changes: 9 additions & 3 deletions packages/engine-rn-web/__tests__/unitTests/tasks.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ jest.mock('process', () => ({
}));

jest.mock('@rnv/sdk-webpack', () => ({
runWebpackServer: () => {},
runWebpackServer: () => {
//Do nothing
},
}));

const configPropMocks = {
Expand Down Expand Up @@ -130,9 +132,13 @@ jest.mock('rnv', () => {
};
});

beforeEach(() => {});
beforeEach(() => {
//Do nothing
});

afterEach(() => {});
afterEach(() => {
//Do nothing
});

const originTask = {};
const c = generateMockConfig({ platform: 'web' });
Expand Down
1 change: 0 additions & 1 deletion packages/engine-rn-windows/src/adapter.0.64.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
const fs = require('fs');
const path = require('path');
// eslint-disable-next-line import/no-unresolved

const sharedBlacklist = [
/node_modules\/react\/dist\/.*/,
Expand Down
5 changes: 4 additions & 1 deletion packages/engine-rn-windows/src/commonEngine.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@ export const waitForBundlerIfRequired = async (c) => {
const bundleAssets = getConfigProp(c, c.platform, 'bundleAssets');
if (bundleAssets === true) return;
// return a new promise that does...nothing, just to keep RNV running while the bundler is running
if (keepRNVRunning) return new Promise(() => {});
if (keepRNVRunning)
return new Promise(() => {
//Do nothing
});
return true;
};

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
/* eslint-disable no-unused-vars */
/* eslint-disable no-await-in-loop */
/* eslint-disable no-restricted-syntax */
/**
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
Expand All @@ -9,15 +6,14 @@
// DEPS
import { Common, FileUtils, Logger, ProjectManager } from 'rnv';

const chalk = require('chalk');
const path = require('path');
const username = require('username');
const uuid = require('uuid');
const childProcess = require('child_process');
const fs = require('fs');
const os = require('os');
// eslint-disable-next-line no-unused-vars
const _ = require('lodash');
// const _ = require('lodash');
const findUp = require('find-up');
const generator_common_1 = require('./generator-common');
const configUtils_1 = require('./config/configUtils');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
/* eslint-disable no-unused-vars */
/* eslint-disable no-await-in-loop */
/* eslint-disable no-restricted-syntax */

/**
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
Expand All @@ -12,7 +8,7 @@ import path from 'path';
import mustache from 'mustache';
import { Logger } from 'rnv';

const { logInfo, logWarning } = Logger;
const { logInfo } = Logger;

const defaultOptions = {
overwrite: false,
Expand Down
8 changes: 6 additions & 2 deletions packages/engine-rn/__tests__/unitTests/tasks.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,13 @@ jest.mock('rnv', () => {
};
});

beforeEach(() => {});
beforeEach(() => {
//Do nothing
});

afterEach(() => {});
afterEach(() => {
//Do nothing
});

const originTask = {};
const c = generateMockConfig({});
Expand Down
5 changes: 4 additions & 1 deletion packages/engine-rn/src/commonEngine.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,10 @@ export const waitForBundlerIfRequired = async (c) => {
const bundleAssets = getConfigProp(c, c.platform, 'bundleAssets');
if (bundleAssets === true) return;
// return a new promise that does...nothing, just to keep RNV running while the bundler is running
if (keepRNVRunning) return new Promise(() => {});
if (keepRNVRunning)
return new Promise(() => {
//Do nothing
});
return true;
};

Expand Down
2 changes: 1 addition & 1 deletion packages/jest-preset-rnv/mocks.d.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export function generateMockConfig(cOverride?: {}): any;
export function generateMockConfig(cOverride?: any): any;
//# sourceMappingURL=mocks.d.ts.map
8 changes: 5 additions & 3 deletions packages/rnv/src/__tests__/cli.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// import cli from '../../src/cli';

jest.mock('../../src/core/systemManager/logger.js', () => {
const _chalkCols = {
const _chalkCols: any = {
white: (v) => v,
green: (v) => v,
red: (v) => v,
Expand All @@ -14,8 +14,8 @@ jest.mock('../../src/core/systemManager/logger.js', () => {
blue: (v) => v,
cyan: (v) => v,
magenta: (v) => v,
rgb: () => (v) => v,
};
_chalkCols.rgb = () => (v) => v;
_chalkCols.bold = _chalkCols;
const _chalkMono = {
..._chalkCols,
Expand All @@ -35,7 +35,9 @@ jest.mock('../../src/core/systemManager/logger.js', () => {

jest.mock('../../src/core/taskManager/index.js', () => ({
initializeTask: jest.fn(),
findSuitableTask: () => {},
findSuitableTask: () => {
//Do nothing
},
}));

const itShouldResolve = (cmd) => {
Expand Down
12 changes: 8 additions & 4 deletions packages/rnv/src/__tests__/tasks.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jest.mock('../../src/core/systemManager/utils.js', () => ({
}));

jest.mock('../../src/core/systemManager/logger.js', () => {
const _chalkCols = {
const _chalkCols: any = {
white: (v) => v,
green: (v) => v,
red: (v) => v,
Expand All @@ -56,8 +56,8 @@ jest.mock('../../src/core/systemManager/logger.js', () => {
blue: (v) => v,
cyan: (v) => v,
magenta: (v) => v,
rgb: () => (v) => v,
};
_chalkCols.rgb = () => (v) => v;
_chalkCols.bold = _chalkCols;
const _chalkMono = {
..._chalkCols,
Expand Down Expand Up @@ -97,9 +97,13 @@ const c = generateMockConfig({
// const parentTask = null;
const originTask = {};

beforeEach(() => {});
beforeEach(() => {
//Do nothing
});

afterEach(() => {});
afterEach(() => {
//Do nothing
});

test('Execute task.rnv.platform.list', async () => {
const taskManager = require('../../src/core/taskManager/index.js');
Expand Down
2 changes: 1 addition & 1 deletion packages/rnv/src/cli/ora.js
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ class StdinDiscarder {
constructor() {
this.#mutedStream.pipe(process.stdout);

const self = this;
const self = this; //eslint-disable-line
this.#ourEmit = (event, data, ...args) => {
const { stdin } = process;
if (self.#requests > 0 || stdin.emit === self.#ourEmit) {
Expand Down
4 changes: 2 additions & 2 deletions packages/rnv/src/core/adapter/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export const withRNVBabel = (cnf) => (api) => {
api.cache(false);
return withDefaultRNVBabel(cnf);
}
const engine = require(process.env.RNV_ENGINE_PATH); // eslint-disable-line import/no-dynamic-require, global-require
const engine = require(process.env.RNV_ENGINE_PATH);
api.cache(true);
if (engine.withRNVBabel) {
return engine.withRNVBabel(cnf);
Expand All @@ -31,7 +31,7 @@ export const withRNVBabel = (cnf) => (api) => {
};

export const withRNVMetro = (cnf) => {
const engine = require(process.env.RNV_ENGINE_PATH); // eslint-disable-line import/no-dynamic-require, global-require
const engine = require(process.env.RNV_ENGINE_PATH);
if (engine.withRNV) {
return engine.withRNV(cnf);
}
Expand Down
1 change: 0 additions & 1 deletion packages/rnv/src/core/configManager/config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable global-require, import/no-dynamic-require, valid-typeof */
import { writeFileSync, fsExistsSync } from '../systemManager/fileutils';
import { logWarning } from '../systemManager/logger';
import { configSchema } from '../constants';
Expand Down
1 change: 0 additions & 1 deletion packages/rnv/src/core/engineManager/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable import/no-dynamic-require, global-require */
import path from 'path';
import { fsExistsSync, readObjectSync, writeFileSync } from '../systemManager/fileutils';
import { checkAndCreateProjectPackage, installPackageDependencies } from '../systemManager/npmUtils';
Expand Down
5 changes: 3 additions & 2 deletions packages/rnv/src/core/integrationManager/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable global-require, import/no-dynamic-require */
import path from 'path';
import { fsExistsSync } from '../systemManager/fileutils';
// import { getScopedVersion } from '../systemManager/utils';
Expand Down Expand Up @@ -34,4 +33,6 @@ export const loadIntegrations = async (c) => {
}
};

export const registerIntegration = () => {};
export const registerIntegration = () => {
//Do nothing
};
1 change: 0 additions & 1 deletion packages/rnv/src/core/projectManager/buildHooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ export const executePipe = async (c, key) => {
}
};

/* eslint-disable import/no-dynamic-require, global-require */
export const buildHooks = async (c) => {
logDebug('buildHooks');

Expand Down
1 change: 0 additions & 1 deletion packages/rnv/src/core/projectManager/package.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable global-require, import/no-dynamic-require */
import path from 'path';
import semver from 'semver';

Expand Down
4 changes: 3 additions & 1 deletion packages/rnv/src/engine-core/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ import taskRnvLink from './tasks/task.rnv.link';
import taskRnvUnlink from './tasks/task.rnv.unlink';

export default {
initializeRuntimeConfig: () => {},
initializeRuntimeConfig: () => {
//Do nothing
},
tasks: generateEngineTasks([
taskRnvCryptoDecrypt,
taskRnvCryptoEncrypt,
Expand Down
1 change: 0 additions & 1 deletion packages/rnv/src/engine-core/tasks/task.rnv.pkg.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable global-require, import/no-dynamic-require */
import path from 'path';
import semver from 'semver';

Expand Down
16 changes: 5 additions & 11 deletions packages/sdk-android/src/ejector.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import path from 'path';
import { Common, FileUtils, PluginManager, ProjectManager, Resolver } from 'rnv';
import { Common, FileUtils, PluginManager, Resolver } from 'rnv';
// import { logWarning } from 'rnv/dist/core/systemManager/logger';

const {
Expand All @@ -9,13 +9,11 @@ const {
fsReadFileSync,
copyFolderContentsRecursiveSync,
// cleanEmptyFoldersRecursively,
fsMkdirSync,
// fsMkdirSync,
} = FileUtils;
const { getAppFolder, getConfigProp } = Common;
const { doResolvePath } = Resolver;

const { parseFonts } = ProjectManager;

const {
parsePlugins,
// sanitizePluginPath, includesPluginPath
Expand All @@ -26,7 +24,7 @@ export const ejectGradleProject = async (c: any) => {
const monoRoot = getConfigProp(c, c.platform, 'monoRoot');

const rootMonoProjectPath = isMonorepo ? path.join(c.paths.project.dir, monoRoot || '../..') : c.paths.project.dir;
const rootProjectPath = c.paths.project.dir;
// const rootProjectPath = c.paths.project.dir;

const appFolder = path.join(getAppFolder(c), '..');

Expand All @@ -47,9 +45,7 @@ export const ejectGradleProject = async (c: any) => {
const pathNmReplace = '../node_modules/';

const packagesPathMatch = new RegExp(
`${path
.join(rootMonoProjectPath, 'packages')
.replace(/[\/\\^$*+?.()|[\]{}]/g, '\\$&')}\/.+?\/node_modules\/`,
`${path.join(rootMonoProjectPath, 'packages').replace(/[/\\^$*+?.()|[\]{}]/g, '\\$&')}/.+?/node_modules/`,
'g'
);

Expand Down Expand Up @@ -178,9 +174,7 @@ export const ejectGradleProject = async (c: any) => {
const replace2 = '';

const packagesPathMatch = new RegExp(
`${path
.join(rootMonoProjectPath, 'packages')
.replace(/[\/\\^$*+?.()|[\]{}]/g, '\\$&')}\/.+?\/node_modules\/`,
`${path.join(rootMonoProjectPath, 'packages').replace(/[/\\^$*+?.()|[\]{}]/g, '\\$&')}/.+?/node_modules/`,
'g'
);

Expand Down
1 change: 0 additions & 1 deletion packages/sdk-apple/src/xcodeParser.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ export const parseXcodeProject = async (c) => {
const _parseXcodeProject = (c, platform) =>
new Promise((resolve) => {
logTask('_parseXcodeProject');
// eslint-disable-next-line global-require, import/no-dynamic-require
const xcode = require(doResolve('xcode'));
// const xcode = require(`${c.paths.project.nodeModulesDir}/xcode`);
const appFolder = getAppFolder(c);
Expand Down
3 changes: 0 additions & 3 deletions packages/sdk-webpack/src/config/modules.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
/* eslint-disable global-require */
/* eslint-disable import/no-dynamic-require */

const fs = require('fs');
const path = require('path');
const chalk = require('react-dev-utils/chalk');
Expand Down
2 changes: 0 additions & 2 deletions packages/sdk-webpack/src/config/paths.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/* eslint-disable import/no-dynamic-require */

const path = require('path');
const fs = require('fs');
const getPublicUrlOrPath = require('react-dev-utils/getPublicUrlOrPath');
Expand Down
1 change: 0 additions & 1 deletion packages/sdk-webpack/src/config/webpackDevServer.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/* eslint-disable global-require */
/* eslint-disable import/no-dynamic-require */

const fs = require('fs');
const evalSourceMapMiddleware = require('react-dev-utils/evalSourceMapMiddleware');
Expand Down
1 change: 0 additions & 1 deletion packages/sdk-webpack/src/scripts/build.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/* eslint-disable global-require */
/* eslint-disable import/no-dynamic-require */

// Do this as the first thing so that any code reading it knows the right env.

Expand Down
3 changes: 0 additions & 3 deletions packages/sdk-webpack/src/scripts/start.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
/* eslint-disable global-require */
/* eslint-disable import/no-dynamic-require */

// Do this as the first thing so that any code reading it knows the right env.
process.env.BABEL_ENV = 'development';
process.env.NODE_ENV = 'development';
Expand Down
Loading

0 comments on commit e6d7ffc

Please sign in to comment.