mirror of
https://github.com/typeorm/typeorm.git
synced 2025-12-08 21:26:23 +00:00
chore: use eslint instead of tslint (#6452)
This commit is contained in:
parent
cc23ba2dd9
commit
259ad0ee18
54
.eslintrc.js
Normal file
54
.eslintrc.js
Normal file
@ -0,0 +1,54 @@
|
||||
module.exports = {
|
||||
"env": {
|
||||
"node": true
|
||||
},
|
||||
"parser": "@typescript-eslint/parser",
|
||||
"parserOptions": {
|
||||
"project": "tsconfig.json",
|
||||
"sourceType": "module"
|
||||
},
|
||||
"plugins": [
|
||||
"@typescript-eslint"
|
||||
],
|
||||
"rules": {
|
||||
"@typescript-eslint/no-unused-vars": [
|
||||
"error",
|
||||
{
|
||||
"args": "none"
|
||||
}
|
||||
],
|
||||
"@typescript-eslint/prefer-namespace-keyword": "error",
|
||||
"@typescript-eslint/quotes": [
|
||||
"error",
|
||||
"double",
|
||||
{
|
||||
"avoidEscape": true,
|
||||
"allowTemplateLiterals": true
|
||||
}
|
||||
],
|
||||
"@typescript-eslint/semi": [
|
||||
"error"
|
||||
],
|
||||
"@typescript-eslint/type-annotation-spacing": "error",
|
||||
"eqeqeq": [
|
||||
"error",
|
||||
"smart"
|
||||
],
|
||||
"id-blacklist": [
|
||||
"error",
|
||||
"any",
|
||||
"Number",
|
||||
"number",
|
||||
"String",
|
||||
"string",
|
||||
"Boolean",
|
||||
"boolean",
|
||||
"Undefined",
|
||||
"undefined"
|
||||
],
|
||||
"id-match": "error",
|
||||
"no-eval": "error",
|
||||
"no-redeclare": "error",
|
||||
"no-var": "error"
|
||||
}
|
||||
};
|
||||
17
gulpfile.ts
17
gulpfile.ts
@ -11,7 +11,7 @@ const replace = require("gulp-replace");
|
||||
const rename = require("gulp-rename");
|
||||
const mocha = require("gulp-mocha");
|
||||
const chai = require("chai");
|
||||
const tslint = require("gulp-tslint");
|
||||
const eslint = require("gulp-eslint");
|
||||
const sourcemaps = require("gulp-sourcemaps");
|
||||
const istanbul = require("gulp-istanbul");
|
||||
const remapIstanbul = require("remap-istanbul/lib/gulpRemapIstanbul");
|
||||
@ -269,18 +269,11 @@ export class Gulpfile {
|
||||
* Runs ts linting to validate source code.
|
||||
*/
|
||||
@Task()
|
||||
tslint() {
|
||||
eslint() {
|
||||
return gulp.src(["./src/**/*.ts", "./test/**/*.ts", "./sample/**/*.ts"])
|
||||
.pipe(
|
||||
tslint({
|
||||
formatter: "stylish"
|
||||
})
|
||||
)
|
||||
.pipe(tslint.report({
|
||||
emitError: true,
|
||||
sort: true,
|
||||
bell: true
|
||||
}));
|
||||
.pipe(eslint())
|
||||
.pipe(eslint.format('stylish'))
|
||||
.pipe(eslint.failAfterError())
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
1446
package-lock.json
generated
1446
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
10
package.json
10
package.json
@ -57,6 +57,8 @@
|
||||
"@types/sinon": "^7.0.8",
|
||||
"@types/source-map-support": "^0.4.2",
|
||||
"@types/yargs": "^12.0.9",
|
||||
"@typescript-eslint/eslint-plugin": "^3.7.0",
|
||||
"@typescript-eslint/parser": "^3.7.0",
|
||||
"better-sqlite3": "^7.0.1",
|
||||
"chai": "^4.2.0",
|
||||
"chai-as-promised": "^7.1.1",
|
||||
@ -64,14 +66,15 @@
|
||||
"conventional-changelog-angular": "^5.0.3",
|
||||
"conventional-changelog-cli": "^2.0.21",
|
||||
"del": "^3.0.0",
|
||||
"eslint": "^7.5.0",
|
||||
"gulp": "^4.0.0",
|
||||
"gulp-eslint": "^6.0.0",
|
||||
"gulp-istanbul": "^1.1.3",
|
||||
"gulp-mocha": "^6.0.0",
|
||||
"gulp-rename": "^1.2.2",
|
||||
"gulp-replace": "^1.0.0",
|
||||
"gulp-shell": "^0.6.5",
|
||||
"gulp-sourcemaps": "^2.6.5",
|
||||
"gulp-tslint": "^8.1.4",
|
||||
"gulp-typescript": "^5.0.0",
|
||||
"gulpclass": "^0.2.0",
|
||||
"husky": "^1.3.1",
|
||||
@ -91,7 +94,6 @@
|
||||
"sql.js": "^1.0.0",
|
||||
"sqlite3": "^4.0.9",
|
||||
"ts-node": "^8.0.2",
|
||||
"tslint": "^5.13.1",
|
||||
"typeorm-aurora-data-api-driver": "^1.3.0",
|
||||
"typescript": "^3.3.3333"
|
||||
},
|
||||
@ -114,7 +116,7 @@
|
||||
},
|
||||
"lint-staged": {
|
||||
"*.ts": [
|
||||
"tslint --fix",
|
||||
"eslint --fix",
|
||||
"git add"
|
||||
]
|
||||
},
|
||||
@ -125,7 +127,7 @@
|
||||
"compile": "rimraf ./build && tsc",
|
||||
"watch": "./node_modules/.bin/tsc -w",
|
||||
"package": "gulp package",
|
||||
"lint": "tslint -p .",
|
||||
"lint": "eslint -c ./.eslintrc.js src/**/*.ts test/**/*.ts sample/**/*.ts",
|
||||
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s -r 2"
|
||||
},
|
||||
"bin": {
|
||||
|
||||
54
tslint.json
54
tslint.json
@ -1,54 +0,0 @@
|
||||
{
|
||||
"rules": {
|
||||
"class-name": true,
|
||||
"comment-format": [
|
||||
true,
|
||||
"check-space"
|
||||
],
|
||||
"indent": [
|
||||
true,
|
||||
"spaces"
|
||||
],
|
||||
"no-unused-variable": true,
|
||||
"no-duplicate-variable": true,
|
||||
"no-eval": true,
|
||||
"no-internal-module": true,
|
||||
"no-var-keyword": true,
|
||||
"one-line": [
|
||||
true,
|
||||
"check-open-brace",
|
||||
"check-whitespace"
|
||||
],
|
||||
"quotemark": [
|
||||
true,
|
||||
"double"
|
||||
],
|
||||
"semicolon": true,
|
||||
"triple-equals": [
|
||||
true,
|
||||
"allow-null-check"
|
||||
],
|
||||
"typedef-whitespace": [
|
||||
true,
|
||||
{
|
||||
"call-signature": "nospace",
|
||||
"index-signature": "nospace",
|
||||
"parameter": "nospace",
|
||||
"property-declaration": "nospace",
|
||||
"variable-declaration": "nospace"
|
||||
}
|
||||
],
|
||||
"variable-name": [
|
||||
true,
|
||||
"ban-keywords"
|
||||
],
|
||||
"whitespace": [
|
||||
true,
|
||||
"check-branch",
|
||||
"check-decl",
|
||||
"check-operator",
|
||||
"check-separator",
|
||||
"check-type"
|
||||
]
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user