Parcel: @parcel/validator-eslint not showing eslint errors

Created on 11 May 2020  路  3Comments  路  Source: parcel-bundler/parcel

馃悰 bug report

I'm running eslint with custom rules in .eslintrc
When running parcel dev server ESLint errors are detected but not shown.
I've just added a whitespace to the end of a line and that breaks one of my custom rules and what's shown on screen and in the console is the following:

馃毃 @parcel/validator-eslint: ESLint found 1 errors and 0 warnings.
/src/components/app.tsx:12:73
  11  | const App = () => {
  12  |   const session: Auth0Session | null | undefined = useAuthCheckSession() 
  13  | 
  14  |   if (session === undefined) {
  15  |     return null
  16  |   }
  17  | 
  18  |   if (session === null) {
  19  |     window.location.replace('/')
  20  |   }
  21  | 
  22  |   const { LANGUAGE } = window.TIERRA
  23  | 
  24  |   return (
  25  |     <IntlProvider defaultLocale="es" locale={LANGUAGE} messages={localeData[LANGUAGE]}>
  26  |       <>
  27  |         <PanelContainer />
  28  |         <ContentContainer />
  29  |       </>
  30  |     </IntlProvider>
  31  |   )
  32  | }
  33  | 
  34  | render(<App />, document.getElementById('react'))
  35  | 

As you can see, it's showing an error but it's not showing which kind of error.

馃帥 Configuration (.babelrc, package.json, cli command)

My .parcelrc looks like this

{
  "extends": ["@parcel/config-default"],
  "transformers": {
    "*.json": ["@parcel/transformer-json"],
    "*.{gif,jpg,png}": ["@parcel/transformer-raw"],
    "*.{gql,graphql}": ["@parcel/transformer-graphql"],
    "*.svg": ["@parcel/transformer-svg-react"]
  },
  "validators": {
    "*.{ts,tsx}": ["@parcel/validator-typescript", "@parcel/validator-eslint"],
    "*.{js,jsx}": ["@parcel/validator-eslint"]
  }
}

馃 Expected Behavior

Show ESLint error message

馃槸 Current Behavior

Not showing which kind of error is happening

馃敠 Context

It's a big issue because you are completely lost on what's happening

馃實 Your Environment

| Software | Version(s) |
| ---------------- | ---------- |
| Parcel | ^2.0.0-nightly.250
| Node | 12.16.3
| npm/Yarn | 6.14.4
| Operating System | Ubuntu 19.10

Bug 馃攲 Parcel 2 Plugins

Most helpful comment

Thanks!

(The fix for the eslint bug will be in the next nightly)

All 3 comments

This is most caused by a parse error, Parcel would display Parsing error: The keyword 'const' is reserved in this case.

So you need to add an eslintrc that enables typescript, modern ecmascript and jsx.

(The behaviour that the Parsing error is not displayed is a bug in Parcel)

"*.{gql,graphql}": ["@parcel/transformer-graphql"],

Are you using graphql in your project?
Would you mind telling me if you would expect import foo from "./query.gql"; to return an AST object (as it does now) or a string?
(We are probably going to change that in the near future: https://github.com/parcel-bundler/parcel/issues/4511)

Are you using graphql in your project?
Would you mind telling me if you would expect import foo from "./query.gql"; to return an AST object (as it does now) or a string?

Yes we are using GraphQL and I would definetely expect a String. The usage described in that issue about importing and sending via fetch matches exactly our use case.

Thanks!

(The fix for the eslint bug will be in the next nightly)

Was this page helpful?
0 / 5 - 0 ratings