DEFAULT_PARSER_OPTIONS |
ParserOptions |
const |
`{ |
|
disallowAutomaticSingleRunInference: true, |
|
|
|
|
filePath: path.join(FIXTURES_DIR, 'file.ts'), |
|
|
|
|
project: './tsconfig.json', |
|
|
|
|
tsconfigRootDir: FIXTURES_DIR, |
|
|
|
|
} as const satisfies ParserOptions` |
✗ |
|
|
|
sourceCode |
"\nfunction foo<T>(x: T);\n " |
const |
`` |
|
function foo(x: T); |
|
|
|
|
`` |
✗ |
|
|
|
functionNode |
TSESTree.FunctionDeclaration |
const |
ast.body[0] as TSESTree.FunctionDeclaration |
✗ |
parameterNode |
any |
const |
functionNode.params[0] |
✗ |
sourceCode |
"\nfunction foo<T extends unknown>(x: T);\n " |
const |
`` |
|
function foo(x: T); |
|
|
|
|
`` |
✗ |
|
|
|
functionNode |
TSESTree.FunctionDeclaration |
const |
ast.body[0] as TSESTree.FunctionDeclaration |
✗ |
parameterNode |
any |
const |
functionNode.params[0] |
✗ |
sourceCode |
"\nfunction foo<T extends any>(x: T);\n " |
const |
`` |
|
function foo(x: T); |
|
|
|
|
`` |
✗ |
|
|
|
functionNode |
TSESTree.FunctionDeclaration |
const |
ast.body[0] as TSESTree.FunctionDeclaration |
✗ |
parameterNode |
any |
const |
functionNode.params[0] |
✗ |
sourceCode |
"\nfunction foo<T extends string>(x: T);\n " |
const |
`` |
|
function foo(x: T); |
|
|
|
|
`` |
✗ |
|
|
|
functionNode |
TSESTree.FunctionDeclaration |
const |
ast.body[0] as TSESTree.FunctionDeclaration |
✗ |
parameterNode |
any |
const |
functionNode.params[0] |
✗ |
sourceCode |
"\nfunction foo(x: string);\n " |
const |
`` |
|
function foo(x: string); |
|
|
|
|
`` |
✗ |
|
|
|
functionNode |
TSESTree.FunctionDeclaration |
const |
ast.body[0] as TSESTree.FunctionDeclaration |
✗ |
parameterNode |
any |
const |
functionNode.params[0] |
✗ |
sourceCode |
"\nfunction foo<T extends string>() {\n function bar<V extends T>(x: V) {\n }\n}\n " |
const |
`` |
|
function foo() { |
|
|
|
|
function bar(x: V) { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
`` |
✗ |
|
|
|
outerFunctionNode |
TSESTree.FunctionDeclaration |
const |
ast.body[0] as TSESTree.FunctionDeclaration |
✗ |
innerFunctionNode |
TSESTree.FunctionDeclaration |
const |
`outerFunctionNode.body |
|
.body[0] as TSESTree.FunctionDeclaration` |
✗ |
|
|
|
parameterNode |
any |
const |
innerFunctionNode.params[0] |
✗ |
sourceCode |
"\nfunction foo<T>() {\n function bar<V extends T>(x: V) {\n }\n}\n " |
const |
`` |
|
function foo() { |
|
|
|
|
function bar(x: V) { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
`` |
✗ |
|
|
|
outerFunctionNode |
TSESTree.FunctionDeclaration |
const |
ast.body[0] as TSESTree.FunctionDeclaration |
✗ |
innerFunctionNode |
TSESTree.FunctionDeclaration |
const |
`outerFunctionNode.body |
|
.body[0] as TSESTree.FunctionDeclaration` |
✗ |
|
|
|
parameterNode |
any |
const |
innerFunctionNode.params[0] |
✗ |