diff --git a/package.json b/package.json index 672c720c..a14231ab 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 25bda6eb..71c7a9c6 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -82,8 +82,8 @@ importers: specifier: 9.12.0 version: 9.12.0(jiti@2.1.2) eslint-config-upleveled: - specifier: 8.7.3 - version: 8.7.3(@babel/core@7.24.4)(@types/eslint@9.6.1)(@types/node@22.7.5)(@types/react-dom@18.2.25)(@types/react@18.2.79)(eslint-plugin-import@2.29.1(@typescript-eslint/parser@8.8.1(eslint@9.12.0(jiti@2.1.2))(typescript@5.6.3))(eslint@9.12.0(jiti@2.1.2)))(eslint@9.12.0(jiti@2.1.2))(globals@15.9.0)(typescript@5.6.3) + specifier: 8.8.0 + version: 8.8.0(@babel/core@7.24.4)(@types/eslint@9.6.1)(@types/node@22.7.5)(@types/react-dom@18.2.25)(@types/react@18.2.79)(eslint-plugin-import@2.29.1(@typescript-eslint/parser@8.8.1(eslint@9.12.0(jiti@2.1.2))(typescript@5.6.3))(eslint@9.12.0(jiti@2.1.2)))(eslint@9.12.0(jiti@2.1.2))(globals@15.9.0)(typescript@5.6.3) p-map: specifier: 7.0.2 version: 7.0.2 @@ -1502,15 +1502,15 @@ packages: peerDependencies: eslint: 9.12.0 - eslint-config-upleveled@8.7.3: - resolution: {integrity: sha512-JnOFPjRTQiW/JW/QZZ7yxfUcT2R8zW+UOTVml3+5cEtnwFv4LUUeaOGquE90L4zOx+59+1vL37rt0VdZetmZBQ==} + eslint-config-upleveled@8.8.0: + resolution: {integrity: sha512-B5JWKaigin2yIrxKHXT6Rhl3bxWyI6d1tKku3yRSgwtUqPxfsnqDv/FyT5Nc+TbUu2kKFxQkbfv8+ISiwQsfXw==} engines: {node: '>=20.9.0'} hasBin: true peerDependencies: '@types/eslint': ^9.6.1 '@types/node': '>=22.7.5' '@types/react': ^18.3.11 - '@types/react-dom': ^18.3.0 + '@types/react-dom': ^18.3.1 eslint: 9.12.0 globals: ^15.11.0 typescript: 5.6.3 @@ -4926,7 +4926,7 @@ snapshots: eslint: 9.12.0(jiti@2.1.2) find-up-simple: 1.0.0 - eslint-config-upleveled@8.7.3(@babel/core@7.24.4)(@types/eslint@9.6.1)(@types/node@22.7.5)(@types/react-dom@18.2.25)(@types/react@18.2.79)(eslint-plugin-import@2.29.1(@typescript-eslint/parser@8.8.1(eslint@9.12.0(jiti@2.1.2))(typescript@5.6.3))(eslint@9.12.0(jiti@2.1.2)))(eslint@9.12.0(jiti@2.1.2))(globals@15.9.0)(typescript@5.6.3): + eslint-config-upleveled@8.8.0(@babel/core@7.24.4)(@types/eslint@9.6.1)(@types/node@22.7.5)(@types/react-dom@18.2.25)(@types/react@18.2.79)(eslint-plugin-import@2.29.1(@typescript-eslint/parser@8.8.1(eslint@9.12.0(jiti@2.1.2))(typescript@5.6.3))(eslint@9.12.0(jiti@2.1.2)))(eslint@9.12.0(jiti@2.1.2))(globals@15.9.0)(typescript@5.6.3): dependencies: '@babel/eslint-parser': 7.25.8(@babel/core@7.24.4)(eslint@9.12.0(jiti@2.1.2)) '@eslint/compat': 1.2.0(eslint@9.12.0(jiti@2.1.2)) diff --git a/src/checks/allChangesCommittedToGit.ts b/src/checks/allChangesCommittedToGit.ts index c5f074e2..437b12b9 100644 --- a/src/checks/allChangesCommittedToGit.ts +++ b/src/checks/allChangesCommittedToGit.ts @@ -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'; diff --git a/src/checks/linkOnGithubAbout.ts b/src/checks/linkOnGithubAbout.ts index 71fa528d..8e81c75a 100644 --- a/src/checks/linkOnGithubAbout.ts +++ b/src/checks/linkOnGithubAbout.ts @@ -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'; diff --git a/src/checks/noDependencyProblems/noDependenciesWithoutTypes.ts b/src/checks/noDependencyProblems/noDependenciesWithoutTypes.ts index 59003801..7c3c800c 100644 --- a/src/checks/noDependencyProblems/noDependenciesWithoutTypes.ts +++ b/src/checks/noDependencyProblems/noDependenciesWithoutTypes.ts @@ -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 diff --git a/src/checks/noDependencyProblems/noUnusedDependencies.ts b/src/checks/noDependencyProblems/noUnusedDependencies.ts index 233b543b..7e46bfed 100644 --- a/src/checks/noDependencyProblems/noUnusedDependencies.ts +++ b/src/checks/noDependencyProblems/noUnusedDependencies.ts @@ -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'; diff --git a/src/checks/noExtraneousFilesCommittedToGit.ts b/src/checks/noExtraneousFilesCommittedToGit.ts index 1479acbb..a704b1e5 100644 --- a/src/checks/noExtraneousFilesCommittedToGit.ts +++ b/src/checks/noExtraneousFilesCommittedToGit.ts @@ -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'; diff --git a/src/checks/noSecretsCommittedToGit.ts b/src/checks/noSecretsCommittedToGit.ts index 425ec14c..7f0d640d 100644 --- a/src/checks/noSecretsCommittedToGit.ts +++ b/src/checks/noSecretsCommittedToGit.ts @@ -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'; diff --git a/src/checks/nodeModulesIgnoredFromGit.ts b/src/checks/nodeModulesIgnoredFromGit.ts index f345b225..98832c8a 100644 --- a/src/checks/nodeModulesIgnoredFromGit.ts +++ b/src/checks/nodeModulesIgnoredFromGit.ts @@ -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'; diff --git a/src/checks/preflightIsLatestVersion.ts b/src/checks/preflightIsLatestVersion.ts index bd23d782..8d15971e 100644 --- a/src/checks/preflightIsLatestVersion.ts +++ b/src/checks/preflightIsLatestVersion.ts @@ -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'; diff --git a/src/checks/prettier.ts b/src/checks/prettier.ts index 473eabf6..f46c0c48 100644 --- a/src/checks/prettier.ts +++ b/src/checks/prettier.ts @@ -1,5 +1,5 @@ import { execa } from 'execa'; -import { normalizeNewlines } from '../util/crossPlatform'; +import { normalizeNewlines } from '../util/crossPlatform.ts'; export const title = 'Prettier'; diff --git a/src/checks/projectFolderNameMatchesCorrectFormat.ts b/src/checks/projectFolderNameMatchesCorrectFormat.ts index ff4525a3..bb49fc4e 100644 --- a/src/checks/projectFolderNameMatchesCorrectFormat.ts +++ b/src/checks/projectFolderNameMatchesCorrectFormat.ts @@ -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'; diff --git a/src/checks/stylelint.ts b/src/checks/stylelint.ts index 1f186bb9..31378d54 100644 --- a/src/checks/stylelint.ts +++ b/src/checks/stylelint.ts @@ -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', diff --git a/src/checks/stylelintConfigIsValid.ts b/src/checks/stylelintConfigIsValid.ts index 633b28f7..de04cdcd 100644 --- a/src/checks/stylelintConfigIsValid.ts +++ b/src/checks/stylelintConfigIsValid.ts @@ -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()}/`); diff --git a/src/checks/useSinglePackageManager.ts b/src/checks/useSinglePackageManager.ts index 59b16353..b27b393b 100644 --- a/src/checks/useSinglePackageManager.ts +++ b/src/checks/useSinglePackageManager.ts @@ -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'; diff --git a/src/index.ts b/src/index.ts index 6e2bb7dc..2378fc94 100644 --- a/src/index.ts +++ b/src/index.ts @@ -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 || {}; diff --git a/tsconfig.json b/tsconfig.json index a33910ab..bdfab1b8 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -3,7 +3,6 @@ "files": [], "references": [ { "path": "./docker/tsconfig.json" }, - { "path": "./tsconfig.nonsrc.json" }, - { "path": "./tsconfig.src.json" } + { "path": "./tsconfig.root.json" } ] } diff --git a/tsconfig.nonsrc.json b/tsconfig.root.json similarity index 62% rename from tsconfig.nonsrc.json rename to tsconfig.root.json index 094e0cce..aa6f4c3f 100644 --- a/tsconfig.nonsrc.json +++ b/tsconfig.root.json @@ -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": [ @@ -17,12 +17,5 @@ "**/*.cjs", "**/*.mjs" ], - "exclude": [ - "node_modules", - "__tests__/fixtures", - "bin", - "dist", - "docker", - "src" - ] + "exclude": ["node_modules", "__tests__/fixtures", "docker"] } diff --git a/tsconfig.src.json b/tsconfig.src.json deleted file mode 100644 index 5a2efa56..00000000 --- a/tsconfig.src.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "include": ["src"], - "exclude": ["dist"], - "compilerOptions": { - "module": "esnext", - "lib": ["dom", "esnext"], - "target": "es2020", - "importHelpers": true, - // output .d.ts declaration files for consumers - "declaration": true, - // output .js.map sourcemap files for consumers - "sourceMap": true, - // match output dir to input dir. e.g. dist/index instead of dist/src/index - "rootDir": "./src", - // stricter type-checking for stronger correctness. Recommended by TS - "strict": true, - // linter checks for common issues - "noImplicitReturns": true, - "noUncheckedIndexedAccess": true, - "noFallthroughCasesInSwitch": true, - // use Node's module resolution algorithm, instead of the legacy TS one - "moduleResolution": "bundler", - // transpile JSX to React.createElement - "jsx": "react", - // interop between ESM and CJS modules. Recommended by TS - "esModuleInterop": true, - // significant perf increase by skipping checking .d.ts files, particularly those in node_modules. Recommended by TS - "skipLibCheck": true, - // error out if import and file system have a casing mismatch. Recommended by TS - "forceConsistentCasingInFileNames": true, - // `tsdx build` ignores this option, but it is commonly used when type-checking separately with `tsc` - "noEmit": true, - "resolveJsonModule": true, - "checkJs": true - } -}