add .eslintrc for src and scripts. update typescript-eslint
This commit is contained in:
parent
b3afb55d7a
commit
466ee10011
|
@ -3,8 +3,7 @@
|
|||
"parserOptions": {
|
||||
"warnOnUnsupportedTypeScriptVersion": false,
|
||||
"ecmaVersion": 6,
|
||||
"sourceType": "module",
|
||||
"project": "./tsconfig.eslint.json"
|
||||
"sourceType": "module"
|
||||
},
|
||||
"env": {
|
||||
"browser": false,
|
||||
|
@ -25,8 +24,6 @@
|
|||
"@typescript-eslint/no-inferrable-types": "error",
|
||||
"@typescript-eslint/no-misused-new": "error",
|
||||
"@typescript-eslint/no-this-alias": "error",
|
||||
"@typescript-eslint/no-unnecessary-qualifier": "error",
|
||||
"@typescript-eslint/no-unnecessary-type-assertion": "error",
|
||||
"@typescript-eslint/prefer-for-of": "error",
|
||||
"@typescript-eslint/prefer-function-type": "error",
|
||||
"@typescript-eslint/prefer-namespace-keyword": "error",
|
||||
|
@ -80,8 +77,9 @@
|
|||
"no-return-await": "error",
|
||||
"no-restricted-globals": ["error",
|
||||
{ "name": "setTimeout" },
|
||||
{ "name": "setInterval" },
|
||||
{ "name": "clearTimeout" },
|
||||
{ "name": "setInterval" },
|
||||
{ "name": "clearInterval" },
|
||||
{ "name": "setImmediate" },
|
||||
{ "name": "clearImmediate" }
|
||||
],
|
||||
|
@ -102,24 +100,5 @@
|
|||
"space-in-parens": "error",
|
||||
"unicode-bom": ["error", "never"],
|
||||
"use-isnan": "error"
|
||||
},
|
||||
"overrides": [{
|
||||
"files": ["src/lib/*.d.ts"],
|
||||
"rules": {
|
||||
"@typescript-eslint/interface-name-prefix": "off",
|
||||
"@typescript-eslint/prefer-function-type": "off",
|
||||
"@typescript-eslint/unified-signatures": "off",
|
||||
|
||||
// scripts/eslint/rules
|
||||
"no-keywords": "off",
|
||||
|
||||
// eslint
|
||||
"no-var": "off"
|
||||
}
|
||||
}, {
|
||||
"files": ["src/lib/es2019.array.d.ts"],
|
||||
"rules": {
|
||||
"@typescript-eslint/array-type": "off"
|
||||
}
|
||||
}]
|
||||
}
|
||||
}
|
||||
|
|
7
.vscode/settings.json
vendored
7
.vscode/settings.json
vendored
|
@ -1,12 +1,13 @@
|
|||
{
|
||||
"eslint.validate": [
|
||||
"javascript",
|
||||
{
|
||||
"language": "typescript",
|
||||
"autoFix": true
|
||||
}
|
||||
],
|
||||
"eslint.options": {
|
||||
"rulePaths": ["./scripts/eslint/built/rules/"],
|
||||
}
|
||||
"rulePaths": ["../scripts/eslint/built/rules/"],
|
||||
"ext": [".ts"]
|
||||
},
|
||||
"eslint.workingDirectories": ["./src", "./scripts"]
|
||||
}
|
|
@ -333,13 +333,14 @@ 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 = (path) => async () => {
|
||||
const eslint = (folder) => async () => {
|
||||
const args = [
|
||||
"node_modules/eslint/bin/eslint",
|
||||
"--config", `${ folder }/.eslintrc.json`,
|
||||
"--format", "autolinkable-stylish",
|
||||
"--rulesdir", "scripts/eslint/built/rules",
|
||||
"--ext", ".ts",
|
||||
`${ path }`,
|
||||
`${ folder }`,
|
||||
];
|
||||
|
||||
if (cmdLineOptions.fix) {
|
||||
|
|
|
@ -55,9 +55,9 @@
|
|||
"@types/through2": "latest",
|
||||
"@types/travis-fold": "latest",
|
||||
"@types/xml2js": "^0.4.0",
|
||||
"@typescript-eslint/eslint-plugin": "2.0.0-alpha.4",
|
||||
"@typescript-eslint/experimental-utils": "2.0.0-alpha.4",
|
||||
"@typescript-eslint/parser": "2.0.0-alpha.4",
|
||||
"@typescript-eslint/eslint-plugin": "2.0.0",
|
||||
"@typescript-eslint/experimental-utils": "2.0.0",
|
||||
"@typescript-eslint/parser": "2.0.0",
|
||||
"async": "latest",
|
||||
"azure-devops-node-api": "^8.0.0",
|
||||
"browser-resolve": "^1.11.2",
|
||||
|
@ -67,7 +67,7 @@
|
|||
"convert-source-map": "latest",
|
||||
"del": "latest",
|
||||
"eslint": "6.1.0",
|
||||
"eslint-formatter-autolinkable-stylish": "1.0.0",
|
||||
"eslint-formatter-autolinkable-stylish": "1.0.1",
|
||||
"eslint-plugin-import": "2.18.2",
|
||||
"eslint-plugin-jsdoc": "15.7.2",
|
||||
"eslint-plugin-no-null": "1.0.2",
|
||||
|
|
11
scripts/.eslintrc.json
Normal file
11
scripts/.eslintrc.json
Normal file
|
@ -0,0 +1,11 @@
|
|||
{
|
||||
"extends": "../.eslintrc.json",
|
||||
"parserOptions": {
|
||||
"tsconfigRootDir": "scripts",
|
||||
"project": [
|
||||
"./importDefinitelyTypedTests/tsconfig.json",
|
||||
"./eslint/tsconfig.json",
|
||||
"./tsconfig.json"
|
||||
]
|
||||
}
|
||||
}
|
|
@ -22,11 +22,10 @@
|
|||
|
||||
"include": [
|
||||
"rules",
|
||||
"tests",
|
||||
"tests/support/*.json"
|
||||
"tests"
|
||||
],
|
||||
|
||||
"exclude": [
|
||||
"tests/fixtures"
|
||||
"fixtures"
|
||||
]
|
||||
}
|
||||
|
|
|
@ -1,24 +1,27 @@
|
|||
{
|
||||
"compilerOptions": {
|
||||
"strictNullChecks": true,
|
||||
"removeComments": false,
|
||||
"target": "es6",
|
||||
"module": "commonjs",
|
||||
"declaration": false,
|
||||
"sourceMap": true,
|
||||
"lib": [
|
||||
"es6",
|
||||
"scripthost"
|
||||
],
|
||||
"strictNullChecks": true,
|
||||
"newLine": "lf",
|
||||
"types": ["node"]
|
||||
"target": "es6",
|
||||
"module": "commonjs",
|
||||
"types": ["node"],
|
||||
"lib": ["es6", "scripthost"],
|
||||
},
|
||||
"files": [
|
||||
"produceLKG.ts",
|
||||
"buildProtocol.ts",
|
||||
"processDiagnosticMessages.ts",
|
||||
|
||||
"includes": [
|
||||
"generateLocalizedDiagnosticMessages.ts",
|
||||
"processDiagnosticMessages.ts",
|
||||
"configurePrerelease.ts",
|
||||
"failed-tests.d.ts",
|
||||
"buildProtocol.ts",
|
||||
"produceLKG.ts",
|
||||
"word2md.ts"
|
||||
],
|
||||
|
||||
"exclude": [
|
||||
"ambient.d.ts"
|
||||
]
|
||||
}
|
||||
|
|
29
src/.eslintrc.json
Normal file
29
src/.eslintrc.json
Normal file
|
@ -0,0 +1,29 @@
|
|||
{
|
||||
"extends": "../.eslintrc.json",
|
||||
"parserOptions": {
|
||||
"tsconfigRootDir": "src",
|
||||
"project": "./tsconfig-base.json"
|
||||
},
|
||||
"overrides": [
|
||||
{
|
||||
"files": ["lib/*.d.ts"],
|
||||
"rules": {
|
||||
"@typescript-eslint/interface-name-prefix": "off",
|
||||
"@typescript-eslint/prefer-function-type": "off",
|
||||
"@typescript-eslint/unified-signatures": "off",
|
||||
|
||||
// scripts/eslint/rules
|
||||
"no-keywords": "off",
|
||||
|
||||
// eslint
|
||||
"no-var": "off"
|
||||
}
|
||||
},
|
||||
{
|
||||
"files": ["lib/es2019.array.d.ts"],
|
||||
"rules": {
|
||||
"@typescript-eslint/array-type": "off"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
|
@ -15,4 +15,4 @@ try {
|
|||
watcher.close();
|
||||
}
|
||||
catch { /*ignore*/ }
|
||||
process.exit(0);
|
||||
process.exit(0);
|
||||
|
|
|
@ -1,7 +0,0 @@
|
|||
{
|
||||
"extends": "./src/tsconfig-base.json",
|
||||
"include": [
|
||||
"src/**/*",
|
||||
"scripts/**/*"
|
||||
]
|
||||
}
|
Loading…
Reference in a new issue