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

feat!: add conditional TypeScript support to the ESLint config. #124

Merged
merged 1 commit into from
Apr 14, 2023

Conversation

adamstankiewicz
Copy link
Member

@adamstankiewicz adamstankiewicz commented Apr 14, 2023

BREAKING CHANGE:

  • Drops support for eslint@^6.8.0; @edx/eslint-config must now be used with at least eslint@^7.32.0 or eslint@^8.2.0.
  • Requires at least eslint-plugin-import@^2.25.3.

Adds conditional support for TypeScript in the shared ESLint configuration. Relies on trying to find tsconfig.json file in the root folder of consumers' project.

If found, conditionally extends airbnb-typescript and sets the parserOptions.project to the discovered tsconfig.json file. If a tsconfig.json file is not found, does not add support for TypeScript to avoid throwing an error about a missing tsconfig.json file in parserOptions.project when using airbnb-typescript without a tsconfig.json file.

"eslint": "^6.8.0 || ^7.0.0 || ^8.0.0",
"@typescript-eslint/eslint-plugin": "^5.58.0",
"@typescript-eslint/parser": "^5.58.0",
"eslint": "^7.32.0 || ^8.2.0",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BREAKING CHANGE: eslint@^6.8.0 was removed from peer dependencies as its no longer supported with the introduction of eslint-config-airbnb-typescript.

"eslint-config-airbnb": "^18.0.1 || ^19.0.0",
"eslint-plugin-import": "^2.20.0",
"eslint-config-airbnb-typescript": "^17.0.0",
"eslint-plugin-import": "^2.25.3",
Copy link
Member Author

@adamstankiewicz adamstankiewicz Apr 14, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BREAKING CHANGE: This peer dependency's version was bumped slightly as eslint-config-airbnb-typescript specifies ^2.25.3 as the minimum.

@adamstankiewicz adamstankiewicz changed the base branch from master to alpha April 14, 2023 13:23
@adamstankiewicz adamstankiewicz force-pushed the ags/airbnb-typescript branch 2 times, most recently from 58f040f to 43941c2 Compare April 14, 2023 13:52
BREAKING CHANGE: Drops support for `eslint` ^6.8.0; `@edx/eslint-config` must now be used with at least `eslint` versions ^7.32.0 or ^8.2.0.
@adamstankiewicz
Copy link
Member Author

We will merge this PR into alpha branch to publish these changes as a new alpha version on NPM. That way, it may be installed and used within @edx/frontend-build@alpha.

@adamstankiewicz adamstankiewicz merged commit 31072de into alpha Apr 14, 2023
@adamstankiewicz adamstankiewicz deleted the ags/airbnb-typescript branch April 14, 2023 19:02
@edx-semantic-release
Copy link

🎉 This PR is included in version 4.0.0-alpha.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

BilalQamar95 added a commit that referenced this pull request Apr 5, 2024
* feat!: add conditional TypeScript support to the ESLint config. (#124)

BREAKING CHANGE: Drops support for `eslint` ^6.8.0; `@edx/eslint-config` must now be used with at least `eslint` versions ^7.32.0 or ^8.2.0.

* refactor: updated package-lock

* refactor: updated typescript-eslint parser & plugin

* refactor: updated package-lock

---------

Co-authored-by: Adam Stankiewicz <agstanki@gmail.com>
Co-authored-by: Bilal Qamar <59555732+BilalQamar95@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants