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

Migrate from TSLint to ESLint #128

Merged
merged 4 commits into from
Dec 8, 2020
Merged

Conversation

schottra
Copy link
Contributor

@schottra schottra commented Dec 8, 2020

Some of the changes in this feature branch fail linting checks because our updated version of Typescript is not compatible with the version of TSLint we are using.
However, TSLint has been officially deprecated. So instead of updating it, it seems like a better idea to just do the migration to ESLint with the Typescript plugins.

This migration was performed by running npx tslint-to-eslint-config --prettier, trimming down the ESLint config to extend recommended defaults and use the plugins we need for Typescript, Jest, Prettier, and React/Hooks, and then fixing all errors or disabling the rules generating them.
Note: There are still a lot of warnings from ESLint. These can be addressed later.

Full change list

  • Removed tslint and associated plugins, packages, config files.
  • Upgraded eslint and added all necessary plugins
  • Added ESLint config and ignore files
  • Updated package.json scripts to use eslint instead of tslint
  • Ran eslint --fix to auto-fix any simple errors based on the new settings
  • Manually fixed any remaining errors or disabled/downgraded the rules in cases where we don't want them to be errors.

@schottra schottra changed the title Migrate from TSLint Migrate from TSLint to ESLint Dec 8, 2020
package.json Outdated
"lint-fix": "tslint --fix --project . && prettier --write './**/*.{js,json}'",
"lint:hooks": "eslint \"src/**/*.{ts,tsx}\"",
"lint": "eslint . --ext .js,.jsx,.ts,.tsx",
"lint-fix": "eslint . --ext .js,.jsx,.ts,.tsx --fix && prettier --write './**/*.{js,json}'",
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we also want prettier to format ts and tsx files?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch. The separate call to prettier is unnecessary. ESLint is configured to use prettier for formatting rules, so eslint --fix should catch all of it.
I cleaned up the scripts and lint-staged config to skip json/jsx(we don't have jsx files) as well.

@schottra schottra merged commit 6f73c41 into execution-data-refactor Dec 8, 2020
@schottra schottra deleted the update-dependencies branch December 8, 2020 00:46
schottra added a commit that referenced this pull request Jan 4, 2021
* ci: move from tslint->eslint

* fix: addressing eslint errors

* fix: remove passing of unused variable

* ci: remove unnecessary prettier config
schottra added a commit that referenced this pull request Jan 5, 2021
* ci: move from tslint->eslint

* fix: addressing eslint errors

* fix: remove passing of unused variable

* ci: remove unnecessary prettier config
schottra added a commit that referenced this pull request Jan 6, 2021
* refactor: integrate react-query for execution data fetching (#123)

* refactor: using react-query to load top level Execution

* refactor: upgrading react-query and fixing execution termination

* refactor: handle 401s on queries and do auth flow

* refactor: adding conditional refresh for execution status

* refactor: cleanup broken files after context refactor

* chore: docs

* refactor: Remove ExecutionDataCache in favor of react-query (#126)

* refactor: first step of using queries for NE table

* refactor: removing data cache from first layer of NE table

* refactor: removing remaining execution data cache usage

* refactor: rename QueryKey type and remove bug workaround

* refactor: fixing remaining consumers of NEs

* test: adds setup for mock-service-worker (#127)

* test: add msw and basic handlers for a few types

* test: add mock data for a basic workflow execution

* test: fixing/removing tests after adding msw

* test: throw on unexpected requests to msw

* fix: upgrade TS to fix error and cleanup resulting errors

* Migrate from TSLint to ESLint (#128)

* ci: move from tslint->eslint

* fix: addressing eslint errors

* fix: remove passing of unused variable

* ci: remove unnecessary prettier config

* refactor: clean up mock fixtures and re-enable tests for executions (#130)

* test: adding test data for node executions

* test: mocks and refactoring to re-enable NodeExecutionDetails tests

* chore: lint error

* test: getting first test for NE table working again

* test: mocks and a couple of tests for NE table

* refactor: msw handlers to use a backing map and return 404s

* test: more tests for NE table

* test: adding fixture for dynamic external workflow

* test: using mock fixture for sub workflow tests

* test: move remaining mocks to fixtures and fix tests

* test: re-enabling more execution tests

* fix: removing global query handlers for caching entitiesq

* test: re-enable ExecutionNodeViews tests

* fix: typo in import path

* fix: show DataError by default for failed queries

* chore: documentation

* chore: pr feedback

* test: fixing storybook rendering for NE table

* refactor: queries and loading states for (Task)ExecutionDetails

* chore: cleanup unused code

* fix: adds mock support for launch plans

* test: update LoadingSpinner tests

* fix: handle error case for NE children

* chore: remove todo

* fix: typo
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

Successfully merging this pull request may close these issues.

2 participants