From 28dca078d33ba718d0bacb65d1378448c089544f Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Fri, 2 Dec 2022 13:31:26 -0500 Subject: [PATCH] docs: add FAQ entry about running ESLint on transpiled code --- docs/linting/Troubleshooting.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/docs/linting/Troubleshooting.md b/docs/linting/Troubleshooting.md index 38d3bf38e710..98d0eddb8257 100644 --- a/docs/linting/Troubleshooting.md +++ b/docs/linting/Troubleshooting.md @@ -107,6 +107,13 @@ This is to be expected - ESLint rules do not check file extensions on purpose, a If you have some pure JavaScript code that you do not want to apply certain lint rules to, then you can use [ESLint's `overrides` configuration](https://eslint.org/docs/user-guide/configuring#configuration-based-on-glob-patterns) to turn off certain rules, or even change the parser based on glob patterns. +## Should I run ESLint on transpiled output JavaScript files? + +No. + +Source TypeScript files have all the content of output JavaScript files, plus type annotations. +There's no benefit to also linting output JavaScript files. + ## TypeScript should be installed locally Make sure that you have installed TypeScript locally i.e. by using `npm install typescript`, not `npm install -g typescript`,