Skip to content
This repository has been archived by the owner on Mar 10, 2024. It is now read-only.

Commit

Permalink
chore: bump dependencies and fix code style (#181)
Browse files Browse the repository at this point in the history
Co-authored-by: Ryan Wilson-Perkin <ryanwilsonperkin@gmail.com>
Co-authored-by: Stephan Meijer <stephan.meijer@gmail.com>
  • Loading branch information
3 people authored Oct 1, 2023
1 parent a7a824b commit bebf8a5
Show file tree
Hide file tree
Showing 10 changed files with 12,459 additions and 7,445 deletions.
19,850 changes: 12,435 additions & 7,415 deletions package-lock.json

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@
"analysis"
],
"dependencies": {
"@typescript-eslint/parser": "^5.27.1",
"@typescript-eslint/typescript-estree": "^5.27.1",
"@typescript-eslint/parser": "^6.7.3",
"@typescript-eslint/typescript-estree": "^6.7.3",
"chalk": "^4.1.0",
"cosmiconfig": "^8.3.6",
"debug": "^4.3.2",
Expand All @@ -52,7 +52,7 @@
"resolve": "^1.20.0",
"simple-git": "^3.18.0",
"term-size": "^2.2.1",
"typescript": "^4.3.5",
"typescript": "^5.2.2",
"yargs": "^16.2.0"
},
"devDependencies": {
Expand All @@ -64,22 +64,22 @@
"@types/node": "^14.14.31",
"@types/resolve": "^1.20.1",
"@types/yargs": "^16.0.0",
"@typescript-eslint/eslint-plugin": "^5.27.1",
"@typescript-eslint/eslint-plugin": "^6.7.3",
"console-testing-library": "0.6.0",
"eslint": "^7.20.0",
"eslint-config-prettier": "^8.1.0",
"eslint-plugin-prettier": "^3.3.1",
"husky": "^5.1.1",
"jest": "^26.6.3",
"jest": "^29.1.1",
"jest-in-case": "^1.0.2",
"jest-partial": "^1.0.1",
"lint-staged": "^13.2.1",
"nodemon": "^2.0.7",
"nodemon": "^3.0.1",
"patch-package": "^6.4.7",
"pinst": "^2.1.6",
"prettier": "^2.2.1",
"rimraf": "^3.0.2",
"ts-jest": "^26.5.2",
"ts-jest": "^29.1.1",
"ts-node": "^10.9.1"
},
"husky": {
Expand Down
4 changes: 2 additions & 2 deletions src/__tests__/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1233,7 +1233,7 @@ import bar from './bar';
([filePath]) => path.basename(filePath),
),
).toMatchInlineSnapshot(`
Array [
[
"bar.js",
"bar.js",
"index.js",
Expand Down Expand Up @@ -1273,7 +1273,7 @@ import bar from './bar';
([filePath]) => path.basename(filePath),
),
).toMatchInlineSnapshot(`
Array [
[
"bar.js",
"bar.js",
"index.js",
Expand Down
8 changes: 3 additions & 5 deletions src/__tests__/help.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@ import { exec } from 'child_process';
const execAsync = promisify(exec);

test('npx unimported --help', async () => {
// the async call below can take longer than the default 5 seconds,
// so increase as necessary.
jest.setTimeout(10000);

// note about `./` path: jest executes the tests from the root directory
let execResults;
if (process.platform === 'win32') {
Expand Down Expand Up @@ -60,4 +56,6 @@ test('npx unimported --help', async () => {
--show-unresolved-imports formats and only prints unresolved imports
[boolean]"
`);
});
// the async call below can take longer than the default 5 seconds,
// so increase as necessary.
}, 10000);
1 change: 0 additions & 1 deletion src/fs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { join, relative } from 'path';
import glob, { IOptions as GlobOptions } from 'glob';
import util from 'util';
import json5 from 'json5';
import { typedBoolean } from './meta';
import resolve from 'resolve';

const globAsync = util.promisify(glob);
Expand Down
3 changes: 1 addition & 2 deletions src/presets/next.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { expandGlob, Preset } from '../config';
import { Preset } from '../config';
import nodePreset from './node';
import { exists } from '../fs';

const preset: Preset = {
name: 'next',
Expand Down
4 changes: 1 addition & 3 deletions src/presets/node.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import { Preset, UnimportedConfig } from '../config';
import path from 'path';
import resolve from 'resolve';
import { Preset } from '../config';
import { typedBoolean } from '../meta';
import { resolveFilesSync } from '../fs';

Expand Down
2 changes: 1 addition & 1 deletion src/presets/react-native.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Preset } from '../config';
import nodePreset from './node';
import { list, resolveFilesSync } from '../fs';
import { resolveFilesSync } from '../fs';
import { typedBoolean } from '../meta';

function getEntry(target: string, rootExtensions: string[]) {
Expand Down
11 changes: 4 additions & 7 deletions src/traverse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@ import {
simpleTraverse,
} from '@typescript-eslint/typescript-estree';
import * as fs from './fs';
import type {
Identifier,
Literal,
} from '@typescript-eslint/types/dist/generated/ast-spec';
import resolve from 'resolve';
import removeFlowTypes from 'flow-remove-types';
import {
Expand All @@ -20,6 +16,7 @@ import {
} from './cache';
import { log } from './log';
import { MapLike } from 'typescript';
import type { TSESTree } from '@typescript-eslint/types';

export interface FileStats {
path: string;
Expand Down Expand Up @@ -290,13 +287,13 @@ async function parse(path: string, config: TraverseConfig): Promise<FileStats> {
target = source.quasis[0].value.cooked;
}
} else {
target = (source as Literal).value as string;
target = (source as TSESTree.Literal).value as string;
}
break;

// require('./x') || await require('./x')
case AST_NODE_TYPES.CallExpression: {
if ((node.callee as Identifier)?.name !== 'require') {
if ((node.callee as TSESTree.Identifier)?.name !== 'require') {
break;
}

Expand All @@ -311,7 +308,7 @@ async function parse(path: string, config: TraverseConfig): Promise<FileStats> {
target = argument.quasis[0].value.cooked;
}
} else {
target = (argument as Literal).value as string;
target = (argument as TSESTree.Literal).value as string;
}
break;
}
Expand Down
7 changes: 5 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
{
"compileOnSave": false,
"compilerOptions": {
"lib": [
"ESNext",
],
"rootDir": "src",
"target": "ES2015",
"module": "CommonJS",
"moduleResolution": "node",
"module": "nodenext",
"moduleResolution": "nodenext",
"outDir": "./dist",
"isolatedModules": true,
"strict": true,
Expand Down

0 comments on commit bebf8a5

Please sign in to comment.