SonarSource / eslint-plugin-sonarjs

SonarJS rules for ESLint

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support ESLint 8.x

MichaelDeBoey opened this issue Β· comments

ESLint v8.0.0 is released πŸŽ‰

It would be awesome to have official ESLint 8 support. πŸ‘Š
I'm happy to help where I can of course πŸ™‚

@MichaelDeBoey I've started on this, but could use a little help.

I'm having a hard time with two things:

Failing Unit Test
When running npm run build and then npm run test, this test fails. It looks like it was put in place to solve a previous issue with a false positive, but I'm not sure I understand why it should be a passing test. It looks like it's re-assigning the value of an array, but expects the index of the previous assignment to be accessible. This is an incorrect expectation and should fail.

// foo.js
module.exports = {
  c: [1, 2, 3],
};

// bar.js
let {c} = require('./foo');

c = [];

console.log(c[0]); // undefined - not 1

Babel Config
This one is a bit out of my wheelhouse - when I run npm run ruling (as noted in the contributing guidelines) I get the following error:

Parsing error: No Babel config file detected for ruling/javascript-test-sources/src/Chart.js/samples/charts/area/analyser.js. Either disable config file checking with requireConfigFile: false, or configure Babel so that it can find the config files.

I tried setting requireConfigFile to false in the config options which does make the error go away, but then causes errors in other files. I'm not very experienced in the world of TypeScript and transpiling so it's a bit difficult for me to track this one down.

Any thoughts / ideas?

commented

@MichaelDeBoey I've tried it myself as well and didn't run into any issues really, except some other outdated packages. In any case, a PR is open #291 :) Hope that this gets merged soon :)

This creates an issue with my package-lock. I have to use --legacy-peer-deps. We need to support eslint 8! :-)

Hope the PR gets merged as soon as possible!

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! Found: eslint@8.2.0
npm ERR! node_modules/eslint
npm ERR!   dev eslint@"^8.2.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer eslint@"^5.0.0 || ^6.0.0 || ^7.0.0" from eslint-plugin-sonarjs@0.10.0
npm ERR! node_modules/eslint-plugin-sonarjs
npm ERR!   dev eslint-plugin-sonarjs@"^0.10.0" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.