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

Adopt ESLint new experimental configuration system #3647

Closed
yassin-kammoun-sonarsource opened this issue Jan 12, 2023 · 1 comment
Closed

Comments

@yassin-kammoun-sonarsource
Copy link
Contributor

While upgrading eslint-bridge's ESLint dependencies (see #3631), we are currently stuck with ESLint 8.26.0 and we cannot safely upgrade further without substantial changes on the way we configure and use ESLint Linter API.

ESLint 8.27.0 introduced a breaking change with eslint#16458 on a few rules - including comma-dangle - based on ESLint new experimental configuration system (see part 1, part2, and part 3).

This change triggers the following runtime error on eslint-bridge:

TypeError: Error while loading rule 'comma-dangle': Cannot read properties of undefined (reading 'ecmaVersion')
Occurred while linting <input>

     98 |         return {};
     99 |       }
  > 100 |       return rule.create(interceptingContext);
        |                   ^
    101 |     },
    102 |   };
    103 | }

A few core rules retrieving the parser options from the rule context were updated, and this commit is the root cause of the above failure, which is tightly coupled with ESLint's new configuration system.

ESLint article about the new configuration system mentions that we can no longer use defineRule(), defineRules(), and getRules() when using Linter, which happens to be our case.

I was not able to figure out a quick workaround, and as of now, it seems that we to adopt the new experimental configuration system, which would require quite some change on the overall approach of linting configuration.

The purpose of this ticket is to investigate and adopt ESLint new configuration system in order to be able to upgrade further ESLint dependencies. There could be another (easier) solution that we would prevent us from changing how we configure the linter.

@yassin-kammoun-sonarsource
Copy link
Contributor Author

Closing this as there is no need to adopt the new system for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant