Skip to content

chore(linting) - run oxlint --fix #9209

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Sep 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ function CompareMenuNav({ tabs, state, hooks, changes: changed }: ComponentCompa
{
...tab,
props: {
...(tab.props || {}),
...tab.props,
key,
displayName: (!loading && tab.displayName) || undefined,
active: isActive,
Expand Down
2 changes: 1 addition & 1 deletion e2e/harmony/dependencies/env-jsonc-policies.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ const ENV_JSONC_LEVEL3 = {
},
};

function generateEnvJsoncWithExtends(extendsName: string, envJsonc: Object) {
function generateEnvJsoncWithExtends(extendsName: string, envJsonc: object) {
return {
extends: extendsName,
...envJsonc,
Expand Down
2 changes: 1 addition & 1 deletion scopes/component/component/component.graphql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ export function componentSchema(componentExtension: ComponentMain) {
if (!head && filter?.takeHeadFromComponent) {
head = component.id.version;
}
const finalFilter = { ...filter, ...{ head } };
const finalFilter = { ...filter, head };
return (await component.getLogs(finalFilter)).map((log) => ({ ...log, id: log.hash }));
},
},
Expand Down
2 changes: 1 addition & 1 deletion scopes/component/dev-files/dev-files.main.runtime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ export class DevFilesMain {

mergeEnvManifestPatterns(parent: EnvJsonc, child: EnvJsonc): Partial<EnvJsonc> {
const merged: Partial<EnvJsonc> = {
patterns: { ...(parent.patterns || {}), ...(child.patterns || {}) },
patterns: { ...parent.patterns, ...child.patterns },
};
return merged;
}
Expand Down
2 changes: 1 addition & 1 deletion scopes/defender/mocha/mocha.tester.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export class MochaTester implements Tester {
const specsPerComp = context.specFiles.toArray();
babelRegister({
extensions: ['.es6', '.es', '.jsx', '.js', '.mjs', '.ts', '.tsx'],
...(this.babelConfig || {}),
...this.babelConfig,
});
const componentsResults: ComponentsResults[] = await pMapSeries(specsPerComp, async ([component, files]) => {
const testsFiles: TestsFiles[] = await pMapSeries(files, async (file) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1030,7 +1030,7 @@ export class DependencyResolverMain {
* supported range, force etc')
* if a dep exists with a version value "-" we will remove it from the policy
*/
mergeEnvManifestPolicy(parent: EnvJsonc, child: EnvJsonc): Object {
mergeEnvManifestPolicy(parent: EnvJsonc, child: EnvJsonc): object {
const policy = {};
['peers', 'dev', 'runtime'].forEach((key) => {
policy[key] = cloneDeep(parent.policy?.[key] || []);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ export class WorkspacePolicyFactory {
fromPackageJson(packageJson: Record<string, any>) {
const obj = {
dependencies: {
...(packageJson.devDependencies || {}),
...(packageJson.dependencies || {}),
...packageJson.devDependencies,
...packageJson.dependencies,
},
peerDependencies: {
...(packageJson.peerDependencies || {}),
...packageJson.peerDependencies,
},
};
return this.fromConfigObject(obj);
Expand Down
2 changes: 1 addition & 1 deletion scopes/harmony/diagnostic/diagnostic.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export type DiagnosticFc = () => Object;
export type DiagnosticFc = () => object;

export interface Diagnostic {
diagnosticFn: DiagnosticFc;
Expand Down
2 changes: 1 addition & 1 deletion scopes/lanes/lanes/lanes.main.runtime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1054,7 +1054,7 @@ please create a new lane instead, which will include all components of this lane
* default to remove all of them.
* returns true if the lane has changed
*/
async removeUpdateDependents(laneId: LaneId, ids?: ComponentID[]): Promise<Boolean> {
async removeUpdateDependents(laneId: LaneId, ids?: ComponentID[]): Promise<boolean> {
const lane = await this.loadLane(laneId);
if (!lane) throw new BitError(`unable to find a lane ${laneId.toString()}`);
if (ids?.length) {
Expand Down
2 changes: 1 addition & 1 deletion scopes/pipelines/builder/builder.main.runtime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ export class BuilderMain {
seedersOnly: isolateOptions?.seedersOnly,
originalSeeders: ids,
capsulesBaseDir,
...(builderOptions || {}),
...builderOptions,
};
this.logger.consoleTitle(`Total ${components.length} components to build`);
const buildResult: TaskResultsList = await envs.runOnce(this.buildService, builderServiceOptions);
Expand Down
2 changes: 1 addition & 1 deletion scopes/preview/preview/strategies/component-strategy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export const COMPONENT_STRATEGY_ARTIFACT_NAME = 'preview-component';

type ComponentEntry = {
component: Component;
entries: Object;
entries: object;
};
/**
* bundles all components in a given env into the same bundle.
Expand Down
2 changes: 1 addition & 1 deletion scopes/scope/scope/scope.main.runtime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -875,7 +875,7 @@ export class ScopeMain implements ComponentFactory {
* whether a component is soft-removed.
* the version is required as it can be removed on a lane. in which case, the version is the head in the lane.
*/
async isComponentRemoved(id: ComponentID): Promise<Boolean> {
async isComponentRemoved(id: ComponentID): Promise<boolean> {
const version = id.version;
if (!version) throw new Error(`isComponentRemoved expect to get version, got ${id.toString()}`);
const modelComponent = await this.legacyScope.getModelComponent(id);
Expand Down
2 changes: 1 addition & 1 deletion scopes/typescript/ts-server/process-based-tsserver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ export class ProcessBasedTsServer {
const tsserverPathIsModule = path.extname(tsserverPath) === '.js';
const options = {
silent: true,
execArgv: [...(maxTsServerMemory ? [`--max-old-space-size=${maxTsServerMemory}`] : [])],
execArgv: maxTsServerMemory ? [`--max-old-space-size=${maxTsServerMemory}`] : [],
};
this.tsServerProcess = tsserverPathIsModule ? cp.fork(tsserverPath, args, options) : cp.spawn(tsserverPath, args);

Expand Down
2 changes: 1 addition & 1 deletion scopes/typescript/ts-server/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,5 @@ export function getTsserverExecutable(): string {
}

function isWindows(): boolean {
return /^win/.test(process.platform);
return process.platform.startsWith('win');
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export type GenerateExposeLoadersOptions = {
export function generateExposeLoaders(
exposedEntries: ExposedEntries,
options: GenerateExposeLoadersOptions = {}
): Array<Object> {
): Array<object> {
const loaderPath = options.loaderPath || require.resolve('expose-loader');
const rules = exposedEntries.map((entry) => {
return {
Expand Down
4 changes: 1 addition & 3 deletions scopes/webpack/webpack/config/webpack.dev.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,9 +160,7 @@ export function configFactory(
}),
],

snapshot: {
...(componentPathsRegExps && componentPathsRegExps.length > 0 ? { managedPaths: componentPathsRegExps } : {}),
},
snapshot: componentPathsRegExps && componentPathsRegExps.length > 0 ? { managedPaths: componentPathsRegExps } : {},

watchOptions: {
poll: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -944,7 +944,7 @@ function createComponentCacheKey(id: ComponentID, loadOpts?: ComponentLoadOption
return `${id.toString()}:${JSON.stringify(sortKeys(relevantOpts ?? {}))}`;
}

function sortKeys(obj: Object) {
function sortKeys(obj: object) {
return fromPairs(Object.entries(obj).sort(([k1], [k2]) => k1.localeCompare(k2)));
}

Expand Down
2 changes: 1 addition & 1 deletion scopes/workspace/workspace/workspace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2117,7 +2117,7 @@ the following envs are used in this workspace: ${availableEnvs.join(', ')}`);
isPnpmEnabled,
}),
];
this.componentPathsRegExps = [...pathsExcluding.map((stringPattern) => new RegExp(stringPattern))];
this.componentPathsRegExps = pathsExcluding.map((stringPattern) => new RegExp(stringPattern));
}

getInjectedDirs(component: Component): Promise<string[]> {
Expand Down
2 changes: 1 addition & 1 deletion src/consumer/component/consumer-component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ export default class Component {
/**
* whether the component is deleted (soft removed)
*/
isRemoved(): Boolean {
isRemoved(): boolean {
return Boolean(this.extensions.findCoreExtension(Extensions.remove)?.config?.removed || this.removed);
}

Expand Down
4 changes: 2 additions & 2 deletions src/scope/component-ops/scope-components-importer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -728,8 +728,8 @@ export default class ScopeComponentsImporter {
reasonForImport,
}: {
lane?: Lane;
onlyIfBuilt?: Boolean;
skipComponentsWithDepsGraph?: Boolean;
onlyIfBuilt?: boolean;
skipComponentsWithDepsGraph?: boolean;
reasonForImport?: string;
} = {}
): Promise<VersionDependencies[]> {
Expand Down
2 changes: 1 addition & 1 deletion src/scope/repositories/sources.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export type ComponentDef = {

export type ComponentExistence = {
id: ComponentID;
exists: Boolean;
exists: boolean;
};

export type MergeResult = {
Expand Down