Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Fix typescript-eslint issues #1006

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

Merged
merged 6 commits into from
Jun 17, 2024
Merged

Fix typescript-eslint issues #1006

merged 6 commits into from
Jun 17, 2024

Conversation

delatrie
Copy link
Collaborator

@delatrie delatrie commented Jun 17, 2024

Context

The PR fixes invalid tsconfig resolution by package's typescript-eslint configurations. Previously, each package's parserOptions.project option (except the one of newman-reporter-allure) was resolved to the root tsconfig.json leading to typing issues when accessing a package's sub-paths (e.g., import type { /* ... */ } from "allure-js-commons/sdk"). That was because of "moduleResolution": "node" in the root config, which doesn't support exports in package.json.

The fix is to provide parserOptions.tsconfigRootDir together with parserOptions.project for each package.

Additional changes

The PR also addressed the following previously hidden linting-related issues:

  • Parsing error: ESLint was configured to run on /.eslintrc.cjs using parserOptions.project: However, none of those TSConfigs include this file
    Note: fixed by disabling the typed checks since we don't need them much in a config file. Another option would be to include .eslintrc.cjs in each tsconfig.test.json (see here).
  • Missing tsconfig.test.json in allure-js-commons.
  • In the root .eslintrc.cjs: quote-props.
  • In packages/allure-codeceptjs/src/reporter.ts, packages/allure-codeceptjs/test/spec/runtime/legacy/attachments.test.ts, and packages/allure-codeceptjs/test/spec/runtime/modern/attachments.test.ts: @typescript-eslint/no-unnecessary-type-assertion.

@delatrie delatrie requested a review from baev June 17, 2024 13:20
@github-actions github-actions bot added theme:api Javascript API related issue theme:codeceptjs labels Jun 17, 2024
delatrie added 4 commits June 17, 2024 20:23
.eslintrc.cjs
  Inconsistently quoted property (quote-props)
packages/allure-codeceptjs/src/reporter.ts
packages/allure-codeceptjs/test/spec/runtime/legacy/attachments.test.ts
packages/allure-codeceptjs/test/spec/runtime/modern/attachments.test.ts
  @typescript-eslint/no-unnecessary-type-assertion
@github-actions github-actions bot added theme:mocha Mocha related issue theme:jest Jest related issue theme:cucumberjs CucumberJS related issue theme:jasmine Jasmine related issue theme:playwright labels Jun 17, 2024
@baev baev marked this pull request as ready for review June 17, 2024 13:59
@baev baev merged commit dc06dbc into main Jun 17, 2024
8 checks passed
@baev baev deleted the eslint-ts-fix branch June 17, 2024 14:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
theme:api Javascript API related issue theme:codeceptjs theme:cucumberjs CucumberJS related issue theme:jasmine Jasmine related issue theme:jest Jest related issue theme:mocha Mocha related issue theme:playwright type:internal
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.