decorators an class properties errors on a react project
See original GitHub issuewhen trying to run on a project with modern/ experimental js features it throws errors
packages/react-common/stores/UsersRepoStore.ts: SyntaxError: This experimental syntax requires enabling the parser plugin: 'classProperties' (10:22)
or
s[error] packages/react-common/stores/RecipesRepoStore.ts: SyntaxError: This experimental syntax requires enabling one of the following parser plugin(s): 'decorators-legacy, decorators' (9:1)
here is my setup:
module.exports = {
singleQuote: true,
printWidth: 120,
useTabs: true,
tabWidth: 2,
semi: true,
arrowParens: 'always',
bracketSpacing: true,
trailingComma: 'es5',
importOrder: ['^\@co\-cooking', '^\.\.\/', '^\.\/(?!style)', '^\.\/style'],
importOrderSeparation: true
};
tried using the typescript & babel parsers but it didn’t work
Issue Analytics
- State:
- Created 3 years ago
- Reactions:3
- Comments:7
Top Results From Across the Web
React-MobX Error: The 'decorators' plugin requires a ' ...
React -MobX Error: The 'decorators' plugin requires a 'decoratorsBeforeExport' option, whose value must be a boolean · Error message says clearly ...
Read more >Documentation - Decorators
A Decorator is a special kind of declaration that can be attached to a class declaration, method, accessor, property, or parameter. Decorators use...
Read more >Better errors handling for ES/Typescript classes
But, when you use class components and want to create a unified way to handle errors in your app, decorators can be helpful....
Read more >typescript-cheatsheet - GitHub Pages
A set of TypeScript related notes used for quick reference. The cheatsheet contains references to types, classes, decorators, and many other TypeScript ...
Read more >Understanding JavaScript decorators
value and ; context . The ; value argument refers to the value being decorated but it is ; undefined if it is...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Hello everyone, I’ve solved this issue! You just need to set option
"parser": "babel-ts", but sorting is breaking as in https://github.com/trivago/prettier-plugin-sort-imports/issues/6.@ayusharma can you update lib for this parser as in https://github.com/trivago/prettier-plugin-sort-imports/issues/6?