18045 - Properties with the 'accessor' modifier are only available when targeting ECMAScript 2015 and higher
regexFind: /accessor\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*:/
regexReplace: $1:Remove the 'accessor' modifier or update your TypeScript target to ES2015 or higher. Accessor fields are a modern JavaScript feature that requires ES2015+ support.
class MyClass {
- accessor value: string = 'test'
+ value: string = 'test'
}Explanation: Remove accessor modifier for ES5 compatibility
class MyClass {
- accessor private _value: string = 'test'
+ private _value: string = 'test'
}Explanation: Remove accessor modifier from private property
npx tsc ./docs/18045/index.ts --noEmit --prettydocs/18045/index.ts:2:12 - error TS18045: Properties with the 'accessor' modifier are only available when targeting ECMAScript 2015 and higher.
2 accessor value: string = 'test'
~~~~~OR (without --pretty flag):
docs/18045/index.ts(2,12): error TS18045: Properties with the 'accessor' modifier are only available when targeting ECMAScript 2015 and higher.