jsx-eslint / eslint-plugin-react

React-specific linting rules for ESLint
MIT License
8.99k stars 2.77k forks source link

label tag not working #1128

Closed LeslieMurphy closed 6 years ago

LeslieMurphy commented 7 years ago

I get parse errors on embedded HTML such as <label htmlFor="lastName">Last Name></label>

Tried 6.10.3 and 6.9.0

ljharb commented 7 years ago

Can you provide more information? Which rule(s) do you need to enable to get the parsing error? Can you create a small repro case?

LeslieMurphy commented 7 years ago

I am using browserify and reactify.and gulp-eslint

my .eslintrc.json has this

"extends": [ "eslint:recommended", "plugin:react/recommended" ],

Is this a reactify error not an es-lint error? Looking again at the log, I think maybe that is the culprit!

{ ReactifyError: E:\React\Pluralsight\psadmin\src\components\authors\authorForm.js: Parse Error: Line 27: Unexpected token > while parsing file: E:\React\Pluralsight\psadmin\src\components\authors\authorForm.js at throwError (E:\React\Pluralsight\psadmin\node_modules\jstransform\node_modules\esprima-fb\esprima.js:2808:21) at throwUnexpected (E:\React\Pluralsight\psadmin\node_modules\jstransform\node_modules\esprima-fb\esprima.js:2870:9) at parseJSXChild (E:\React\Pluralsight\psadmin\node_modules\jstransform\node_modules\esprima-fb\esprima.js:7068:13) at parseJSXElement (E:\React\Pluralsight\psadmin\node_modules\jstransform\node_modules\esprima-fb\esprima.js:7140:31) at parseJSXChild (E:\React\Pluralsight\psadmin\node_modules\jstransform\node_modules\esprima-fb\esprima.js:7066:21) at parseJSXElement (E:\React\Pluralsight\psadmin\node_modules\jstransform\node_modules\esprima-fb\esprima.js:7140:31) at parsePrimaryExpression (E:\React\Pluralsight\psadmin\node_modules\jstransform\node_modules\esprima-fb\esprima.js:3572:20) at parseLeftHandSideExpressionAllowCall (E:\React\Pluralsight\psadmin\node_modules\jstransform\node_modules\esprima-fb\esprima.js:3656:61) at parsePostfixExpression (E:\React\Pluralsight\psadmin\node_modules\jstransform\node_modules\esprima-fb\esprima.js:3696:20) at parseUnaryExpression (E:\React\Pluralsight\psadmin\node_modules\jstransform\node_modules\esprima-fb\esprima.js:3763:16) index: 610, lineNumber: 27, column: 36, description: 'Unexpected token >', name: 'ReactifyError',

            <label htmlFor="lastName">Last Name></label>

            <input type="text"
                name="lastName"

On Mon, Mar 27, 2017 at 7:22 PM, Jordan Harband notifications@github.com wrote:

Can you provide more information? Which rule(s) do you need to enable to get the parsing error? Can you create a small repro case?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/yannickcr/eslint-plugin-react/issues/1128#issuecomment-289634295, or mute the thread https://github.com/notifications/unsubscribe-auth/AEQfIKfHYXY3MiUiE0nxkvHgCB9tUm7Fks5rqGDdgaJpZM4Mq_kl .

ljharb commented 7 years ago

I'm not familiar with "reactify", but indeed it looks like it's trying to parse JSX and doesn't know how.