Skip to content

Commit

Permalink
Fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
vilicvane committed Oct 14, 2023
1 parent 5c48d3c commit 2b88456
Show file tree
Hide file tree
Showing 21 changed files with 40 additions and 31 deletions.
2 changes: 1 addition & 1 deletion general/src/composables/LICENSE.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import * as Path from 'path';

import {composable, handlebars} from '@magicspace/core';

import type {ResolvedOptions} from '../library';
import type {ResolvedOptions} from '../library/index.js';

import {LICENSE_TEMPLATES_DIR} from './@constants';

Expand Down
6 changes: 5 additions & 1 deletion general/src/composables/README.md.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@ import * as Path from 'path';

import {composable, handlebars} from '@magicspace/core';

import type {BadgesOptions, LicenseName, ResolvedOptions} from '../library';
import type {
BadgesOptions,
LicenseName,
ResolvedOptions,
} from '../library/index.js';

import {TEMPLATES_DIR} from './@constants';

Expand Down
2 changes: 1 addition & 1 deletion general/src/composables/ci.yaml.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {composable, yaml} from '@magicspace/core';

import type {ResolvedOptions} from '../library';
import type {ResolvedOptions} from '../library/index.js';

export default composable<ResolvedOptions>(
({defaultBranch, packageManager}) => {
Expand Down
2 changes: 1 addition & 1 deletion general/src/composables/gitignore.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type {Composable, TextFile} from '@magicspace/core';
import {composable, text} from '@magicspace/core';

import type {ResolvedOptions} from '../library';
import type {ResolvedOptions} from '../library/index.js';

const PACKAGE_MANAGER_IGNORE_ENTRIES_DICT = {
pnpm: undefined,
Expand Down
8 changes: 5 additions & 3 deletions general/src/composables/package.json.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ import * as Path from 'path';
import type {JSONFileOptions} from '@magicspace/core';
import {composable, json} from '@magicspace/core';
import {fetchPackageVersions} from '@magicspace/utils';
import _ from 'lodash';

import type {ResolvedOptions} from '../library';
import type {ResolvedOptions} from '../library/index.js';

const hasOwnProperty = Object.prototype.hasOwnProperty;

const JSON_OPTIONS: JSONFileOptions = {
/** @link https://docs.npmjs.com/files/package.json */
Expand Down Expand Up @@ -128,7 +129,7 @@ export default composable<ResolvedOptions>(
};

for (const {name, alias} of packagesSortedByName) {
if (alias !== undefined && !scripts.hasOwnProperty(alias)) {
if (alias !== undefined && !hasOwnProperty.call(scripts, alias)) {
scripts[alias] = WORKSPACE_ALIAS_DICT[packageManager](name);
}
}
Expand Down Expand Up @@ -157,6 +158,7 @@ export default composable<ResolvedOptions>(
...packages.map(packageOptions =>
json(
Path.join(packageOptions.resolvedDir, 'package.json'),
// eslint-disable-next-line @typescript-eslint/no-explicit-any
(data: any) => {
return {
...data,
Expand Down
2 changes: 1 addition & 1 deletion general/src/composables/pnpm-workspace.yaml.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {composable, yaml} from '@magicspace/core';

import type {ResolvedOptions} from '../library';
import type {ResolvedOptions} from '../library/index.js';

export default composable<ResolvedOptions>(
({packageManager, packagesDir, packages}) => {
Expand Down
2 changes: 1 addition & 1 deletion general/src/composables/prettierignore.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {composable, text} from '@magicspace/core';

import type {ResolvedOptions} from '../library';
import type {ResolvedOptions} from '../library/index.js';

const PACKAGE_MANAGER_IGNORE_ENTRIES_DICT = {
pnpm: ['pnpm-lock.yaml'],
Expand Down
2 changes: 1 addition & 1 deletion general/src/composables/prettierrc.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {composable, json} from '@magicspace/core';

import type {PrettierOptions, ResolvedOptions} from '../library';
import type {PrettierOptions, ResolvedOptions} from '../library/index.js';

const DEFAULT_PRETTIER_OPTIONS: PrettierOptions = {
printWidth: 80,
Expand Down
4 changes: 2 additions & 2 deletions general/src/library/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export {default} from './boilerplate';
export * from './boilerplate';
export * from './examples';
export * from './boilerplate.js';
export * from './examples.js';
2 changes: 1 addition & 1 deletion typescript/src/composables/entrances.ts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as Path from 'path';

import {composable, handlebars} from '@magicspace/core';

import type {ResolvedOptions} from '../library';
import type {ResolvedOptions} from '../library/index.js';

import {TEMPLATES_DIR} from './@constants';

Expand Down
5 changes: 3 additions & 2 deletions typescript/src/composables/eslintrc.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import * as Path from 'path';

import {composable, json} from '@magicspace/core';
import _ from 'lodash';

import type {ResolvedOptions} from '../library';
import type {ResolvedOptions} from '../library/index.js';

export default composable<ResolvedOptions>(({resolvedProjects: projects}) => {
return [
// eslint-disable-next-line @typescript-eslint/no-explicit-any
json('.eslintrc.json', (data: any) => {
return {
...data,
Expand All @@ -22,6 +22,7 @@ export default composable<ResolvedOptions>(({resolvedProjects: projects}) => {
};
}),
...projects.map(project =>
// eslint-disable-next-line @typescript-eslint/no-explicit-any
json(Path.join(project.inDir, '.eslintrc.json'), (data: any) => {
return {
...data,
Expand Down
2 changes: 1 addition & 1 deletion typescript/src/composables/gitignore.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {composable, text} from '@magicspace/core';

import type {ResolvedOptions} from '../library';
import type {ResolvedOptions} from '../library/index.js';

export default composable<ResolvedOptions>(({bldDirNames}) =>
bldDirNames.length > 0
Expand Down
2 changes: 1 addition & 1 deletion typescript/src/composables/index.ts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import * as Path from 'path';
import {composable, handlebars} from '@magicspace/core';
import _ from 'lodash';

import type {ResolvedOptions} from '../library';
import type {ResolvedOptions} from '../library/index.js';

import {TEMPLATES_DIR} from './@constants';

Expand Down
2 changes: 1 addition & 1 deletion typescript/src/composables/npmignore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import * as Path from 'path';
import {composable, text} from '@magicspace/core';
import _ from 'lodash';

import type {ResolvedOptions} from '../library';
import type {ResolvedOptions} from '../library/index.js';

export default composable<ResolvedOptions>(
async ({resolvedProjects: projects}) => {
Expand Down
8 changes: 5 additions & 3 deletions typescript/src/composables/package.json.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ import {
} from '@magicspace/utils';
import _ from 'lodash';

import type {ResolvedPackageOptions} from '../../../general/bld/library';
import type {
ResolvedPackageOptions,
PackageExports,
ResolvedOptions,
ResolvedTypeScriptProjectOptions,
} from '../library';
} from '../library/index.js';

const ROOT_DEV_DEPENDENCY_DICT = {
rimraf: '5',
Expand Down Expand Up @@ -58,6 +58,7 @@ export default composable<ResolvedOptions>(
]);

return [
// eslint-disable-next-line @typescript-eslint/no-explicit-any
json('package.json', (data: any) => {
let {scripts = {}} = data;

Expand All @@ -70,7 +71,7 @@ export default composable<ResolvedOptions>(

if (rimrafPattern) {
rimrafScript = `rimraf ${
/[\*{]/.test(rimrafPattern) ? '--glob ' : ''
/[*{]/.test(rimrafPattern) ? '--glob ' : ''
}${rimrafPattern}`;
}
}
Expand Down Expand Up @@ -114,6 +115,7 @@ export default composable<ResolvedOptions>(
};
}),
...packagesWithTypeScriptProject.map(packageOptions =>
// eslint-disable-next-line @typescript-eslint/no-explicit-any
json(packageOptions.packageJSONPath, (data: any) => {
const referencedPackageNames = _.compact(
_.union(
Expand Down
2 changes: 1 addition & 1 deletion typescript/src/composables/prettierignore.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {composable, text} from '@magicspace/core';

import type {ResolvedOptions} from '../library';
import type {ResolvedOptions} from '../library/index.js';

export default composable<ResolvedOptions>(({bldDirNames}) =>
bldDirNames.length > 0
Expand Down
2 changes: 1 addition & 1 deletion typescript/src/composables/tsconfig.json.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import type {JSONFileOptions} from '@magicspace/core';
import {composable, json} from '@magicspace/core';
import _ from 'lodash';

import type {ResolvedOptions} from '../library';
import type {ResolvedOptions} from '../library/index.js';

const JSON_OPTIONS: JSONFileOptions = {
sortKeys: [
Expand Down
3 changes: 2 additions & 1 deletion typescript/src/composables/vscode-settings.json.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import {composable, json} from '@magicspace/core';
import {extendObjectProperties} from '@magicspace/utils';

import type {ResolvedOptions} from '../library';
import type {ResolvedOptions} from '../library/index.js';

export default composable<ResolvedOptions>(
async ({resolvedProjects: projects}) => {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
return json('.vscode/settings.json', (data: any) => {
data = extendObjectProperties(
data,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as Path from 'path';

import {boilerplate, composables} from '@magicspace/core';

import general from '../../../general/bld/library';
import general from '../../../general/bld/library/index.js';

import type {Options} from './options';
import {resolveOptions} from './options';
Expand Down
7 changes: 3 additions & 4 deletions typescript/src/library/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
export {default} from './boilerplate';
export {default} from './@boilerplate.js';

export * from './options';
export * from './boilerplate';
export * from './examples';
export * from './examples.js';
export * from './options.js';
4 changes: 2 additions & 2 deletions typescript/src/library/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ import type {OmitValueOfKey} from 'tslang';
import type {
ResolvedOptions as ResolvedGeneralOptions,
ResolvedPackageOptions as ResolvedGeneralPackageOptions,
} from '../../../general/bld/library';
} from '../../../general/bld/library/index.js';
import {
Options as GeneralOptions,
PackageOptions as GeneralPackageOptions,
resolveOptions as resolveGeneralOptions,
} from '../../../general/bld/library';
} from '../../../general/bld/library/index.js';

export const TypeScriptProjectReferenceOptions = x.object({
package: x.string,
Expand Down

0 comments on commit 2b88456

Please sign in to comment.