import-sort icon indicating copy to clipboard operation
import-sort copied to clipboard

case-insensitive rule in esLintConfig is being ignored (eslint version issue?)

Open codefactor opened this issue 5 years ago • 0 comments

We are using a method to import eslintConfig from another project, which I will demonstrate below, so that all our projects do not need to duplicate the same eslint rules. I will try to simplify the files as much as possible

eslintproject/package.json

{
  "peerDependencies": {
    "eslint": ">= 6.8.0"
  }
}

eslintproject/index.js

module.exports = {
  "rules": {
    "sort-imports": [2, {"ignoreCase": true}]
  }
}

project/package.json

{
  "dependencies": {
    "eslint": "^7.0.0"
  },
  "eslintConfig": {
    "extends": "eslintproject"
  }
}

In the above example, the vs code extension "sort-imports" is not respecting the case insensitive rule and produces the wrong sorting that will break the eslint checks.

Here is a related line: https://github.com/renke/import-sort/blob/master/packages/import-sort-style-eslint/src/index.ts#L28 https://github.com/renke/import-sort/blob/master/packages/import-sort-style/package.json#L27

I think this is based on an older version of eslint that doesn't support the way that it is being extended in the example above and so it doesn't see this particular rule, is it possible to upgrade to a newer version somewhere?

I would really like to use this vs code extension but it is not working for me.

codefactor avatar Jul 07 '20 22:07 codefactor