palantir / blueprint

A React-based UI toolkit for the web
https://blueprintjs.com/
Apache License 2.0
20.65k stars 2.17k forks source link

Deprecated tslint library still required for eslint-config #5476

Open alex-r-bigelow opened 2 years ago

alex-r-bigelow commented 2 years ago

Environment

    "@blueprintjs/core": "^3.54.0",
    "@blueprintjs/eslint-config": "^0.6.1",
    "@blueprintjs/select": "^3.19.1",
(hitting this via command line)
OS X Monterey 12.4

Question

I'm attempting to upgrade the dependencies in a project (yes, blueprint itself is on the list), but I'm hitting an error that doesn't appear to be relevant to blueprint's v3 -> v4 migration, in that @blueprintjs/eslint-config is still importing the deprecated tslint package. Trying to yarn remove tslint from my project results in this error:

$ eslint './{src,stories}/**/*.{t,j}s{x,}'

Oops! Something went wrong! :(

ESLint: 7.19.0

Error: Failed to load plugin '@typescript-eslint/tslint' declared in '.eslintrc.json » @blueprintjs/eslint-config#overrides[1]': Cannot find module 'tslint'
Require stack:
- /Users/home/Repositories/project/node_modules/@typescript-eslint/eslint-plugin-tslint/dist/rules/config.js
- /Users/home/Repositories/project/node_modules/@typescript-eslint/eslint-plugin-tslint/dist/index.js
- /Users/home/Repositories/project/node_modules/@eslint/eslintrc/lib/config-array-factory.js
- /Users/home/Repositories/project/node_modules/@eslint/eslintrc/lib/index.js
- /Users/home/Repositories/project/node_modules/eslint/lib/cli-engine/cli-engine.js
- /Users/home/Repositories/project/node_modules/eslint/lib/eslint/eslint.js
- /Users/home/Repositories/project/node_modules/eslint/lib/eslint/index.js
- /Users/home/Repositories/project/node_modules/eslint/lib/cli.js
- /Users/home/Repositories/project/node_modules/eslint/bin/eslint.js
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:924:15)
    at Function.Module._load (node:internal/modules/cjs/loader:769:27)
    at Module.require (node:internal/modules/cjs/loader:996:19)
    at require (/Users/home/Repositories/project/node_modules/v8-compile-cache/v8-compile-cache.js:159:20)
    at Object.<anonymous> (/Users/home/Repositories/project/node_modules/@typescript-eslint/eslint-plugin-tslint/dist/rules/config.js:8:18)
    at Module._compile (/Users/home/Repositories/project/node_modules/v8-compile-cache/v8-compile-cache.js:192:30)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1121:10)
    at Module.load (node:internal/modules/cjs/loader:972:32)
    at Function.Module._load (node:internal/modules/cjs/loader:813:14)
    at Module.require (node:internal/modules/cjs/loader:996:19)

There are some un-configurable / outdated tslint rules that are currently a blocker for me; any guidance for using blueprint without including the outdated tslint package? Or would migrating v3 -> v4 first fix this problem?

adidahiya commented 2 years ago

Unfortunately @blueprintjs/eslint-config still uses a couple rules which we never migrated from TSLint to ESLint. For the most part these TSLint rules do not have ESLint equivalents with the same semantics. It's on the to-do list to eventually migrate over and release a new major version of @blueprintjs/eslint-config which drops the tslint dependency, but in the meantime, there's no harm in having tslint as a dependency. It will run a few rules for you via @typescript-eslint/tslint.

This issue will remain open until we migrate these remaining rules (no-submodule-imports and object-literal-sort-keys) to ESLint. I hope to do that sometime in the next few months.