tsdx
tsdx copied to clipboard
eslint-disable-next-line does not work in tsdx project
Current Behavior
When I create a new project using npx tsdx create mylib
and add the following two lines to src/index.ts:
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const unused = 'foo';
the npm run lint
command still complains about it:
$ npm run lint
> [email protected] lint
> tsdx lint
Defaulting to "tsdx lint src test"
You can override this in the package.json scripts, like "lint": "tsdx lint src otherDir"
/Users/sampo/workspace/mylib/src/index.ts
3:9 warning 'unused' is assigned a value but never used @typescript-eslint/no-unused-vars
✖ 1 problem (0 errors, 1 warning)
I've also tested eslint-disable
, eslint-disable-line
and eslint-disable-next-line
with no rule definition, and in all cases eslint still complains. I can only assume this is a tsdx bug as it works on normal eslint installations.
Reproduction repo: https://github.com/plaa/tsdx-eslint-disable-next-line-bug
Expected behavior
eslint-disable-next-line
works normally.
Your environment
System:
OS: macOS 12.1
CPU: (12) x64 Intel(R) Core(TM) i7-8850H CPU @ 2.60GHz
Memory: 498.20 MB / 32.00 GB
Shell: 5.1.16 - /usr/local/bin/bash
Binaries:
Node: 17.3.0 - /usr/local/bin/node
Yarn: 1.22.17 - /usr/local/bin/yarn
npm: 8.3.0 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
Browsers:
Chrome: 97.0.4692.99
Firefox: 69.0
Safari: 15.2
npmPackages:
tsdx: ^0.14.1 => 0.14.1
typescript: ^4.5.5 => 4.5.5
Facing the same issue with a _unusedVariable
//eslint-disable-next-line @typescript-eslint/no-unused-vars
const [_iDontCare, indexAsString, remainder] = key.match(matcher)!;
(typescript) Error: semantic error TS6133: '_iDontCare' is declared but its value is never read.