question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

decorators an class properties errors on a react project

See original GitHub issue

when 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:closed
  • Created 3 years ago
  • Reactions:3
  • Comments:7

github_iconTop GitHub Comments

2reactions
ZhevnyakVladislavcommented, Feb 10, 2021

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.

1reaction
ZhevnyakVladislavcommented, Feb 10, 2021
Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found