.eslintrc.js
module.exports = {
root: true,
plugins: [
'@typescript-eslint',
'react',
'react-hooks',
'jsx-a11y',
'filenames',
'import',
],
rules: {
'import/no-deprecated': 'error',
},
};
Code:
// usage.ts
import { foo } from './foo';
console.log(foo());
// foo.ts
/**
* this is what you get when you trust a mouse talk show
* @deprecated don't use this!
* @returns {string} nonsense
*/
export function foo() {
return 'bar';
}
lint run:
eslint --ignore-path .gitignore --ext .ts,.tsx packages
will produce NO lint errors
I think you need to configure a parser. I just added some tests and it seems to be working, _if_ a TypeScript parser is configured. Might also need the TS resolver:
settings: {
'import/parsers': { '@typescript-eslint/parser': ['.ts'] },
'import/resolver': { 'eslint-import-resolver-typescript': true },
}
Is the fix released already? I can't tell from the comments on #1257
Long fixed. Try it and see.
It still doesn't work for me. I was using RxJs forkJoin and it was not marked as deprecated in vscode (other eslint warnings work fine). A colleague using IntelliJ (which I guess uses an internal check, not eslint-based) pointed it out to me.
Please file a new issue for that.
Most helpful comment
I think you need to configure a parser. I just added some tests and it seems to be working, _if_ a TypeScript parser is configured. Might also need the TS resolver: