Tool for checking codestyle in JSX files

There are many beautiful code formatting tools for vanilla javascript. For example, JSCS . Is there any tool that can check and format reaction patterns?

I have an error similar to this one at the moment

Unexpected token < at static/view/Auth.jsx : 34 | 35 | return ( 36 | <div className="auth-page"></div> 
+5
source share
1 answer

AOC can be used with React. You must add the --esprima=esprima-fb flag to make it compatible with jsx syntax.

If you start your AOC from cmd: jscs path[ path[...]] --esprima=esprima-fb

If you have a .jscrsc configuration file, add "esprima" : "esprima-fb"

+7
source

Source: https://habr.com/ru/post/1213453/


All Articles