lint all ts files in scripts. remove tslint: directive. add extended eslint config for CI environment
This commit is contained in:
parent
b728bf4bfa
commit
3424f843f5
10
Gulpfile.js
10
Gulpfile.js
|
@ -334,13 +334,17 @@ 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 eslint = (folder) => async () => {
|
||||
const ESLINTRC_CI = ".eslintrc.ci.json";
|
||||
const ESLINTRC = ".eslintrc.json";
|
||||
const isCIEnv = process.env.CI === "true";
|
||||
const config = isCIEnv && fs.existsSync(path.resolve(folder, ESLINTRC_CI)) ? ESLINTRC_CI : ESLINTRC;
|
||||
|
||||
const args = [
|
||||
"node_modules/eslint/bin/eslint",
|
||||
"--config", `${ folder }/.eslintrc.json`,
|
||||
"--config", `${ folder }/${ config }`,
|
||||
"--format", "autolinkable-stylish",
|
||||
"--rulesdir", "scripts/eslint/built/rules",
|
||||
"--ext", ".ts",
|
||||
`${ folder }`,
|
||||
"--ext", ".ts", folder,
|
||||
];
|
||||
|
||||
if (cmdLineOptions.fix) {
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
"project": [
|
||||
"./importDefinitelyTypedTests/tsconfig.json",
|
||||
"./eslint/tsconfig.json",
|
||||
"./tsconfig.json"
|
||||
"./tsconfig.eslint.json"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
|
4
scripts/tsconfig.eslint.json
Normal file
4
scripts/tsconfig.eslint.json
Normal file
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"extends": "./tsconfig.json",
|
||||
"include": ["*.ts", "types"]
|
||||
}
|
|
@ -11,17 +11,12 @@
|
|||
"lib": ["es6", "scripthost"],
|
||||
},
|
||||
|
||||
"includes": [
|
||||
"include": [
|
||||
"generateLocalizedDiagnosticMessages.ts",
|
||||
"processDiagnosticMessages.ts",
|
||||
"configurePrerelease.ts",
|
||||
"failed-tests.d.ts",
|
||||
"buildProtocol.ts",
|
||||
"produceLKG.ts",
|
||||
"word2md.ts"
|
||||
],
|
||||
|
||||
"exclude": [
|
||||
"ambient.d.ts"
|
||||
]
|
||||
}
|
||||
|
|
7
src/.eslintrc.ci.json
Normal file
7
src/.eslintrc.ci.json
Normal file
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"extends": "./.eslintrc.json",
|
||||
"rules": {
|
||||
"@typescript-eslint/no-unnecessary-qualifier": "error",
|
||||
"@typescript-eslint/no-unnecessary-type-assertion": "error"
|
||||
}
|
||||
}
|
|
@ -1342,11 +1342,9 @@ namespace ts {
|
|||
rawTextScanner.setText("`" + rawText + "`");
|
||||
break;
|
||||
case SyntaxKind.TemplateHead:
|
||||
// tslint:disable-next-line no-invalid-template-strings
|
||||
rawTextScanner.setText("`" + rawText + "${");
|
||||
break;
|
||||
case SyntaxKind.TemplateMiddle:
|
||||
// tslint:disable-next-line no-invalid-template-strings
|
||||
rawTextScanner.setText("}" + rawText + "${");
|
||||
break;
|
||||
case SyntaxKind.TemplateTail:
|
||||
|
|
|
@ -599,10 +599,8 @@ namespace ts {
|
|||
case SyntaxKind.NoSubstitutionTemplateLiteral:
|
||||
return "`" + rawText + "`";
|
||||
case SyntaxKind.TemplateHead:
|
||||
// tslint:disable-next-line no-invalid-template-strings
|
||||
return "`" + rawText + "${";
|
||||
case SyntaxKind.TemplateMiddle:
|
||||
// tslint:disable-next-line no-invalid-template-strings
|
||||
return "}" + rawText + "${";
|
||||
case SyntaxKind.TemplateTail:
|
||||
return "}" + rawText + "`";
|
||||
|
|
Loading…
Reference in a new issue