Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Recommended rules violations are not reported with webpack and eslint-loader #657

Closed
GaryB432 opened this issue Jun 28, 2019 · 6 comments
Closed
Labels
external This issue is with another package, not typescript-eslint itself package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin working as intended Issues that are closed as they are working as intended

Comments

@GaryB432
Copy link

GaryB432 commented Jun 28, 2019

Repro

webpack.config.js snippet

  module: {
    rules: [
      {
        test: /\.ts$/,
        loader: 'ts-loader',
      },
      {
        enforce: 'pre',
        test: /\.ts$/,
        exclude: /node_modules/,
        loader: 'eslint-loader',
        options: {
          formatter: FriendlyFormatter,
          parser: '@typescript-eslint/parser',
          extends: [
            'plugin:@typescript-eslint/recommended',
          ],
          plugins: ['@typescript-eslint'],
          // rules: { // works with rules like this
          //   'sort-keys': 2,
          //   '@typescript-eslint/explicit-function-return-type': 2,
          // },
          env: {
            browser: true,
            node: true,
          },
        },
      },
    ],
  },
const someObj = {
  b: 9,
  a: 4,  // member out of order
};

export function someNumber() { // no return type
  return undefined;
}

console.log(someNumber()!); // non-null assertion

Expected Result

All the violations of recommended rules would be reported

Actual Result

No violations are reported

Additional Info

The violations are reported if I spell out the rules in the webpack config's options.rules.

Repro repo is available on github

run npm build

Versions

package version
@typescript-eslint/eslint-plugin 1.11.0
@typescript-eslint/parser 1.11.0
TypeScript 3.5.2
ESLint 6.0.1
node 10.16.0
npm 6.0.0
ts-loader 6.0.4
eslint-loader 2.1.2
@GaryB432 GaryB432 added package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin triage Waiting for maintainers to take a look labels Jun 28, 2019
@GaryB432
Copy link
Author

an alternative title might be webpack config options.extends seems to be not working

@bradzacher
Copy link
Member

This seems like an issue that belongs in the eslint-loader repo?

@bradzacher bradzacher added awaiting response Issues waiting for a reply from the OP or another party and removed triage Waiting for maintainers to take a look labels Jun 28, 2019
@GaryB432
Copy link
Author

looks like they have an issue. webpack-contrib/eslint-loader#272

I guess I'll hold off on eslint@6 for now. Oh well.

I am updating my yeoman generator from tslint and wanted to be up-to-date GaryB432/generator-webpack-ts

@bradzacher bradzacher added external This issue is with another package, not typescript-eslint itself working as intended Issues that are closed as they are working as intended and removed awaiting response Issues waiting for a reply from the OP or another party labels Jun 28, 2019
@bradzacher
Copy link
Member

Ahh so it's a KP in the loader. Good to know!

I'll close this issue then.
Thanks for bringing this to our attention.

@GaryB432
Copy link
Author

a KP?

@bradzacher
Copy link
Member

Sorry, KP = Known Problem

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 21, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
external This issue is with another package, not typescript-eslint itself package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin working as intended Issues that are closed as they are working as intended
Projects
None yet
Development

No branches or pull requests

2 participants