Run eslint at root, rather than on src and scripts individually (#50327)

This commit is contained in:
Jake Bailey 2022-08-18 11:24:10 -07:00 committed by GitHub
parent 42165a183a
commit df25b77d0f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 17 deletions

View File

@ -1,6 +1,9 @@
**/node_modules/**
/built/local/**
/tests/**
/lib/**
/src/lib/*.generated.d.ts
/scripts/*.js
/scripts/eslint/built/**
/internal/**
/coverage/**

View File

@ -350,7 +350,6 @@ task("run-eslint-rules-tests").description = "Runs the eslint rule tests";
/** @type { (folder: string) => { (): Promise<any>; displayName?: string } } */
const eslint = (folder) => async () => {
const formatter = cmdLineOptions.ci ? "stylish" : "autolinkable-stylish";
const args = [
"node_modules/eslint/bin/eslint",
@ -370,22 +369,12 @@ const eslint = (folder) => async () => {
return exec(process.execPath, args);
};
const lintScripts = eslint("scripts");
lintScripts.displayName = "lint-scripts";
task("lint-scripts", series([buildEslintRules, lintScripts]));
task("lint-scripts").description = "Runs eslint on the scripts sources.";
const lintRoot = eslint(".");
lintRoot.displayName = "lint";
const lintCompiler = eslint("src");
lintCompiler.displayName = "lint-compiler";
task("lint-compiler", series([buildEslintRules, lintCompiler]));
task("lint-compiler").description = "Runs eslint on the compiler sources.";
task("lint-compiler").flags = {
" --ci": "Runs eslint additional rules",
};
const lint = series([buildEslintRules, lintScripts, lintCompiler]);
const lint = series([buildEslintRules, lintRoot]);
lint.displayName = "lint";
task("lint", series([buildEslintRules, lint]));
task("lint", lint);
task("lint").description = "Runs eslint on the compiler and scripts sources.";
task("lint").flags = {
" --ci": "Runs eslint additional rules",

View File

@ -108,8 +108,6 @@
"gulp": "gulp",
"lint": "gulp lint",
"lint:ci": "gulp lint --ci",
"lint:compiler": "gulp lint-compiler",
"lint:scripts": "gulp lint-scripts",
"setup-hooks": "node scripts/link-hooks.js"
},
"browser": {