Preact-cli: eslint-plugin-preact

Created on 12 Jun 2018  路  2Comments  路  Source: preactjs/preact-cli

Can't use eslint-plugin-react since they are not compatible.

using eslint-plugin-react

/Users/sprlwrks/projects/test-app/src/components/app.js
  16:14  error  Parsing error: Unexpected token =

/Users/sprlwrks/projects/test-app/src/components/header/index.js
   1:10  error  'h' is defined but never used                            no-unused-vars
   6:2   error  'React' must be in scope when using JSX                  react/react-in-jsx-scope
   6:10  error  Unknown property 'class' found, use 'className' instead  react/no-unknown-property
   7:3   error  'React' must be in scope when using JSX                  react/react-in-jsx-scope
   8:3   error  'React' must be in scope when using JSX                  react/react-in-jsx-scope
   9:4   error  'React' must be in scope when using JSX                  react/react-in-jsx-scope
  10:4   error  'React' must be in scope when using JSX                  react/react-in-jsx-scope
  11:4   error  'React' must be in scope when using JSX                  react/react-in-jsx-scope

/Users/sprlwrks/projects/test-app/src/manifest.json
  2:9  error  Parsing error: Unexpected token :

/Users/sprlwrks/projects/test-app/src/routes/home/index.js
  1:10  error  'h' is defined but never used                            no-unused-vars
  5:2   error  'React' must be in scope when using JSX                  react/react-in-jsx-scope
  5:7   error  Unknown property 'class' found, use 'className' instead  react/no-unknown-property
  6:3   error  'React' must be in scope when using JSX                  react/react-in-jsx-scope
  7:3   error  'React' must be in scope when using JSX                  react/react-in-jsx-scope

/Users/sprlwrks/projects/test-app/src/routes/profile/index.js
  5:8  error  Parsing error: Unexpected token =

/Users/sprlwrks/projects/test-app/src/tests/header.test.js
   1:10  error  'h' is defined but never used            no-unused-vars
  10:27  error  'React' must be in scope when using JSX  react/react-in-jsx-scope
  12:23  error  'React' must be in scope when using JSX  react/react-in-jsx-scope
wontfix

Most helpful comment

All 2 comments

There are a bunch - it doesn't make sense to use eslint-plugin-react in a Preact project.

I also maintain one here that we use for various things:
https://github.com/developit/eslint-config-developit

We already scaffold eslint-config-synacor. If you're looking for additional rules to be added to that configuration, it might be better to file an issue there.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

hesselbom picture hesselbom  路  3Comments

oren picture oren  路  3Comments

nephix picture nephix  路  4Comments

thangngoc89 picture thangngoc89  路  3Comments

oren picture oren  路  4Comments