Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Brad Zacher <brad.zacher@gmail.com>
  • Loading branch information
JoshuaKGoldberg and bradzacher committed Jan 23, 2023
1 parent 16e52d5 commit 2be55de
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions docs/architecture/Parser.mdx
Expand Up @@ -42,7 +42,7 @@ interface ParserOptions {
lib?: string[];
moduleResolver?: string;
program?: import('typescript').Program;
project?: string | string[] | true;
project?: string[] | true;
projectFolderIgnoreList?: string[];
tsconfigRootDir?: string;
warnOnUnsupportedTypeScriptVersion?: boolean;
Expand Down Expand Up @@ -192,7 +192,7 @@ This option allows you to provide a path to your project's `tsconfig.json`. **Th

- If `true`, each source file's parse will find the nearest `tsconfig.json` file to that source file.

- This is done by checking that source file's directory for a `tsconfig.json`, then the parent's directory for a `tsconfig.json`, and so on - until one is found or the current working directory is passed.
- This is done by checking that source file's directory tree for the nearest `tsconfig.json`.

- If you use project references, TypeScript will not automatically use project references to resolve files. This means that you will have to add each referenced tsconfig to the `project` field either separately, or via a glob.

Expand Down
4 changes: 2 additions & 2 deletions docs/linting/Typed_Linting.md
Expand Up @@ -42,15 +42,15 @@ You may see new rules reporting errors based on type information!
The `parserOptions.project` option can be turned on with either:

- `true`: to always use `tsconfig.json`s nearest to source files
- `string | string[]`: any number of glob paths to match TSConfig files relative to the
- `string[]`: any number of glob paths to match TSConfig files relative to the

For example, if you use a specific `tsconfig.eslint.json` for linting, you'd specify:

```js title=".eslintrc.js"
module.exports = {
// ...
parserOptions: {
project: './tsconfig.eslint.json',
project: ['./tsconfig.eslint.json'],
},
// ...
};
Expand Down
Expand Up @@ -6,7 +6,7 @@ import type { ParseSettings } from '.';

const log = debug('typescript-eslint:typescript-estree:getProjectConfigFiles');

const tsconfigMatchCache = new Map<string, string | undefined>();
const TSCONFIG_MATCH_CACHE = new Map<string, string | undefined>();

/**
* @remarks Only use this for tests!
Expand All @@ -29,7 +29,7 @@ export function getProjectConfigFiles(
project: string | string[] | true | undefined,
): string | string[] | undefined {
if (project !== true) {
return project;
return Array.isArray(project) ? project : [project];
}

log('Looking for tsconfig.json at or above file: %s', parseSettings.filePath);
Expand Down

0 comments on commit 2be55de

Please sign in to comment.