Skip to content
Extraits de code Groupes Projets
Valider 1a6847a1 rédigé par Will Hunt's avatar Will Hunt
Parcourir les fichiers

Port to eslint

parent d3e4bbdd
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
{
"parser": "@typescript-eslint/parser",
"plugins": ["@typescript-eslint"],
"parserOptions": {
"ecmaVersion": 9,
"ecmaFeatures": {
"jsx": false
},
"project": "tsconfig.json"
},
"env": {
"node": true,
"jasmine": true
},
"extends": ["plugin:@typescript-eslint/recommended"],
"rules": {
"ordered-imports": "off",
"no-trailing-spaces": "error",
"max-classes-per-file": ["warn", 1],
"object-literal-sort-keys": "off",
"@typescript-eslint/no-explicit-any": "error",
"@typescript-eslint/prefer-for-of": "error",
"@typescript-eslint/typedef": "warn",
"@typescript-eslint/no-floating-promises": "error",
"curly": "error",
"no-empty": "off",
"no-invalid-this": "error",
"@typescript-eslint/no-throw-literal": "warn",
"prefer-const": "error",
"indent": ["error", 4],
"max-lines": ["warn", 500],
"no-duplicate-imports": "error",
"@typescript-eslint/array-type": "error",
"@typescript-eslint/promise-function-async": "error",
"no-bitwise": "error",
"no-debugger": "error",
"prefer-template": "error",
// Disable these as they were introduced by @typescript-eslint/recommended
"@typescript-eslint/no-use-before-define": "off",
"@typescript-eslint/no-inferrable-types": "off",
"@typescript-eslint/member-delimiter-style": "off",
"@typescript-eslint/no-unused-expressions": "off"
}
}
\ No newline at end of file
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
"main": "discordas.js", "main": "discordas.js",
"scripts": { "scripts": {
"test": "npm run-script build && mocha build/test/config.js build/test", "test": "npm run-script build && mocha build/test/config.js build/test",
"lint": "tslint --project ./tsconfig.json -t stylish", "lint": "eslint -c .eslintrc --max-warnings 0 src/**/*.ts test/**/*.ts",
"coverage": "tsc && nyc mocha build/test/config.js build/test", "coverage": "tsc && nyc mocha build/test/config.js build/test",
"build": "tsc", "build": "tsc",
"postinstall": "npm run build", "postinstall": "npm run build",
...@@ -55,6 +55,8 @@ ...@@ -55,6 +55,8 @@
}, },
"devDependencies": { "devDependencies": {
"@istanbuljs/nyc-config-typescript": "^1.0.1", "@istanbuljs/nyc-config-typescript": "^1.0.1",
"@typescript-eslint/eslint-plugin": "^2.14.0",
"@typescript-eslint/parser": "^2.14.0",
"@types/chai": "^4.2.11", "@types/chai": "^4.2.11",
"@types/command-line-args": "^5.0.0", "@types/command-line-args": "^5.0.0",
"@types/js-yaml": "^3.12.4", "@types/js-yaml": "^3.12.4",
...@@ -68,8 +70,8 @@ ...@@ -68,8 +70,8 @@
"proxyquire": "^1.7.11", "proxyquire": "^1.7.11",
"source-map-support": "^0.5.19", "source-map-support": "^0.5.19",
"ts-node": "^8.10.2", "ts-node": "^8.10.2",
"tslint": "^5.20.1",
"typescript": "^3.9.5", "typescript": "^3.9.5",
"why-is-node-running": "^2.2.0" "why-is-node-running": "^2.2.0",
"eslint": "^7.4.0"
} }
} }
{
"extends": "tslint:recommended",
"rules": {
"ordered-imports": false,
"no-trailing-whitespace": "error",
"max-classes-per-file": {
"severity": "warning"
},
"object-literal-sort-keys": "off",
"no-any": true,
"arrow-return-shorthand": true,
"prefer-for-of": true,
"typedef": {
"severity": "warning"
},
"await-promise": [true],
"curly": true,
"no-empty": false,
"no-invalid-this": true,
"no-string-throw": {
"severity": "warning"
},
"no-unused-expression": true,
"prefer-const": true,
"indent": [true, "spaces", 4],
"max-file-line-count": {
"severity": "warning",
"options": [500]
},
"no-duplicate-imports": true,
"array-type": [true, "array"],
"promise-function-async": true,
"no-bitwise": true,
"no-debugger": true,
"no-floating-promises": true,
"prefer-template": [true, "allow-single-concat"]
}
}
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter