From 40a72b0ca07e9ef0ae2cf7632d12d58fbe5dc952 Mon Sep 17 00:00:00 2001 From: Jack Franklin Date: Thu, 21 Apr 2022 16:40:17 +0000 Subject: [PATCH] Remove run_lint_check_js.js MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We have run_lint_check_js.mjs which is used in PRESUBMIT, package.json and on the bots. I think we just forgot to delete the old version. Bug: none Change-Id: I91179c3d30c306968774981678a044f3249c1d18 Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3598880 Reviewed-by: Simon Zünd Commit-Queue: Jack Franklin --- scripts/test/run_lint_check_js.js | 49 ------------------------------- 1 file changed, 49 deletions(-) delete mode 100644 scripts/test/run_lint_check_js.js diff --git a/scripts/test/run_lint_check_js.js b/scripts/test/run_lint_check_js.js deleted file mode 100644 index eead514df9..0000000000 --- a/scripts/test/run_lint_check_js.js +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright 2020 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -// Use V8's code cache to speed up instantiation time. -require('v8-compile-cache'); - -const path = require('path'); -const CLIEngine = require('eslint').CLIEngine; - -const ROOT_DIRECTORY = path.join(__dirname, '..', '..'); -const FRONT_END_DIRECTORY = path.join(ROOT_DIRECTORY, 'front_end'); -const INSPECTOR_OVERLAY_DIRECTORY = path.join(ROOT_DIRECTORY, 'inspector_overlay'); -const TEST_DIRECTORY = path.join(ROOT_DIRECTORY, 'test'); -const SCRIPTS_DIRECTORY = path.join(ROOT_DIRECTORY, 'scripts'); - -const DEFAULT_DIRECTORIES_TO_LINT = - [FRONT_END_DIRECTORY, INSPECTOR_OVERLAY_DIRECTORY, TEST_DIRECTORY, SCRIPTS_DIRECTORY]; - -const eslintignorePath = path.join(ROOT_DIRECTORY, '.eslintignore'); - -let directoriesOrFilesToLint = process.argv.slice(2); - -if (directoriesOrFilesToLint.length === 0) { - directoriesOrFilesToLint = DEFAULT_DIRECTORIES_TO_LINT; -} - -const cli = new CLIEngine({ - extensions: ['.js', '.ts'], - ignorePath: eslintignorePath, - fix: true, -}); - -// We filter out certain files in the `.eslintignore`. However, ESLint produces warnings -// when you include a particular file that is ignored. This means that if you edit a file -// that is directly ignored in the `.eslintignore`, ESLint would report a failure. -// This was originally reported in https://github.com/eslint/eslint/issues/9977 -// The suggested workaround is to use the CLIEngine to pre-emptively filter out these -// problematic paths. -const filteredFilesToLint = directoriesOrFilesToLint.filter(path => !cli.isPathIgnored(path)); - -const report = cli.executeOnFiles(filteredFilesToLint); - -// Write fixes to the filesystem -CLIEngine.outputFixes(report); -console.log(cli.getFormatter()(report.results)); - -const hasProblems = report.errorCount + report.warningCount > 0; -process.exit(hasProblems ? 1 : 0);