Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate the repo to ESLint #31777

Merged
merged 155 commits into from Sep 11, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
155 commits
Select commit Hold shift + click to select a range
55b8a38
add eslint
a-tarasyuk Jun 13, 2019
f6ccfb3
@typescript-eslint/semi
a-tarasyuk Jun 14, 2019
1ccb4d2
microsoft-typescript/debug-assert
a-tarasyuk Jun 14, 2019
f96fb53
no-restricted-globals
a-tarasyuk Jun 14, 2019
d8796d5
@typescript-eslint/no-this-alias
a-tarasyuk Jun 14, 2019
123ca0d
no-empty
a-tarasyuk Jun 14, 2019
1cc0ff2
no-eval
a-tarasyuk Jun 14, 2019
d7f5def
space-in-parens
a-tarasyuk Jun 14, 2019
8896c67
object-shorthand
a-tarasyuk Jun 14, 2019
550a99e
dot-notation
a-tarasyuk Jun 14, 2019
bea1bcb
brace-style
a-tarasyuk Jun 14, 2019
12e195c
no-throw-literal
a-tarasyuk Jun 14, 2019
4e6fb72
no-new-func
a-tarasyuk Jun 14, 2019
a96a08a
microsoft-typescript/boolean-trivia
a-tarasyuk Jun 14, 2019
3fb48d3
@typescript-eslint/no-inferrable-types
a-tarasyuk Jun 14, 2019
afb5c9b
@typescript-eslint/prefer-interface
a-tarasyuk Jun 14, 2019
c3517c0
@typescript-eslint/type-annotation-spacing
a-tarasyuk Jun 14, 2019
f1a399b
exclude *.generated.d.ts files
a-tarasyuk Jun 14, 2019
012c76e
microsoft-typescript/object-literal-surrounding-space
a-tarasyuk Jun 14, 2019
65ddc1f
microsoft-typescript/type-operator-spacing
a-tarasyuk Jun 14, 2019
f611ec6
microsoft-typescript/no-double-space
a-tarasyuk Jun 14, 2019
650600c
linebreak-style
a-tarasyuk Jun 14, 2019
713d6ec
no-trailing-spaces
a-tarasyuk Jun 14, 2019
627211b
quotes
a-tarasyuk Jun 14, 2019
59310d5
@typescript-eslint/class-name-casing
a-tarasyuk Jun 14, 2019
a18aeee
@typescript-eslint/no-unnecessary-qualifier
a-tarasyuk Jun 14, 2019
6b05b26
@typescript-eslint/prefer-namespace-keyword
a-tarasyuk Jun 14, 2019
9a0e2f5
@typescript-eslint/adjacent-overload-signatures
a-tarasyuk Jun 19, 2019
fdfff35
no-template-curly-in-string
a-tarasyuk Jun 19, 2019
5902b32
no-unused-expressions
a-tarasyuk Jun 19, 2019
504b932
@typescript-eslint/camelcase
a-tarasyuk Jun 19, 2019
5ce8c83
prefer-const
a-tarasyuk Jun 19, 2019
62119ec
@typescript-eslint/no-unnecessary-type-assertion
a-tarasyuk Jun 19, 2019
33eecee
Merge branch 'master' of https://github.com/Microsoft/TypeScript into…
a-tarasyuk Jun 19, 2019
882dfd2
@typescript-eslint/interface-name-prefix
a-tarasyuk Jun 20, 2019
38652d4
no-var
a-tarasyuk Jun 20, 2019
5921cd4
@typescript-eslint/prefer-function-type
a-tarasyuk Jun 20, 2019
39c7e9a
@typescript-eslint/unified-signatures
a-tarasyuk Jun 20, 2019
1b798e3
Merge branch 'master' of https://github.com/Microsoft/TypeScript into…
a-tarasyuk Jun 20, 2019
67e20fc
microsoft-typescript/no-keywords
a-tarasyuk Jun 20, 2019
0e14b4e
microsoft-typescript/only-arrow-functions
a-tarasyuk Jun 20, 2019
9fcaa19
microsoft-typescript/no-in-operator
a-tarasyuk Jun 20, 2019
7d449ac
no-fallthrough
a-tarasyuk Jun 21, 2019
702dc59
no-fallthrough
a-tarasyuk Jun 21, 2019
7389200
Merge branch 'master' of https://github.com/Microsoft/TypeScript into…
a-tarasyuk Jun 23, 2019
4b5017d
fix eslint errors after merge
a-tarasyuk Jun 23, 2019
a5857ac
Merge branch 'feature/eslint' of https://github.com/a-tarasyuk/TypeSc…
a-tarasyuk Jun 24, 2019
f6a5006
@typescript-eslint/indent
a-tarasyuk Jun 24, 2019
8103035
Merge branch 'master' of https://github.com/Microsoft/TypeScript into…
a-tarasyuk Jun 27, 2019
136f4cf
no-redeclare
a-tarasyuk Jun 27, 2019
769bb0b
remove tslint configuration
a-tarasyuk Jun 27, 2019
ab28ee7
update eslint, @typescript-eslint/*
a-tarasyuk Jun 27, 2019
9f47415
Merge branch 'master' of https://github.com/Microsoft/TypeScript into…
a-tarasyuk Jul 2, 2019
4defd1d
Merge branch 'master' of https://github.com/Microsoft/TypeScript into…
a-tarasyuk Jul 4, 2019
45f8dc9
Merge branch 'master' of https://github.com/Microsoft/TypeScript into…
a-tarasyuk Jul 5, 2019
8e18beb
fix eslint errors after merge
a-tarasyuk Jul 5, 2019
c5453c8
import/no-extraneous-dependencies
a-tarasyuk Jul 5, 2019
9d01ef0
Merge branch 'master' of https://github.com/Microsoft/TypeScript into…
a-tarasyuk Jul 10, 2019
ccba537
Merge branch 'feature/eslint' of https://github.com/a-tarasyuk/TypeSc…
a-tarasyuk Jul 10, 2019
64baa80
Merge branch 'master' of https://github.com/Microsoft/TypeScript into…
a-tarasyuk Jul 15, 2019
a8ee8fb
Merge branch 'master' of https://github.com/Microsoft/TypeScript into…
a-tarasyuk Jul 18, 2019
2c32308
no-null/no-null
a-tarasyuk Jul 18, 2019
68ae438
jsdoc/check-alignment
a-tarasyuk Jul 18, 2019
8bf5ebc
remove tslint, tslint:disable-next-line, update @typescript-eslint/*
a-tarasyuk Jul 18, 2019
36a6028
Merge branch 'master' of https://github.com/Microsoft/TypeScript into…
a-tarasyuk Jul 19, 2019
949770a
@typescript-eslint/triple-slash-reference
a-tarasyuk Jul 19, 2019
9c853f3
remove tslint:* directive
a-tarasyuk Jul 19, 2019
40f2f77
Merge branch 'master' of https://github.com/Microsoft/TypeScript into…
a-tarasyuk Jul 22, 2019
bb817c7
update eslint
a-tarasyuk Jul 22, 2019
a79f598
Merge branch 'master' of https://github.com/Microsoft/TypeScript into…
a-tarasyuk Jul 23, 2019
0059763
move eslint rules from eslint-plugin-microsoft-typescript to scripts/…
a-tarasyuk Jul 24, 2019
e48123e
change deprecated rule @typescript-eslint/prefer-interface to @typesc…
a-tarasyuk Jul 24, 2019
11ec611
@typescript-eslint/array-type
a-tarasyuk Jul 29, 2019
1b4dfbc
Merge branch 'master' of https://github.com/Microsoft/TypeScript into…
a-tarasyuk Jul 29, 2019
e1a1383
fix eslint errors
a-tarasyuk Jul 29, 2019
b6c3c7a
Merge branch 'master' of https://github.com/Microsoft/TypeScript into…
a-tarasyuk Jul 29, 2019
06c31f6
Merge branch 'master' of https://github.com/Microsoft/TypeScript into…
a-tarasyuk Jul 30, 2019
56dcf92
Merge branch 'master' of https://github.com/Microsoft/TypeScript into…
a-tarasyuk Jul 30, 2019
f19a9e3
fix formatting. revert type assertion
a-tarasyuk Jul 30, 2019
771d90d
Accept new baselines
a-tarasyuk Jul 30, 2019
38e6e03
remove useless semicolon
a-tarasyuk Jul 30, 2019
bb11965
Merge branch 'feature/eslint' of https://github.com/a-tarasyuk/TypeSc…
a-tarasyuk Jul 30, 2019
d1ae830
remote unused eslint rules
a-tarasyuk Jul 30, 2019
afafd3f
simple-indent
a-tarasyuk Aug 2, 2019
ee90fdb
change eslint tests formatting
a-tarasyuk Aug 4, 2019
a37d34a
lint src/, scripts/ folders separately
a-tarasyuk Aug 4, 2019
a292ae1
Merge branch 'master' of https://github.com/Microsoft/TypeScript into…
a-tarasyuk Aug 4, 2019
4d23429
fix eslint errors
a-tarasyuk Aug 4, 2019
9732930
simple-indent: remove useless types definition
a-tarasyuk Aug 4, 2019
034ba9f
Merge branch 'master' of https://github.com/Microsoft/TypeScript into…
a-tarasyuk Aug 6, 2019
5217574
split lint task to list-scripts, lint-compiler. add list-scripts, lin…
a-tarasyuk Aug 6, 2019
5c2e000
remove useless TODO comment
a-tarasyuk Aug 7, 2019
481d70d
Merge branch 'master' of https://github.com/Microsoft/TypeScript into…
a-tarasyuk Aug 7, 2019
455f8b5
fix eslint errors. remove tslint:* comments
a-tarasyuk Aug 7, 2019
828ebd5
add eslint setting for .vscode
a-tarasyuk Aug 8, 2019
8f54cb6
Merge branch 'master' of https://github.com/Microsoft/TypeScript into…
a-tarasyuk Aug 8, 2019
c7834c5
fix eslint paths
a-tarasyuk Aug 8, 2019
ceccfd8
array-type: [ default: array, generic: array ]
a-tarasyuk Aug 8, 2019
78d8e80
no-unused-expressions: [error, { allowTernary: true }]
a-tarasyuk Aug 8, 2019
536f59c
fix formatting
a-tarasyuk Aug 8, 2019
9851f9c
Accept new baselines
a-tarasyuk Aug 8, 2019
023e4c6
disable no-redeclare
a-tarasyuk Aug 9, 2019
d3bbad3
remove useless semicolons
a-tarasyuk Aug 9, 2019
a3c7165
revert lib/react16.d.ts
a-tarasyuk Aug 9, 2019
6988e25
Merge branch 'master' of https://github.com/Microsoft/TypeScript into…
a-tarasyuk Aug 9, 2019
c050e55
add additional tests to no-keywords
a-tarasyuk Aug 9, 2019
23a3b34
Merge branch 'master' of https://github.com/Microsoft/TypeScript into…
a-tarasyuk Aug 10, 2019
371c3c6
remove TODO comments
a-tarasyuk Aug 10, 2019
b33b90b
change const to let
a-tarasyuk Aug 10, 2019
e79e835
harness: change const to var
a-tarasyuk Aug 10, 2019
e302665
remove spaces from @internal tag
a-tarasyuk Aug 10, 2019
b3afb55
disable array-type for es2019.array.d.ts
a-tarasyuk Aug 10, 2019
466ee10
add .eslintrc for src and scripts. update typescript-eslint
a-tarasyuk Aug 14, 2019
b728bf4
Merge branch 'master' of https://github.com/Microsoft/TypeScript into…
a-tarasyuk Aug 14, 2019
3424f84
lint all ts files in scripts. remove tslint: directive. add extended …
a-tarasyuk Aug 14, 2019
21d296b
set augmentations, moduleAugmentations as readonly
a-tarasyuk Aug 15, 2019
f20a282
Merge branch 'master' of https://github.com/Microsoft/TypeScript into…
a-tarasyuk Aug 15, 2019
8442ec0
remove useless comment
a-tarasyuk Aug 16, 2019
2b11a18
remove typescript dependency from boolean-trivia, no-double-space rules
a-tarasyuk Aug 16, 2019
4c30a60
add --ci option to lint command to run eslint with the .eslintrc.ci c…
a-tarasyuk Aug 16, 2019
d532bf6
remove 'project' option from default .eslintrc configs
a-tarasyuk Aug 16, 2019
b6d981a
Merge branch 'master' of https://github.com/Microsoft/TypeScript into…
a-tarasyuk Aug 16, 2019
a7f4162
Merge branch 'master' of https://github.com/Microsoft/TypeScript into…
a-tarasyuk Aug 17, 2019
3b7f3da
update typescript-eslint packages to 2.0.1-alpha.8
a-tarasyuk Aug 19, 2019
fd72a1c
@typescript-eslint/unified-signatures
a-tarasyuk Aug 19, 2019
383750c
update typescript-eslint, eslint
a-tarasyuk Aug 19, 2019
97368b7
remove .eslintrc from scripts
a-tarasyuk Aug 20, 2019
fea9e11
Merge branch 'master' of https://github.com/Microsoft/TypeScript into…
a-tarasyuk Aug 20, 2019
41ede77
update typescript-eslint packages to 2.0.1-alpha.14
a-tarasyuk Aug 20, 2019
42dd304
@typescript-eslint/quotes
a-tarasyuk Aug 20, 2019
8002483
update eslint
a-tarasyuk Aug 20, 2019
0d941d6
Merge branch 'master' of https://github.com/Microsoft/TypeScript into…
a-tarasyuk Aug 21, 2019
0e7c9e8
Update baselines
a-tarasyuk Aug 21, 2019
acc653a
Merge branch 'master' of https://github.com/Microsoft/TypeScript into…
a-tarasyuk Aug 22, 2019
049f5da
Merge branch 'master' of https://github.com/Microsoft/TypeScript into…
a-tarasyuk Aug 23, 2019
acafb50
Merge branch 'master' of https://github.com/Microsoft/TypeScript into…
a-tarasyuk Aug 27, 2019
a98798f
fix eslint errors
a-tarasyuk Aug 27, 2019
f8ab00b
Merge branch 'master' of https://github.com/Microsoft/TypeScript into…
a-tarasyuk Aug 28, 2019
49f1a79
Merge branch 'master' of https://github.com/Microsoft/TypeScript into…
a-tarasyuk Aug 29, 2019
b31d5b3
Merge branch 'master' of https://github.com/Microsoft/TypeScript into…
a-tarasyuk Aug 30, 2019
b1d748b
Merge branch 'master' of https://github.com/Microsoft/TypeScript into…
a-tarasyuk Aug 31, 2019
49c3afd
update eslint, typescript-eslint, eslint-plugin-jsdoc
a-tarasyuk Aug 31, 2019
c3af6a3
Merge branch 'master' of https://github.com/Microsoft/TypeScript into…
a-tarasyuk Sep 2, 2019
d85eb26
update typescript-eslint, eslint-plugin-jsdoc, del. remove @types/del
a-tarasyuk Sep 2, 2019
f0e8518
Merge branch 'master' of https://github.com/Microsoft/TypeScript into…
a-tarasyuk Sep 4, 2019
06f22f8
fix eslint errors
a-tarasyuk Sep 4, 2019
9efb31c
Merge branch 'feature/eslint' of https://github.com/a-tarasyuk/TypeSc…
a-tarasyuk Sep 4, 2019
7ea134b
Merge branch 'master' of https://github.com/Microsoft/TypeScript into…
a-tarasyuk Sep 5, 2019
d26fa2c
fix eslint errors
a-tarasyuk Sep 5, 2019
4584b31
Merge branch 'master' of https://github.com/Microsoft/TypeScript into…
a-tarasyuk Sep 5, 2019
a381968
Merge branch 'master' of https://github.com/Microsoft/TypeScript into…
a-tarasyuk Sep 5, 2019
9ee2b4d
Merge branch 'master' of https://github.com/Microsoft/TypeScript into…
a-tarasyuk Sep 7, 2019
f834a50
Merge branch 'master' of https://github.com/Microsoft/TypeScript into…
a-tarasyuk Sep 9, 2019
3e9d651
update typescript-eslint to the latest version
a-tarasyuk Sep 9, 2019
861f0be
update eslint-formatter-autolinkable-stylish
a-tarasyuk Sep 10, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions .eslintignore
@@ -0,0 +1,4 @@
/built/local/**
/tests/**
/lib/**
/src/lib/*.generated.d.ts
110 changes: 110 additions & 0 deletions .eslintrc.json
@@ -0,0 +1,110 @@
{
"parser": "@typescript-eslint/parser",
"parserOptions": {
"warnOnUnsupportedTypeScriptVersion": false,
"ecmaVersion": 6,
"sourceType": "module"
},
"env": {
"browser": false,
"node": true,
"es6": true
},
"plugins": [
"@typescript-eslint", "jsdoc", "no-null", "import"
],
"rules": {
"@typescript-eslint/adjacent-overload-signatures": "error",
"@typescript-eslint/array-type": "error",

"camelcase": "off",
"@typescript-eslint/camelcase": ["error", { "properties": "never", "allow": ["^[A-Za-z][a-zA-Za-z]+_[A-Za-z]+$"] }],

"@typescript-eslint/class-name-casing": "error",
"@typescript-eslint/consistent-type-definitions": ["error", "interface"],
"@typescript-eslint/interface-name-prefix": "error",
"@typescript-eslint/no-inferrable-types": "error",
"@typescript-eslint/no-misused-new": "error",
"@typescript-eslint/no-this-alias": "error",
"@typescript-eslint/prefer-for-of": "error",
"@typescript-eslint/prefer-function-type": "error",
"@typescript-eslint/prefer-namespace-keyword": "error",

"quotes": "off",
"@typescript-eslint/quotes": ["error", "double", { "avoidEscape": true, "allowTemplateLiterals": true }],

"semi": "off",
"@typescript-eslint/semi": "error",

"@typescript-eslint/triple-slash-reference": "error",
"@typescript-eslint/type-annotation-spacing": "error",
"@typescript-eslint/unified-signatures": "error",

// scripts/eslint/rules
"object-literal-surrounding-space": "error",
"no-type-assertion-whitespace": "error",
"type-operator-spacing": "error",
"only-arrow-functions": ["error", {
"allowNamedFunctions": true ,
"allowDeclarations": true
}],
"no-double-space": "error",
"boolean-trivia": "error",
"no-in-operator": "error",
"simple-indent": "error",
"debug-assert": "error",
"no-keywords": "error",

// eslint-plugin-import
"import/no-extraneous-dependencies": ["error", { "optionalDependencies": false }],

// eslint-plugin-no-null
"no-null/no-null": "error",

// eslint-plugin-jsdoc
"jsdoc/check-alignment": "error",

// eslint
"brace-style": ["error", "stroustrup", { "allowSingleLine": true }],
"constructor-super": "error",
"curly": ["error", "multi-line"],
"dot-notation": "error",
"eqeqeq": "error",
"linebreak-style": ["error", "windows"],
"new-parens": "error",
"no-caller": "error",
"no-duplicate-case": "error",
"no-duplicate-imports": "error",
"no-empty": "error",
"no-eval": "error",
"no-extra-bind": "error",
"no-fallthrough": "error",
"no-new-func": "error",
"no-new-wrappers": "error",
"no-return-await": "error",
"no-restricted-globals": ["error",
{ "name": "setTimeout" },
{ "name": "clearTimeout" },
{ "name": "setInterval" },
{ "name": "clearInterval" },
{ "name": "setImmediate" },
{ "name": "clearImmediate" }
],
"no-sparse-arrays": "error",
"no-template-curly-in-string": "error",
"no-throw-literal": "error",
"no-trailing-spaces": "error",
"no-undef-init": "error",
"no-unsafe-finally": "error",
"no-unused-expressions": ["error", { "allowTernary": true }],
"no-unused-labels": "error",
"no-var": "error",
"object-shorthand": "error",
"prefer-const": "error",
"prefer-object-spread": "error",
"quote-props": ["error", "consistent-as-needed"],
"space-in-parens": "error",
"unicode-bom": ["error", "never"],
"use-isnan": "error"
}
}
3 changes: 3 additions & 0 deletions .gitignore
Expand Up @@ -37,6 +37,7 @@ tests/cases/**/*.js
!tests/cases/docker/*.js/
tests/cases/**/*.js.map
*.config
scripts/eslint/built/
scripts/debug.bat
scripts/run.bat
scripts/word2md.js
Expand All @@ -60,6 +61,8 @@ internal/
**/.vs
**/.vscode
!**/.vscode/tasks.json
!**/.vscode/settings.json
!**/.vscode/extensions.json
!tests/cases/projects/projectOption/**/node_modules
!tests/cases/projects/NodeModulesSearch/**/*
!tests/baselines/reference/project/nodeModules*/**/*
Expand Down
3 changes: 2 additions & 1 deletion .npmignore
Expand Up @@ -9,8 +9,9 @@ netci.groovy
scripts
src
tests
tslint.json
Jakefile.js
.eslintrc
.eslintignore
.editorconfig
.failed-tests
.git
Expand Down
1 change: 0 additions & 1 deletion .travis.yml
Expand Up @@ -18,7 +18,6 @@ branches:

install:
- npm uninstall typescript --no-save
- npm uninstall tslint --no-save
- npm install

cache:
Expand Down
9 changes: 9 additions & 0 deletions .vscode/extensions.json
@@ -0,0 +1,9 @@
{
"recommendations": [
"dbaeumer.vscode-eslint"
],

"unwantedRecommendations": [
"ms-vscode.vscode-typescript-tslint-plugin"
]
}
13 changes: 13 additions & 0 deletions .vscode/settings.json
@@ -0,0 +1,13 @@
{
"eslint.validate": [
{
"language": "typescript",
"autoFix": true
}
],
"eslint.options": {
"rulePaths": ["../scripts/eslint/built/rules/"],
"ext": [".ts"]
},
"eslint.workingDirectories": ["./src", "./scripts"]
}
82 changes: 57 additions & 25 deletions Gulpfile.js
Expand Up @@ -318,36 +318,68 @@ task("clean-tests").description = "Cleans the outputs for the test infrastructur

const watchTests = () => watchProject("src/testRunner", cmdLineOptions);

const buildRules = () => buildProject("scripts/tslint");
task("build-rules", buildRules);
task("build-rules").description = "Compiles tslint rules to js";
const buildEslintRules = () => buildProject("scripts/eslint");
task("build-eslint-rules", buildEslintRules);
task("build-eslint-rules").description = "Compiles eslint rules to js";

const cleanRules = () => cleanProject("scripts/tslint");
cleanTasks.push(cleanRules);
task("clean-rules", cleanRules);
task("clean-rules").description = "Cleans the outputs for the lint rules";
const cleanEslintRules = () => cleanProject("scripts/eslint");
cleanTasks.push(cleanEslintRules);
task("clean-eslint-rules", cleanEslintRules);
task("clean-eslint-rules").description = "Cleans the outputs for the eslint rules";

const runEslintRulesTests = () => runConsoleTests("scripts/eslint/built/tests", "mocha-fivemat-progress-reporter", /*runInParallel*/ false, /*watchMode*/ false);
task("run-eslint-rules-tests", series(buildEslintRules, runEslintRulesTests));
task("run-eslint-rules-tests").description = "Runs the eslint rule tests";

const lintFoldStart = async () => { if (fold.isTravis()) console.log(fold.start("lint")); };
const lintFoldEnd = async () => { if (fold.isTravis()) console.log(fold.end("lint")); };
const lint = series([
lintFoldStart,
...["scripts/tslint/tsconfig.json", "src/tsconfig-base.json"].map(project => {
const lintOne = () => {
const args = ["node_modules/tslint/bin/tslint", "--project", project, "--formatters-dir", "./built/local/tslint/formatters", "--format", "autolinkableStylish"];
if (cmdLineOptions.fix) args.push("--fix");
log(`Linting: node ${args.join(" ")}`);
return exec(process.execPath, args);
};
lintOne.dispayName = `lint(${project})`;
return lintOne;
}),
lintFoldEnd
]);
const eslint = (folder) => async () => {
const ESLINTRC_CI = ".eslintrc.ci.json";
const isCIEnv = cmdLineOptions.ci || process.env.CI === "true";

const args = [
"node_modules/eslint/bin/eslint",
"--format", "autolinkable-stylish",
"--rulesdir", "scripts/eslint/built/rules",
"--ext", ".ts",
];

if (
isCIEnv &&
fs.existsSync(path.resolve(folder, ESLINTRC_CI))
) {
args.push("--config", path.resolve(folder, ESLINTRC_CI));
}

if (cmdLineOptions.fix) {
args.push("--fix");
}

args.push(folder);

log(`Linting: ${args.join(" ")}`);
return exec(process.execPath, args);
}

const lintScripts = eslint("scripts");
lintScripts.displayName = "lint-scripts";
task("lint-scripts", series([buildEslintRules, lintFoldStart, lintScripts, lintFoldEnd]));
task("lint-scripts").description = "Runs eslint on the scripts sources.";

const lintCompiler = eslint("src");
lintCompiler.displayName = "lint-compiler";
task("lint-compiler", series([buildEslintRules, lintFoldStart, lintCompiler, lintFoldEnd]));
task("lint-compiler").description = "Runs eslint on the compiler sources.";
task("lint-compiler").flags = {
" --ci": "Runs eslint additional rules",
};

const lint = series([buildEslintRules, lintFoldStart, lintScripts, lintCompiler, lintFoldEnd]);
lint.displayName = "lint";
task("lint", series(buildRules, lint));
task("lint").description = "Runs tslint on the compiler sources.";
task("lint", series([buildEslintRules, lintFoldStart, lint, lintFoldEnd]));
task("lint").description = "Runs eslint on the compiler and scripts sources.";
task("lint").flags = {
" --f[iles]=<regex>": "pattern to match files to lint",
" --ci": "Runs eslint additional rules",
};

const buildCancellationToken = () => buildProject("src/cancellationToken");
Expand Down Expand Up @@ -393,7 +425,7 @@ const generateCodeCoverage = () => exec("istanbul", ["cover", "node_modules/moch
task("generate-code-coverage", series(preBuild, buildTests, generateCodeCoverage));
task("generate-code-coverage").description = "Generates code coverage data via istanbul";

const preTest = parallel(buildRules, buildTests, buildServices, buildLssl);
const preTest = parallel(buildTests, buildServices, buildLssl);
preTest.displayName = "preTest";

const postTest = (done) => cmdLineOptions.lint ? lint(done) : done();
Expand Down
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -90,7 +90,7 @@ gulp runtests # Run tests using the built compiler and test infrastruct
gulp runtests-parallel # Like runtests, but split across multiple threads. Uses a number of threads equal to the system
# core count by default. Use --workers=<number> to adjust this.
gulp baseline-accept # This replaces the baseline test results with the results obtained from gulp runtests.
gulp lint # Runs tslint on the TypeScript source.
gulp lint # Runs eslint on the TypeScript source.
gulp help # List the above commands.
```

Expand Down
18 changes: 15 additions & 3 deletions package.json
Expand Up @@ -33,7 +33,6 @@
"@types/browserify": "latest",
"@types/chai": "latest",
"@types/convert-source-map": "latest",
"@types/del": "latest",
"@types/glob": "latest",
"@types/gulp": "^4.0.5",
"@types/gulp-concat": "latest",
Expand All @@ -55,15 +54,25 @@
"@types/through2": "latest",
"@types/travis-fold": "latest",
"@types/xml2js": "^0.4.0",
"@typescript-eslint/eslint-plugin": "2.2.0",
"@typescript-eslint/experimental-utils": "2.2.0",
"@typescript-eslint/parser": "2.2.0",
"async": "latest",
"azure-devops-node-api": "^8.0.0",
"browser-resolve": "^1.11.2",
"browserify": "latest",
"chai": "latest",
"chalk": "latest",
"convert-source-map": "latest",
"del": "latest",
"del": "5.1.0",
"eslint": "6.3.0",
"eslint-formatter-autolinkable-stylish": "1.0.3",
"eslint-plugin-import": "2.18.2",
"eslint-plugin-jsdoc": "15.9.1",
"eslint-plugin-no-null": "1.0.2",
"fancy-log": "latest",
"fs-extra": "^6.0.1",
"glob": "latest",
"gulp": "^4.0.0",
"gulp-concat": "latest",
"gulp-insert": "latest",
Expand All @@ -87,7 +96,6 @@
"source-map-support": "latest",
"through2": "latest",
"travis-fold": "latest",
"tslint": "latest",
"typescript": "next",
"vinyl": "latest",
"vinyl-sourcemaps-apply": "latest",
Expand All @@ -96,6 +104,7 @@
"scripts": {
"pretest": "gulp tests",
"test": "gulp runtests-parallel --light=false",
"test:eslint-rules": "gulp run-eslint-rules-tests",
"build": "npm run build:compiler && npm run build:tests",
"build:compiler": "gulp local",
"build:tests": "gulp tests",
Expand All @@ -104,6 +113,9 @@
"gulp": "gulp",
"jake": "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",
"update-costly-tests": "node scripts/costly-tests.js"
},
Expand Down