Skip to content

Commit 7148ffe

Browse files
Lightning00BladeDevtools-frontend LUCI CQ
authored andcommitted
[cleanup] Remove explicit flag
Run the type checking before committing changes Fixed: 407085691 Change-Id: If0431efa67e90e067a5005381133096887fda4dc Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/6417242 Commit-Queue: Nikolay Vitkov <[email protected]> Reviewed-by: Danil Somsikov <[email protected]> Auto-Submit: Nikolay Vitkov <[email protected]>
1 parent 9092b11 commit 7148ffe

File tree

3 files changed

+10
-15
lines changed

3 files changed

+10
-15
lines changed

scripts/build/typescript/ts_library.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
import subprocess
1111
import sys
1212
import re
13-
from pathlib import Path
1413

1514
from os import path
1615

scripts/eslint_rules/lib/no-imperative-dom-api/dom-api.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ module.exports = {
100100
if (isIdentifier(property, 'setAttribute')) {
101101
const attribute = firstArg;
102102
const value = secondArg;
103-
if (attribute.type === 'Literal' && value.type !== 'SpreadElement') {
103+
if (attribute.type === 'Literal' && value.type !== 'SpreadElement' && attribute.value) {
104104
domFragment.attributes.push({key: attribute.value.toString(), value});
105105
return true;
106106
}

scripts/test/run_lint_check.mjs

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,6 @@ const flags = yargs(hideBin(process.argv))
3131
describe:
3232
'Disable cache validations during debugging, useful for custom rule creation/debugging.',
3333
})
34-
.option('tsc', {
35-
type: 'boolean',
36-
default: false,
37-
describe: 'Temperary here while fixing EsLint rule',
38-
})
3934
.usage('$0 [<files...>]', 'Run the linter on the provided files', yargs => {
4035
yargs.positional('files', {
4136
describe: 'File(s), glob(s), or directories',
@@ -275,7 +270,8 @@ function shouldIgnoreFile(path) {
275270
}
276271

277272
async function runEslintRulesTypeCheck(_files) {
278-
const tscPath = join(nodeModulesPath(), '.bin', 'tsc');
273+
debugLogging('[lint]: Running EsLint custom rules typechecking...');
274+
const tscPath = join(nodeModulesPath(), 'typescript', 'bin', 'tsc');
279275
const tsConfigEslintRules = join(
280276
devtoolsRootPath(),
281277
'scripts',
@@ -294,24 +290,24 @@ async function runEslintRulesTypeCheck(_files) {
294290
};
295291

296292
return await new Promise(resolve => {
297-
const litAnalyzerProcess = spawn(nodePath(), args, {
293+
const tscProcess = spawn(nodePath(), args, {
298294
encoding: 'utf-8',
299295
cwd: devtoolsRootPath(),
300296
});
301297

302-
litAnalyzerProcess.stdout.on('data', data => {
298+
tscProcess.stdout.on('data', data => {
303299
result.output += `\n${data.toString()}`;
304300
});
305-
litAnalyzerProcess.stderr.on('data', data => {
301+
tscProcess.stderr.on('data', data => {
306302
result.error += `\n${data.toString()}`;
307303
});
308304

309-
litAnalyzerProcess.on('error', message => {
305+
tscProcess.on('error', message => {
310306
result.error += `\n${message}`;
311307
resolve(result);
312308
});
313309

314-
litAnalyzerProcess.on('exit', code => {
310+
tscProcess.on('exit', code => {
315311
result.status = code === 0;
316312
resolve(result);
317313
});
@@ -320,7 +316,7 @@ async function runEslintRulesTypeCheck(_files) {
320316

321317
const result = await runTypeCheck();
322318

323-
if (result.output && !result.output.includes('Found 0 problems')) {
319+
if (result.output) {
324320
console.log(result.output);
325321
}
326322
if (result.error) {
@@ -362,7 +358,7 @@ async function run() {
362358
if (styles.length !== 0) {
363359
succeed &&= await runStylelint(styles);
364360
}
365-
if (esLintRules.length !== 0 && flags.tsc) {
361+
if (esLintRules.length !== 0) {
366362
succeed &&= await runEslintRulesTypeCheck();
367363
}
368364

0 commit comments

Comments
 (0)