-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Closed
Labels
accepting prsGo ahead, send a pull request that resolves this issueGo ahead, send a pull request that resolves this issueenhancementNew feature or requestNew feature or requestlocked due to agePlease open a new issue if you'd like to say more. See https://typescript-eslint.io/contributing.Please open a new issue if you'd like to say more. See https://typescript-eslint.io/contributing.
Description
Before You File a Proposal Please Confirm You Have Done The Following...
- I have searched for related issues and found none that match my proposal.
- I have searched the current rule list and found no rules that match my proposal.
- I have read the FAQ and my problem is not listed.
Relevant Package
parser
My proposal is suitable for this project
- I believe my proposal would be useful to the broader TypeScript community (meaning it is not a niche proposal).
Description
I expect that these should throw (when validating parser options):
import tseslint from 'typescript-eslint';
export default tseslint.config(
tseslint.configs.strictTypeChecked,
{
languageOptions: {
parserOptions: {
projectService: true,
tsconfigRootDir: 'not/an/absolute/path',
}
}
}
);(or tsconfigRootDir: 42, or tsconfigRootDir: '.').
In other words, I think the following...
typescript-eslint/packages/typescript-estree/src/parseSettings/createParseSettings.ts
Lines 47 to 56 in 7126c3a
| export function createParseSettings( | |
| code: string | ts.SourceFile, | |
| tsestreeOptions: Partial<TSESTreeOptions> = {}, | |
| ): MutableParseSettings { | |
| const codeFullText = enforceCodeString(code); | |
| const singleRun = inferSingleRun(tsestreeOptions); | |
| const tsconfigRootDir = | |
| typeof tsestreeOptions.tsconfigRootDir === 'string' | |
| ? tsestreeOptions.tsconfigRootDir | |
| : getInferredTSConfigRootDir(); |
...should have (roughly)
assert(
tsestreeOptions.tsconfigRootDir == null ||
(typeof tsestreeOptions.tsconfigRootDir === "string" &&
path.isAbsolute(tsestreeOptions.tsconfigRootDir)),
);Additional Info
Metadata
Metadata
Assignees
Labels
accepting prsGo ahead, send a pull request that resolves this issueGo ahead, send a pull request that resolves this issueenhancementNew feature or requestNew feature or requestlocked due to agePlease open a new issue if you'd like to say more. See https://typescript-eslint.io/contributing.Please open a new issue if you'd like to say more. See https://typescript-eslint.io/contributing.