scalacenter / scalajs-bundler

https://scalacenter.github.io/scalajs-bundler
Other
237 stars 101 forks source link

running eslint-loader on fastOptJS::webpack #309

Open evbo opened 5 years ago

evbo commented 5 years ago

Adding eslint to npmDevDependencies and following just about any tutorial or official docs for running eslint-loader in webpack does not seem to trigger it to run:

npmDevDependencies in Compile ++= Seq(
      ...
      "eslint" -> "6.1.0",
      "eslint-loader" -> "2.2.1",
      "eslint-plugin-react-hooks" -> "1.6.1"
    )

In my webpack config:

module: {
    rules:[
      {
        test: /\.(sc|c)ss$/,
        use: [
            "style-loader",
            "css-loader",
            "sass-loader"
        ]
      },
      {
        test: /\.(png|ttf|otf|eot|svg|woff(2)?)(\?[a-z0-9]+)?$/,
        use: [
          {
            loader: "file-loader",
            options: {
              name: "[hash].[ext]"
            }
          }
        ]
      },
      {
        test: /\.(js)$/,
        exclude: /node_modules/,
        loader: "eslint-loader"
      }
    ]
  }

all of my js source is located in target/scala-2.12/scalajs-bundler/main, so it should be picked up just like all my other loaders right?

I'm expecting to at least get the usual error that .eslintrc is missing, but I see no logs at all for eslint. Is there something fundamentally incompatible with eslint loader and fastOptJS::webpack?