Skip to content

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

Description

@akolpakov-somehash

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.

Activity

  1. akolpakov-somehash commented on May 25, 2024

    @akolpakov-somehash
    Author

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

  2. added
    enhancementNew feature or request
    O: backlog 🤖Backlog, stale ignores this label
    and removed
    bugSomething isn't working
    on May 26, 2024
  3. ferrarimarco commented on May 26, 2024

    @ferrarimarco
    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.

  4. HagegeR commented on Jun 14, 2024

    @HagegeR

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

  5. ferrarimarco commented on Jul 1, 2024

    @ferrarimarco
    Collaborator

    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:

  6. added a commit that references this issue on Jul 1, 2024
    119566a
  7. ferrarimarco commented on Jul 1, 2024

    @ferrarimarco
    Collaborator

    #5809 should take care of this.

  8. patricklubach commented on Jul 1, 2024

    @patricklubach

    I just tested the following:

    Interestingly there is another issue :D

  9. added 2 commits that reference this issue on Jul 9, 2024
    9e5f3b9
    8ec7de1
  10. added a commit that references this issue on Jul 12, 2024
    5be4926
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    O: backlog 🤖Backlog, stale ignores this labelenhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions