Open SalmaKhater opened 4 years ago
Hello ! Did you find any solution ? I have the exact same problem.
Same here! Did found solution?
No. I asked CodeClimate weeks ago, but without an answer yet.
For those getting this issue, I'm getting the same issue using GitLab CI's code quality jobs (which is just a wrapper around the codeclimate docker image), but noticed that I don't get it if my dependencies are there (i.e. node_modules
is present and populated). Obviously this isn't going to fix this issue, but for anyone else who stumbles across this issue, there's your fix. The only cause I can think of is that codeclimate isn't pulling in the correct version required.
For those getting this issue, I'm getting the same issue using GitLab CI's code quality jobs (which is just a wrapper around the codeclimate docker image), but noticed that I don't get it if my dependencies are there (i.e.
node_modules
is present and populated). Obviously this isn't going to fix this issue, but for anyone else who stumbles across this issue, there's your fix. The only cause I can think of is that codeclimate isn't pulling in the correct version required.
I'm also using Gilab's CI and I solve the erros creating my own .codeclimate.yml
file with just what I need enabled after the checks
session.
Here is what I did:
plugins:
duplication:
enabled: true
config:
count_threshold: 3
eslint:
enabled: true
channel: "eslint-7"
config:
config: ./.eslintrc.js
extensions:
- .ts
- .tsx
exclude_patterns:
- "__mocks__/"
- "**/tests/"
- "**/__tests__/"
- "**.test.tsx"
- "**.test.ts"
- "README.md"
- "**.min.css"
- "**.min.js"
- "node_modules/"
- "public/"
@belfortmaycon I did have a .codeclimate
file, but I didn't have the config file nor the extensions specified, so that could have been better configured, but I still get the same error even with it all configured.
it seems that eslint-7 channel provides eslint-plugin-import version 2.18.2: https://github.com/codeclimate/codeclimate-eslint/blob/channel/eslint-7/yarn.lock#L2330, which means that there is no alphabetize
rule: https://github.com/benmosher/eslint-plugin-import/blob/v2.18.2/docs/rules/order.md. this rule was introduced in 2.19.0: https://github.com/benmosher/eslint-plugin-import/blob/v2.19.0/docs/rules/order.md
is there somebody who can update the package version to at least that one?
👀
I just looked at your configuration and found that the new version of eslint-plugins-import does not depend on the alphabetize configuration item. I suggest you take a look at the sort.md document of eslint-plugins-import in the node_modules folder. It may be caused by a configuration update due to version changes.
The existing configuration items are as follows:
property | required | type | description |
---|---|---|---|
pattern | x | string | minimatch pattern for the paths to be in this group (will not be used for builtins or externals) |
patternOptions | object | options for minimatch, default: { nocomment: true } | |
group | x | string | one of the allowed groups, the pathGroup will be positioned relative to this group |
position | string | defines where around the group the pathGroup will be positioned, can be 'after' or 'before', if not provided pathGroup will be positioned like the group |
You can set the options like this:
"import/order": [
"error",
{
"groups": [
"index",
"sibling",
"parent",
"internal",
"external",
"builtin",
"object",
"type"
]
}
]
Thanks ! It really works
Bug Template
Hey, I am having the issues with
@typescript-eslint
on codeclimate. Locally eslint works fine but it raises an error when running on codeclimate:Configuration for rule "import/order" is invalid
.Actual Behavior
Expected Behavior
I expect to build to pass
Steps to reproduce
.codeclimate.yml
.eslintrc
package.json