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

--no-eslintrc flag does not work anymore without setting ESLINT_USE_FLAT_CONFIG=false for ESlint #5688

Closed
5 tasks done
akolpakov-somehash opened this issue May 25, 2024 · 6 comments · Fixed by #5809 · May be fixed by #5865
Closed
5 tasks done

--no-eslintrc flag does not work anymore without setting ESLINT_USE_FLAT_CONFIG=false for ESlint #5688

akolpakov-somehash opened this issue May 25, 2024 · 6 comments · Fixed by #5809 · May be fixed by #5865
Labels
enhancement New feature or request O: backlog 🤖 Backlog, stale ignores this label

Comments

@akolpakov-somehash
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Are you using the latest Super-linter version available?

  • I am using the latest Super-linter version.

  • I can reproduce the issue running Super-linter using complete version identifier (example: vX.Y.Z), and not just with a partial one (example: vX)

  • I am using the super-linter/super-linter action or container image, and not the deprecated github/super-linter action or container image.

Are you resonably sure that it's a Super-linter issue, and not an issue related to a tool that Super-linter runs?

  • I think that this is a Super-linter issue.

Current Behavior

Trying to run Super-Linter via GitHub Action or locally to validate JS files, for example:

/bin/sh -c 'docker run \
  -e LOG_LEVEL=DEBUG \
  -e RUN_LOCAL=true \
  -e DEFAULT_BRANCH=main \
  -e FILTER_REGEX_INCLUDE=.*src/.* \
  -e TYPESCRIPT_STANDARD_TSCONFIG_FILE=tsconfig.json \
  -v "$(pwd):/tmp/lint" \
  --rm \
  ghcr.io/super-linter/super-linter:v6.5.1' >> super-linter.log

The validation consistently fails with the following error:

Invalid option '--eslintrc' - perhaps you meant '--ignore'?

Expected Behavior

Validation is successful, or code-related issues arise.

Super-Linter version

v6.5.1

Relevant log output

2024-05-25 19:18:46 [DEBUG]   LINTER_COMMAND_ARRAY for TYPESCRIPT_ES has 4 elements: eslint --no-eslintrc -c /action/lib/.automation/.eslintrc.yml
2024-05-25 19:18:46 [DEBUG]   PARALLEL_COMMAND for TYPESCRIPT_ES after LINTER_COMMAND_ARRAY concatenation: parallel --will-cite --keep-order --max-procs 12 --xargs --results /tmp/super-linter-worker-results-TYPESCRIPT_ES.json --verbose --workdir /tmp/lint eslint --no-eslintrc -c /action/lib/.automation/.eslintrc.yml
2024-05-25 19:18:46 [DEBUG]   PARALLEL_COMMAND_OUTPUT for TYPESCRIPT_ES (exit code: 1): cd /tmp/lint || exit 255; eslint --no-eslintrc -c /action/lib/.automation/.eslintrc.yml /tmp/lint/src/app.ts /tmp/lint/src/config.ts /tmp/lint/src/errorHandler.ts /tmp/lint/src/grpcClients.ts /tmp/lint/src/routes.ts
2024-05-25 19:18:46 [DEBUG]   Parallel output file (/tmp/super-linter-worker-results-TYPESCRIPT_ES.json) contents for TYPESCRIPT_ES:
{ "Seq": 1, "Host": ":", "Starttime": 1716664726.372, "JobRuntime": 0.486, "Send": 0, "Receive": 0, "Exitval": 2, "Signal": 0, "Command": "eslint --no-eslintrc -c /action/lib/.automation/.eslintrc.yml /tmp/lint/src/app.ts /tmp/lint/src/config.ts /tmp/lint/src/errorHandler.ts /tmp/lint/src/grpcClients.ts /tmp/lint/src/routes.ts", "V": [ "/tmp/lint/src/app.ts","/tmp/lint/src/config.ts","/tmp/lint/src/errorHandler.ts","/tmp/lint/src/grpcClients.ts","/tmp/lint/src/routes.ts" ], "Stdout": "", "Stderr": "Invalid option '--eslintrc' - perhaps you meant '--ignore'?
You're using eslint.config.js, some command line flags are no longer available. Please see https://eslint.org/docs/latest/use/command-line-interface for details.
" }
2024-05-25 19:18:46 [ERROR]   Found errors when linting TYPESCRIPT_ES. Exit code: 1.
2024-05-25 19:18:46 [DEBUG]   RESULTS_OBJECT for TYPESCRIPT_ES:
[
  {
    "Seq": 1,
    "Host": ":",
    "Starttime": 1716664726.372,
    "JobRuntime": 0.486,
    "Send": 0,
    "Receive": 0,
    "Exitval": 2,
    "Signal": 0,
    "Command": "eslint --no-eslintrc -c /action/lib/.automation/.eslintrc.yml /tmp/lint/src/app.ts /tmp/lint/src/config.ts /tmp/lint/src/errorHandler.ts /tmp/lint/src/grpcClients.ts /tmp/lint/src/routes.ts",
    "V": [
      "/tmp/lint/src/app.ts",
      "/tmp/lint/src/config.ts",
      "/tmp/lint/src/errorHandler.ts",
      "/tmp/lint/src/grpcClients.ts",
      "/tmp/lint/src/routes.ts"
    ],
    "Stdout": "",
    "Stderr": "Invalid option '--eslintrc' - perhaps you meant '--ignore'?
You're using eslint.config.js, some command line flags are no longer available. Please see https://eslint.org/docs/latest/use/command-line-interface for details.
"
  }
]
2024-05-25 19:18:46 [DEBUG]   Set INDEX for TYPESCRIPT_ES to: 5
2024-05-25 19:18:46 [DEBUG]   Stdout for TYPESCRIPT_ES is empty
2024-05-25 19:18:46 [INFO]   Stderr contents for TYPESCRIPT_ES:
------
Invalid option '--eslintrc' - perhaps you meant '--ignore'?
You're using eslint.config.js, some command line flags are no longer available. Please see https://eslint.org/docs/latest/use/command-line-interface for details.
------
2024-05-25 19:18:46 [DEBUG]   Saving stderr for TYPESCRIPT_ES to /tmp/super-linter-parallel-stderr-TYPESCRIPT_ES in case we need it later
2024-05-25 19:18:46 [DEBUG]   Skipped GitHub Actions log group end for group: TYPESCRIPT_ES

Steps To Reproduce

Run GitHub Action or execute the following command locally:

 /bin/sh -c 'docker run \
  -e LOG_LEVEL=DEBUG \
  -e RUN_LOCAL=true \
  -e DEFAULT_BRANCH=main \
  -e FILTER_REGEX_INCLUDE=.*src/.* \
  -e TYPESCRIPT_STANDARD_TSCONFIG_FILE=tsconfig.json \
  -v "$(pwd):/tmp/lint" \
  --rm \
  ghcr.io/super-linter/super-linter:v6.5.1' >> super-linter.log

Anything else?

After some investigation, I found a blog post that describes the deprecation: Flat Config Rollout Plans. To fix this issue, you need to set the environmental variable ESLINT_USE_FLAT_CONFIG=false. However, this is not mentioned in the Super-Linter documentation and ideally should be set by default when using the --no-eslintrc flag.

@akolpakov-somehash akolpakov-somehash added the bug Something isn't working label May 25, 2024
@akolpakov-somehash
Copy link
Author

It seems the issue is relevant for ESLint starting from v9.x

@ferrarimarco ferrarimarco added enhancement New feature or request O: backlog 🤖 Backlog, stale ignores this label and removed bug Something isn't working labels May 26, 2024
@ferrarimarco
Copy link
Collaborator

Hi @akolpakov-somehash ! This is a fair request, although it looks like a feature request, rather than a bug.

I think the way to go would be to switch to flat config, and deprecate the eslintrc configuration file.

@HagegeR
Copy link

HagegeR commented Jun 14, 2024

Hi, actually the flat format is supported since version v8.X

@ferrarimarco
Copy link
Collaborator

ferrarimarco commented Jul 1, 2024

We got another report about this (#5808).

As explained in the blog post linked below, this shouldn't be an issue until ESlint >= v9.

I think this is triggered by the presence of a flat configuration file, such as eslint.config.js, as #5808 shows.
The workaround (to verify) might be to avoid using a flat configuration file until we address this request.

Some references:

ferrarimarco added a commit that referenced this issue Jul 1, 2024
- Remove --no-eslintrc to simplify the upgrade path to ESlint >= v9,
  because v9 defaults to aonther configuration file format.
- Simplify the default ESlint configuration removing options that have
  been deprecated, or that are equal to the default ones.

Close #5688
@ferrarimarco
Copy link
Collaborator

#5809 should take care of this.

@patricklubach
Copy link

I just tested the following:

Interestingly there is another issue :D

ferrarimarco added a commit that referenced this issue Jul 9, 2024
- Remove --no-eslintrc to simplify the upgrade path to ESlint >= v9,
  because v9 defaults to aonther configuration file format.
- Simplify the default ESlint configuration removing options that have
  been deprecated, or that are equal to the default ones.

Close #5688
ferrarimarco added a commit that referenced this issue Jul 11, 2024
- Remove --no-eslintrc to simplify the upgrade path to ESlint >= v9,
  because v9 defaults to aonther configuration file format.
- Simplify the default ESlint configuration removing options that have
  been deprecated, or that are equal to the default ones.

Close #5688
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request O: backlog 🤖 Backlog, stale ignores this label
Projects
None yet
4 participants