Skip to content

Commit e59ec9e

Browse files
committed
refactor: rename the option to tsSyntaxInTemplates
1 parent 3d3965f commit e59ec9e

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ configureVueProject({
6868
// Setting it to `false` could improve performance.
6969
// But TypeScript syntax in Vue templates will then lead to syntax errors.
7070
// Also, type-aware rules won't be applied to expressions in templates in that case.
71-
tsInTemplates: true,
71+
tsSyntaxInTemplates: true,
7272

7373
// Optional: specify the script langs in `.vue` files
7474
// Defaults to `['ts']`.

examples/disable-ts-in-templates/eslint.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import {
66
} from '@vue/eslint-config-typescript'
77

88
configureVueProject({
9-
tsInTemplates: false,
9+
tsSyntaxInTemplates: false,
1010
})
1111

1212
export default defineConfigWithVueTs(

src/internals.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export const additionalRulesRequiringParserServices = [
3232
]
3333

3434
export function createBasicSetupConfigs(
35-
tsInTemplates: boolean,
35+
tsSyntaxInTemplates: boolean,
3636
scriptLangs: ScriptLang[],
3737
): ConfigArray {
3838
const mayHaveJsxInSfc =
@@ -53,7 +53,7 @@ export function createBasicSetupConfigs(
5353

5454
// If the user explicitly opts out of parsing TypeScript syntax in Vue templates,
5555
// force using `espree` for the template parser for better performance.
56-
if (!tsInTemplates) {
56+
if (!tsSyntaxInTemplates) {
5757
parser['<template>'] = 'espree'
5858
}
5959

src/utilities.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export type ProjectOptions = {
2727
* But TypeScript syntax in Vue templates will then lead to syntax errors.
2828
* Also, type-aware rules won't be applied to expressions in templates in that case.
2929
*/
30-
tsInTemplates?: boolean
30+
tsSyntaxInTemplates?: boolean
3131

3232
/**
3333
* Allowed script languages in `vue` files.
@@ -43,16 +43,16 @@ export type ProjectOptions = {
4343
}
4444

4545
let projectOptions: ProjectOptions = {
46-
tsInTemplates: true,
46+
tsSyntaxInTemplates: true,
4747
scriptLangs: ['ts'],
4848
rootDir: process.cwd(),
4949
}
5050

5151
// This function, if called, is guaranteed to be executed before `defineConfigWithVueTs`,
5252
// so mutating the `projectOptions` object is safe and will be reflected in the final ESLint config.
5353
export function configureVueProject(userOptions: ProjectOptions): void {
54-
if (userOptions.tsInTemplates !== undefined) {
55-
projectOptions.tsInTemplates = userOptions.tsInTemplates
54+
if (userOptions.tsSyntaxInTemplates !== undefined) {
55+
projectOptions.tsSyntaxInTemplates = userOptions.tsSyntaxInTemplates
5656
}
5757
if (userOptions.scriptLangs) {
5858
projectOptions.scriptLangs = userOptions.scriptLangs
@@ -127,7 +127,7 @@ function insertAndReorderConfigs(
127127

128128
return [
129129
...configsWithoutTypeAwareRules.slice(0, lastExtendedConfigIndex + 1),
130-
...createBasicSetupConfigs(projectOptions.tsInTemplates!, projectOptions.scriptLangs!),
130+
...createBasicSetupConfigs(projectOptions.tsSyntaxInTemplates!, projectOptions.scriptLangs!),
131131

132132
// user-turned-off type-aware rules must come after the last extended config
133133
// in case some rules re-enabled by the extended config

0 commit comments

Comments
 (0)