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

Tests - Generic/ESLint: fix test #436

Merged
merged 1 commit into from
Apr 6, 2024
Merged

Commits on Apr 6, 2024

  1. Tests - Generic/ESLint: fix test

    ESLint has released a new major which no longer supports the `.eslintrc.json` config format by default.
    
    To still allow for that format, an `ESLINT_USE_FLAT_CONFIG` environment variable has to be set to `false`.
    
    This change is causing the tests for the `Generic.Debug.ESLint` sniff to fail.
    
    Setting the environment variable fixes this.
    
    This is a test-only change for the following reasons:
    * If end-users use this sniff, they are responsible for using the correct configuration for the version of ESLint they are using.
    * The sniff is deprecated and preferably end-users should move away from using the sniff and run the tool directly.
    * As the sniff is deprecated, no time has been spend to add support for the new ESLint configuration format to the sniff.
        A simple patch to add this support would be accepted as long as PHPCS 4.0 has not been released yet, but maintainers will not spend time on this as the sniff will be removed sooner rather than later.
    
    As an alternative, it was considered to limit the version of `ESLint` being installed in the GH Actions workflow to version 8 of ESlint, but the change as made now is better IMO as it proves that the ESLint sniff does still work on 9, even though only for the old configuration formats.
    
    Refs:
    * https://eslint.org/blog/2024/04/eslint-v9.0.0-released/#flat-config-is-now-the-default-and-has-some-changes
    * https://eslint.org/docs/latest/use/migrate-to-9.0.0#-new-default-config-format-eslintconfigjs
    jrfnl committed Apr 6, 2024
    Configuration menu
    Copy the full SHA
    8246d06 View commit details
    Browse the repository at this point in the history