Skip to content

Commit

Permalink
Fix TypeScript configuration in tsconfig.json files
Browse files Browse the repository at this point in the history
  • Loading branch information
karlhorky committed Oct 13, 2024
1 parent f4fba2d commit b59fcf4
Show file tree
Hide file tree
Showing 19 changed files with 49 additions and 93 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"@types/p-map": "2.0.0",
"@types/semver": "7.5.8",
"eslint": "9.12.0",
"eslint-config-upleveled": "8.7.3",
"eslint-config-upleveled": "8.8.0",
"p-map": "7.0.2",
"prettier": "3.3.3",
"size-limit": "11.1.6",
Expand Down
12 changes: 6 additions & 6 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/checks/allChangesCommittedToGit.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { promises as fs } from 'node:fs';
import { execa } from 'execa';
import { commandExample } from '../util/commandExample';
import { isDrone } from '../util/drone';
import { commandExample } from '../util/commandExample.ts';
import { isDrone } from '../util/drone.ts';

export const title = 'All changes committed to Git';

Expand Down
2 changes: 1 addition & 1 deletion src/checks/linkOnGithubAbout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { load } from 'cheerio';
import type { Element } from 'domhandler';
import { execa } from 'execa';
import fetch from 'node-fetch';
import { randomUserAgent } from '../util/randomUserAgent';
import { randomUserAgent } from '../util/randomUserAgent.ts';

export const title = 'GitHub repo has deployed project link under About';

Expand Down
4 changes: 2 additions & 2 deletions src/checks/noDependencyProblems/noDependenciesWithoutTypes.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { existsSync, promises as fs } from 'node:fs';
import { algoliasearch } from 'algoliasearch';
import pReduce from 'p-reduce';
import { commandExample } from '../../util/commandExample';
import { projectPackageJson } from '../../util/packageJson';
import { commandExample } from '../../util/commandExample.ts';
import { projectPackageJson } from '../../util/packageJson.ts';

const client = algoliasearch(
// Application ID and API key specific to UpLeveled
Expand Down
4 changes: 2 additions & 2 deletions src/checks/noDependencyProblems/noUnusedDependencies.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { execa } from 'execa';
import { commandExample } from '../../util/commandExample';
import { preflightBinPath } from '../../util/preflightBinPath';
import { commandExample } from '../../util/commandExample.ts';
import { preflightBinPath } from '../../util/preflightBinPath.ts';

export const title = 'No unused dependencies';

Expand Down
2 changes: 1 addition & 1 deletion src/checks/noExtraneousFilesCommittedToGit.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { execa } from 'execa';
import { commandExample } from '../util/commandExample';
import { commandExample } from '../util/commandExample.ts';

export const title = 'No extraneous files committed to Git';

Expand Down
2 changes: 1 addition & 1 deletion src/checks/noSecretsCommittedToGit.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { execa } from 'execa';
import { commandExample } from '../util/commandExample';
import { commandExample } from '../util/commandExample.ts';

export const title = 'No secrets committed to Git';

Expand Down
4 changes: 2 additions & 2 deletions src/checks/nodeModulesIgnoredFromGit.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { promises as fs } from 'node:fs';
import { execa } from 'execa';
import { commandExample } from '../util/commandExample';
import { normalizeNewlines } from '../util/crossPlatform';
import { commandExample } from '../util/commandExample.ts';
import { normalizeNewlines } from '../util/crossPlatform.ts';

export const title = 'node_modules/ folder ignored in Git';

Expand Down
4 changes: 2 additions & 2 deletions src/checks/preflightIsLatestVersion.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import os from 'node:os';
import { execa } from 'execa';
import semver from 'semver';
import { commandExample } from '../util/commandExample';
import { preflightPackageJson } from '../util/packageJson';
import { commandExample } from '../util/commandExample.ts';
import { preflightPackageJson } from '../util/packageJson.ts';

export const title = 'Preflight is latest version';

Expand Down
2 changes: 1 addition & 1 deletion src/checks/prettier.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { execa } from 'execa';
import { normalizeNewlines } from '../util/crossPlatform';
import { normalizeNewlines } from '../util/crossPlatform.ts';

export const title = 'Prettier';

Expand Down
2 changes: 1 addition & 1 deletion src/checks/projectFolderNameMatchesCorrectFormat.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import path from 'node:path';
import { commandExample } from '../util/commandExample';
import { commandExample } from '../util/commandExample.ts';

export const title = 'Project folder name matches correct format';

Expand Down
2 changes: 1 addition & 1 deletion src/checks/stylelint.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { sep } from 'node:path';
import { execa } from 'execa';
import { LintResult } from 'stylelint';
import type { LintResult } from 'stylelint';

export const supportedStylelintFileExtensions = [
'css',
Expand Down
2 changes: 1 addition & 1 deletion src/checks/stylelintConfigIsValid.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { createRequire } from 'node:module';
import { execa } from 'execa';
import readdirp from 'readdirp';
import semver from 'semver';
import { supportedStylelintFileExtensions } from './stylelint';
import { supportedStylelintFileExtensions } from './stylelint.ts';

const require = createRequire(`${process.cwd()}/`);

Expand Down
2 changes: 1 addition & 1 deletion src/checks/useSinglePackageManager.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { execa } from 'execa';
import { commandExample } from '../util/commandExample';
import { commandExample } from '../util/commandExample.ts';

export const title = 'Use single package manager';

Expand Down
38 changes: 19 additions & 19 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
import {
Listr,
ListrContext,
ListrDefaultRenderer,
ListrTask,
type ListrContext,
type ListrDefaultRenderer,
type ListrTask,
ListrTaskWrapper,
} from 'listr2';
import * as allChangesCommittedToGit from './checks/allChangesCommittedToGit.js';
import * as eslint from './checks/eslint.js';
import * as eslintConfigIsValid from './checks/eslintConfigIsValid.js';
import * as linkOnGithubAbout from './checks/linkOnGithubAbout.js';
import * as nodeModulesIgnoredFromGit from './checks/nodeModulesIgnoredFromGit.js';
import * as noDependenciesWithoutTypes from './checks/noDependencyProblems/noDependenciesWithoutTypes.js';
import * as noUnusedAndMissingDependencies from './checks/noDependencyProblems/noUnusedDependencies.js';
import * as noExtraneousFilesCommittedToGit from './checks/noExtraneousFilesCommittedToGit.js';
import * as noSecretsCommittedToGit from './checks/noSecretsCommittedToGit.js';
import * as preflightIsLatestVersion from './checks/preflightIsLatestVersion.js';
import * as prettier from './checks/prettier.js';
import * as projectFolderNameMatchesCorrectFormat from './checks/projectFolderNameMatchesCorrectFormat.js';
import * as stylelint from './checks/stylelint.js';
import * as stylelintConfigIsValid from './checks/stylelintConfigIsValid.js';
import * as useSinglePackageManager from './checks/useSinglePackageManager.js';
import * as allChangesCommittedToGit from './checks/allChangesCommittedToGit.ts';
import * as eslint from './checks/eslint.ts';
import * as eslintConfigIsValid from './checks/eslintConfigIsValid.ts';
import * as linkOnGithubAbout from './checks/linkOnGithubAbout.ts';
import * as nodeModulesIgnoredFromGit from './checks/nodeModulesIgnoredFromGit.ts';
import * as noDependenciesWithoutTypes from './checks/noDependencyProblems/noDependenciesWithoutTypes.ts';
import * as noUnusedAndMissingDependencies from './checks/noDependencyProblems/noUnusedDependencies.ts';
import * as noExtraneousFilesCommittedToGit from './checks/noExtraneousFilesCommittedToGit.ts';
import * as noSecretsCommittedToGit from './checks/noSecretsCommittedToGit.ts';
import * as preflightIsLatestVersion from './checks/preflightIsLatestVersion.ts';
import * as prettier from './checks/prettier.ts';
import * as projectFolderNameMatchesCorrectFormat from './checks/projectFolderNameMatchesCorrectFormat.ts';
import * as stylelint from './checks/stylelint.ts';
import * as stylelintConfigIsValid from './checks/stylelintConfigIsValid.ts';
import * as useSinglePackageManager from './checks/useSinglePackageManager.ts';
import {
preflightPackageJson,
projectPackageJson,
} from './util/packageJson.js';
} from './util/packageJson.ts';

const projectDependencies = projectPackageJson.dependencies || {};

Expand Down
3 changes: 1 addition & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"files": [],
"references": [
{ "path": "./docker/tsconfig.json" },
{ "path": "./tsconfig.nonsrc.json" },
{ "path": "./tsconfig.src.json" }
{ "path": "./tsconfig.root.json" }
]
}
15 changes: 4 additions & 11 deletions tsconfig.nonsrc.json → tsconfig.root.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
"extends": "eslint-config-upleveled/tsconfig.base.json",
"compilerOptions": {
"composite": true,
"module": "Node16",
"moduleResolution": "Node16",
"target": "ES2020",
"module": "NodeNext",
"moduleResolution": "NodeNext",
"allowImportingTsExtensions": true,
"checkJs": true
},
"include": [
Expand All @@ -17,12 +17,5 @@
"**/*.cjs",
"**/*.mjs"
],
"exclude": [
"node_modules",
"__tests__/fixtures",
"bin",
"dist",
"docker",
"src"
]
"exclude": ["node_modules", "__tests__/fixtures", "docker"]
}
36 changes: 0 additions & 36 deletions tsconfig.src.json

This file was deleted.

0 comments on commit b59fcf4

Please sign in to comment.