Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(typescript-estree): fix filename handling for vue JSX + markdown #1127

Merged
merged 12 commits into from Nov 3, 2019
14 changes: 11 additions & 3 deletions packages/parser/README.md
Expand Up @@ -42,9 +42,17 @@ The following additional configuration options are available by specifying them

- **`ecmaFeatures.jsx`** - default `false`. Enable parsing JSX when `true`. More details can be found [here](https://www.typescriptlang.org/docs/handbook/jsx.html).

- It's `false` on `*.ts` files regardless of this option.
- It's `true` on `*.tsx` files regardless of this option.
- Otherwise, it respects this option.
NOTE: this setting does not effect known file types (.js, .jsx, .ts, .tsx, .json) because the
typescript compiler has its own internal handling for known file extensions. The exact behaviour is as follows:

- if `parserOptions.project` is provided:
- `.js`, `.jsx`, `.tsx` files are parsed as if this is true.
- `.ts` files are parsed as if this is false.
- unknown extensions (`.md`, `.vue`) will respect this setting.
- if `parserOptions.project` is _not_ provided:
- `.js`, `.jsx`, `.tsx` files are parsed as if this is true.
- `.ts` files are parsed as if this is false.
- "unknown" extensions (`.md`, `.vue`) **are parsed as if this is false**.
bradzacher marked this conversation as resolved.
Show resolved Hide resolved

- **`useJSXTextNode`** - default `true`. Please set `false` if you use this parser on ESLint v4. If this is `false`, the parser creates the AST of JSX texts as the legacy style.

Expand Down
12 changes: 11 additions & 1 deletion packages/typescript-estree/README.md
Expand Up @@ -47,7 +47,17 @@ Parses the given string of code with the options provided and returns an ESTree-
// create a top-level comments array containing all comments
comment: false,

// enable parsing JSX. For more details, see https://www.typescriptlang.org/docs/handbook/jsx.html
/*
* enable parsing JSX. For more details, see https://www.typescriptlang.org/docs/handbook/jsx.html
*
* NOTE: this setting does not effect known file types (.js, .jsx, .ts, .tsx, .json) because the
* typescript compiler has its own internal handling for known file extensions.
*
* Exact behaviour:
* - .js, .jsx, .tsx files are parsed as if this is true
* - .ts files are parsed as if this is false
* - unknown extensions (.md, .vue) will respect this setting
*/
jsx: false,

/*
Expand Down