mirror of
https://github.com/react/react-native-devtools-frontend.git
synced 2026-10-30 09:54:02 +08:00
When we lint code in front_end/third_party, we do not want to lint any of the code that is from the third party, which we commit to front_end/third_party/X/package, where X is the name of the dependency. However, we do want to lint any code we write directly in front_end/third_party/X. This is why in the .eslintignore file, we only ignore any code in the package subdirectory: ``` // Any third_party addition has its source code checked out into // third_party/X/package, so we ignore that code as it's not code we author or // own. front_end/third_party/*/package/ ``` However, we also have the ESLint specific tsconfig file, which explicitly excluded all code in the front_end/third_party directory. This caused linting to get confused when we added a new dependency: ``` 0:0 error Parsing error: ESLint was configured to run on <tsconfigRootDir>/front_end/third_party/csp_evaluator/csp_evaluator.ts using parserOptions.project: <tsconfigRootDir>/config/typescript/tsconfig.eslint.json However, that TSConfig does not include this file. Either: - Change ESLint's list of included files to not include this file - Change that TSConfig to include this file - Create a new TSConfig that includes this file and include it in your parserOptions.project ``` This is because the eslintignore told the checks to ignore only the package directory, but the TSConfig file excluded all of the code, including the files that we do want to lint. The fix here is to remove the exclusion from the custom TSConfig, thus ensuring that we treat the eslintignore file as the source of truth. Bug: none Change-Id: Ib32281a6a7567277ac732fa6d6120ff93940dafc Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/4584472 Commit-Queue: Jack Franklin <jacktfranklin@chromium.org> Auto-Submit: Jack Franklin <jacktfranklin@chromium.org> Commit-Queue: Kateryna Prokopenko <kprokopenko@chromium.org> Reviewed-by: Kateryna Prokopenko <kprokopenko@chromium.org>