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

Upgrade to ESLint 8 #250

Open
fasttime opened this issue May 10, 2020 · 14 comments
Open

Upgrade to ESLint 8 #250

fasttime opened this issue May 10, 2020 · 14 comments

Comments

@fasttime
Copy link

fasttime commented May 10, 2020

ESLint 7 ESLint 8 has been released and it includes some important breaking changes. Any plans to support the new version?

@kuyezhiying
Copy link

+1 for upgrade to eslint v7.0.0, here is a real case, I am recently working on migration from tslint to eslint, and I found eslint has an important fix on the id-blacklist rule in v7, but unfortunately gulp-eslint doesn't support the newest version and I got many complaints in the code, unlike gulp-tslint, seems the API for gulp-eslint cannot specify a version for the dependent eslint, so I have to wait for a gulp-eslint package update to support eslint 7.

@tmartin2089
Copy link

Same, gulp-eslint is broken on eslint v7.0, ran into this converting a repo to TS

Running eslint directly from .bin works just fine, but gulp-eslint is unable to find my config files in 7.0

@silviuburceadev
Copy link

@adametry @shinnn do you need help maintaining this project? We could help!

@silviuburceadev
Copy link

ESLint 7.3.0 was released on Jun 19th, is it time to think about forking this project to leverage ESLint 7.x features in gulp?

@fasttime
Copy link
Author

fasttime commented Jun 22, 2020

If it helps, I have created a fork that uses ESLint 8 for linting. It already supports all new options, but also still accepts options in the old gulp-elint/CLIEngine format for compatibility. There is still work to be done: make some adjustments for a couple of things that have changed in new versions of ESLint, improve the output and update the documentation.

@audishos
Copy link

audishos commented Sep 4, 2020

With yarn, I was able to work-around this by adding "eslint" to "resolutions" in my package.json.

{
  // ...
  "resolutions": {
    "eslint": "^7.8.1"
  }
}

I believe that you can do something similar with npm-shrinkwrap.json if you use npm.

@leepowelldev
Copy link

Really eslint should be a peer dependency

@paulshryock
Copy link

Any progress on this?

joamag added a commit to ripe-tech/ripe-sdk that referenced this issue Dec 28, 2020
joamag added a commit to hivesolutions/js-util that referenced this issue Dec 28, 2020
@Charles-Gerber
Copy link

With yarn, I was able to work-around this by adding "eslint" to "resolutions" in my package.json.

{
  // ...
  "resolutions": {
    "eslint": "^7.8.1"
  }
}

I believe that you can do something similar with npm-shrinkwrap.json if you use npm.

Yes it seems to be working for me with npm-shrinkwrap.json (need to fix all the the new eslint errors I have in my code now).

Any news on a coming fix?

@danny007in
Copy link

Make this plugins also like https://github.com/olegskl/gulp-stylelint
because no needed to upgrade eslint inside this project frequently.

@morganney
Copy link

You can always create your own Gulp task called lint using the Node.js API from ESLint. Then you can use whatever version of ESLint you want with Gulp.

Here's a start:

import { ESLint } from 'eslint'
import { argv } from 'yargs'
import log from 'fancy-log'
import colors from 'ansi-colors'
import PluginError from 'plugin-error'

const fileGlobs = ['src/**/*.js']
async function lint() {
  const { fix } = argv

  try {
    const eslint = new ESLint({ fix })
    const formatter = await eslint.loadFormatter('stylish')
    const results = await eslint.lintFiles(fileGlobs)
    const errors = ESLint.getErrorResults(results)
    const resultText = formatter.format(results)

    if (fix) {
      await ESLint.outputFixes(results)
    }

    if (errors.length) {
      log(resultText)
      // Beep sound in console
      process.stdout.write('\u0007')
    } else {
      log(colors.green('✓ Linting Successful'))
    }
  } catch (err) {
    throw new PluginError('lint', err)
  }
}

export { lint }

@fasttime fasttime changed the title Upgrade to ESLint 7 Upgrade to ESLint 8 Oct 10, 2021
@fasttime
Copy link
Author

I finished the remaining work on gulp-eslint-new, so I thought I would provide an update here. ESLint 8 and all related features should be working as expected now, as described in the documentation and in the updated examples. If anybody decides to try it out and give me a feedback, that would be greatly appreciated. Contributions would be even more welcome of course.

@jimmywarting
Copy link

Sad to see packages being split apart cuz one is no longer being updated...

@ronilaukkarinen
Copy link

@fasttime Thanks for this! Works great!

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

No branches or pull requests