Skip to content

Commit df25b77

Browse files
authored
Run eslint at root, rather than on src and scripts individually (#50327)
1 parent 42165a1 commit df25b77

File tree

3 files changed

+7
-17
lines changed

3 files changed

+7
-17
lines changed

.eslintignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1+
**/node_modules/**
12
/built/local/**
23
/tests/**
34
/lib/**
45
/src/lib/*.generated.d.ts
56
/scripts/*.js
67
/scripts/eslint/built/**
8+
/internal/**
9+
/coverage/**

Gulpfile.js

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,6 @@ task("run-eslint-rules-tests").description = "Runs the eslint rule tests";
350350

351351
/** @type { (folder: string) => { (): Promise<any>; displayName?: string } } */
352352
const eslint = (folder) => async () => {
353-
354353
const formatter = cmdLineOptions.ci ? "stylish" : "autolinkable-stylish";
355354
const args = [
356355
"node_modules/eslint/bin/eslint",
@@ -370,22 +369,12 @@ const eslint = (folder) => async () => {
370369
return exec(process.execPath, args);
371370
};
372371

373-
const lintScripts = eslint("scripts");
374-
lintScripts.displayName = "lint-scripts";
375-
task("lint-scripts", series([buildEslintRules, lintScripts]));
376-
task("lint-scripts").description = "Runs eslint on the scripts sources.";
377-
378-
const lintCompiler = eslint("src");
379-
lintCompiler.displayName = "lint-compiler";
380-
task("lint-compiler", series([buildEslintRules, lintCompiler]));
381-
task("lint-compiler").description = "Runs eslint on the compiler sources.";
382-
task("lint-compiler").flags = {
383-
" --ci": "Runs eslint additional rules",
384-
};
372+
const lintRoot = eslint(".");
373+
lintRoot.displayName = "lint";
385374

386-
const lint = series([buildEslintRules, lintScripts, lintCompiler]);
375+
const lint = series([buildEslintRules, lintRoot]);
387376
lint.displayName = "lint";
388-
task("lint", series([buildEslintRules, lint]));
377+
task("lint", lint);
389378
task("lint").description = "Runs eslint on the compiler and scripts sources.";
390379
task("lint").flags = {
391380
" --ci": "Runs eslint additional rules",

package.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,6 @@
108108
"gulp": "gulp",
109109
"lint": "gulp lint",
110110
"lint:ci": "gulp lint --ci",
111-
"lint:compiler": "gulp lint-compiler",
112-
"lint:scripts": "gulp lint-scripts",
113111
"setup-hooks": "node scripts/link-hooks.js"
114112
},
115113
"browser": {

0 commit comments

Comments
 (0)