Skip to content
This repository has been archived by the owner on Nov 9, 2020. It is now read-only.

ESLint + TypeScript issue? #47

Open
marlo22 opened this issue May 13, 2020 · 6 comments
Open

ESLint + TypeScript issue? #47

marlo22 opened this issue May 13, 2020 · 6 comments

Comments

@marlo22
Copy link

marlo22 commented May 13, 2020

Hi, I have a problem (probably) with plugin.

This is my rollup config:

const prepareRollupConfig = ({ input, output, name, plugins = [] }) => ({
  input: INPUT_DIR + input,
  output: {
    file: OUTPUT_DIR + output,
    name,
  },
  plugins: [resolve({ browser: true }), commonjs(), typescript(), eslint(), ...plugins],
});

Here is .eslintrc

{
  "parser": "@typescript-eslint/parser",
  "plugins": [
    "@typescript-eslint"
  ],
  "extends": [
    "eslint:recommended",
    "plugin:@typescript-eslint/eslint-recommended",
    "plugin:@typescript-eslint/recommended"
  ]
}

When I build a project almost everything is fine, but not all. Some errors and warnings are thrown but I don't know why, for example: I see a lot of no-var rule warnings. In my code I use only const and let declarations, but in the console I still see these warns. Interesting is fact that when I run ESLint through CLI (./node_modules/.bin/eslint .) this problem not occur. Because of that I think that this problem is connected with rollup plugin rather than ESLint's ecosystem directly. If I disable no-var rule the problem of course goes away.

Help me, please. Thank you. :)

@robinloeffel
Copy link

You could try putting the eslint() call as the first item in your plugins array. If this doesn't work, I'd be happy if you could try the same thing with my plugin: https://github.com/robinloeffel/rollup-plugin-eslint. I've created it since the one here isn't maintained anymore, I suppose.

@shaoweidong
Copy link

shaoweidong commented Aug 4, 2020

You could try putting the eslint() call as the first item in your plugins array. If this doesn't work, I'd be happy if you could try the same thing with my plugin: https://github.com/robinloeffel/rollup-plugin-eslint. I've created it since the one here isn't maintained anymore, I suppose.

I have the same question, I tried the method you provided,it doesn't work.
Help me, please. Thank you. :)

@IMakiMaki
Copy link

Hey, bro.I have the same problem with you. Do you find the way to resolve this?

@robinloeffel
Copy link

@shaoweidong and @IMakiMaki, could one of you guys please open up an issue on my repository with an exact reproduction? https://github.com/robinloeffel/rollup-plugin-eslint/issues/new

@IMakiMaki
Copy link

@robinloeffel

I tried to install your repository @rbnlffl/rollup-plugin-eslint instead of this one, it looks like no errors and warnings are thrown by 'no-var'.Thanks.

@robinloeffel
Copy link

Dope, thanks for the feedback!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants