mirror of
https://github.com/typeorm/typeorm.git
synced 2025-12-08 21:26:23 +00:00
chore: initial setup of ESLint (#10203)
* build: 👷 Initial setup of ESLint * build: 👷 show erros as warnings * refactor: ♻️ example of rule "no-var" * build: 🚨 add rule "no-unsafe-optional-chaining"
This commit is contained in:
parent
25e6ecdfd2
commit
b188c1e634
33
.eslintrc.json
Normal file
33
.eslintrc.json
Normal file
@ -0,0 +1,33 @@
|
||||
{
|
||||
"extends": ["eslint:recommended", "plugin:@typescript-eslint/recommended"],
|
||||
"parser": "@typescript-eslint/parser",
|
||||
"plugins": ["@typescript-eslint"],
|
||||
"ignorePatterns": ["*.d.ts"],
|
||||
"rules": {
|
||||
"@typescript-eslint/ban-types": "warn",
|
||||
"@typescript-eslint/ban-ts-comment": "warn",
|
||||
"@typescript-eslint/no-explicit-any": "warn",
|
||||
"@typescript-eslint/no-loss-of-precision": "warn",
|
||||
"@typescript-eslint/no-misused-new": "warn",
|
||||
"@typescript-eslint/no-namespace": "warn",
|
||||
"@typescript-eslint/no-this-alias": "warn",
|
||||
"@typescript-eslint/no-unnecessary-type-constraint": "warn",
|
||||
"@typescript-eslint/no-unsafe-declaration-merging": "warn",
|
||||
"@typescript-eslint/no-unused-vars": "warn",
|
||||
"@typescript-eslint/no-var-requires": "warn",
|
||||
"@typescript-eslint/triple-slash-reference": "warn",
|
||||
"no-async-promise-executor": "warn",
|
||||
"no-control-regex": "warn",
|
||||
"no-debugger": "warn",
|
||||
"no-empty": "warn",
|
||||
"no-extra-boolean-cast": "warn",
|
||||
"no-extra-semi": "warn",
|
||||
"no-prototype-builtins": "warn",
|
||||
"no-regex-spaces": "warn",
|
||||
"no-unsafe-optional-chaining": "warn",
|
||||
"no-useless-escape": "warn",
|
||||
"prefer-const": "warn",
|
||||
"prefer-rest-params": "warn",
|
||||
"prefer-spread": "warn"
|
||||
}
|
||||
}
|
||||
947
package-lock.json
generated
947
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -105,6 +105,7 @@
|
||||
"@types/source-map-support": "^0.5.6",
|
||||
"@types/uuid": "^9.0.0",
|
||||
"@types/yargs": "^17.0.22",
|
||||
"@typescript-eslint/eslint-plugin": "^6.0.0",
|
||||
"better-sqlite3": "^8.1.0",
|
||||
"chai": "^4.3.7",
|
||||
"chai-as-promised": "^7.1.1",
|
||||
@ -112,6 +113,7 @@
|
||||
"conventional-changelog-angular": "^5.0.13",
|
||||
"conventional-changelog-cli": "^2.2.2",
|
||||
"del": "6.1.1",
|
||||
"eslint": "^8.44.0",
|
||||
"gulp": "^4.0.2",
|
||||
"gulp-istanbul": "^1.1.3",
|
||||
"gulp-mocha": "^8.0.0",
|
||||
@ -238,7 +240,7 @@
|
||||
"watch": "./node_modules/.bin/tsc -w",
|
||||
"package": "gulp package",
|
||||
"pack": "gulp pack",
|
||||
"lint": "prettier --check \"./src/**/*.ts\" \"./test/**/*.ts\" \"./sample/**/*.ts\"",
|
||||
"lint": "eslint . --ext .ts",
|
||||
"format": "prettier --write --end-of-line auto \"./src/**/*.ts\" \"./test/**/*.ts\" \"./sample/**/*.ts\"",
|
||||
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s -r 2"
|
||||
},
|
||||
|
||||
@ -4,7 +4,7 @@ import { expect } from "chai"
|
||||
|
||||
describe('github issues > #7401 MongoDB replica set connection string not support with method "parseConnectionUrl" & "buildConnectionUrl"', () => {
|
||||
it("should parse replicaSet and host list in ConnectionUrl", () => {
|
||||
var options = DriverUtils.buildMongoDBDriverOptions({
|
||||
const options = DriverUtils.buildMongoDBDriverOptions({
|
||||
url: "mongodb://testuser:testpwd@test-primary.example.com:27017,test-secondary-1.example.com:27017,test-secondary-2.example.com:27017/testdb?replicaSet=testreplicaset",
|
||||
})
|
||||
|
||||
|
||||
@ -4,7 +4,7 @@ import { expect } from "chai"
|
||||
|
||||
describe("github issues > #7437 MongoDB options never parse in connectionUrl and after my fix was parse incorrect", () => {
|
||||
it("should parse options in ConnectionUrl", () => {
|
||||
var options = DriverUtils.buildMongoDBDriverOptions({
|
||||
const options = DriverUtils.buildMongoDBDriverOptions({
|
||||
url: "mongodb://testuser:testpwd@test-primary.example.com:27017/testdb?retryWrites=true&w=majority&useUnifiedTopology=true",
|
||||
})
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user