X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=.eslintrc;h=9a860ac8e686f9f058b45f196eb713264fa6bc13;hb=684b123c27bf104115b336357d60fd2430287e8f;hp=6d8714d77aad69508da20e66ad34406a37a87f57;hpb=e7aeea18e189dd087c8f951cf77a253e2818ae90;p=e-mobility-charging-stations-simulator.git diff --git a/.eslintrc b/.eslintrc index 6d8714d7..9a860ac8 100644 --- a/.eslintrc +++ b/.eslintrc @@ -1,66 +1,33 @@ { "root": true, - "parser": "@typescript-eslint/parser", + "env": { + "es2020": true, + "node": true, + "mocha": true + }, "parserOptions": { - "project": "./tsconfig.json" + "ecmaVersion": 2020, + "sourceType": "module" }, "extends": [ "eslint:recommended", - "plugin:@typescript-eslint/recommended", - "plugin:@typescript-eslint/recommended-requiring-type-checking", - "plugin:import/errors", - "plugin:import/warnings", - "plugin:import/typescript", + "plugin:import/recommended", "plugin:jsdoc/recommended", - "prettier" + "plugin:prettier/recommended" ], - "plugins": ["import", "jsdoc", "@typescript-eslint"], + "plugins": ["import", "jsdoc"], "settings": { "jsdoc": { "mode": "typescript" } }, "rules": { - "indent": "off", - "@typescript-eslint/indent": [ - "error", - 2, - { - "SwitchCase": 1, - "CallExpression": { - "arguments": 1 - }, - "FunctionDeclaration": { - "parameters": 2, - "body": 1 - }, - "FunctionExpression": { - "parameters": 2, - "body": 1 - } - } - ], - "@typescript-eslint/array-type": "off", - "semi": "off", - "@typescript-eslint/semi": ["error", "always"], "space-before-blocks": ["error", "always"], - "@typescript-eslint/no-empty-function": [ - "warn", - { - "allow": ["arrowFunctions", "methods"] - } - ], - "@typescript-eslint/member-ordering": "error", - "@typescript-eslint/await-thenable": "error", - "@typescript-eslint/no-floating-promises": "error", - "@typescript-eslint/promise-function-async": "error", - "@typescript-eslint/no-misused-promises": "error", - "curly": "error", + "curly": ["error", "all"], "brace-style": "error", "eqeqeq": ["error", "always"], "no-else-return": "error", "no-eq-null": "error", - "no-undefined": "error", "no-extra-bind": "error", "no-lone-blocks": "error", "no-multi-spaces": "error", @@ -68,8 +35,6 @@ "no-return-assign": ["error", "always"], "no-useless-catch": "error", "no-useless-return": "error", - "no-shadow": "off", // This one is generating false positive no-shadow errors on exported/const enums - "@typescript-eslint/no-shadow": "error", "no-multiple-empty-lines": [ "error", { @@ -108,26 +73,13 @@ "max-len": [ "warn", { - "code": 180, - "ignoreComments": true, - "ignoreUrls": true, - "ignoreStrings": true, - "ignoreTemplateLiterals": true, - "ignoreRegExpLiterals": true, - "ignorePattern": "(^(import|export)|(public|private))\\s.+;" + "code": 100, + "ignoreUrls": true } ], "no-lonely-if": "error", "no-trailing-spaces": "error", "no-whitespace-before-property": "error", - "space-before-function-paren": [ - "error", - { - "anonymous": "never", - "named": "never", - "asyncArrow": "always" - } - ], "space-in-parens": ["error", "never"], "space-infix-ops": "error", "space-unary-ops": "error", @@ -156,16 +108,49 @@ "exceptAfterSingleLine": true } ], - "quotes": ["error", "single"] + "quotes": [ + "error", + "single", + { + "avoidEscape": true, + "allowTemplateLiterals": false + } + ] }, "overrides": [ { - "files": ["*.js"], + "files": ["**/*.ts"], + "parser": "@typescript-eslint/parser", + "parserOptions": { + "ecmaVersion": 2020, + "sourceType": "module", + "project": "./tsconfig.json" + }, + "extends": [ + "plugin:@typescript-eslint/recommended", + "plugin:@typescript-eslint/recommended-requiring-type-checking", + "plugin:import/typescript" + ], + "plugins": ["@typescript-eslint"], + "rules": { + "@typescript-eslint/array-type": "off", + "semi": "off", + "@typescript-eslint/semi": ["error", "always"], + "@typescript-eslint/no-empty-function": "warn", + "@typescript-eslint/member-ordering": "error", + "@typescript-eslint/await-thenable": "error", + "@typescript-eslint/no-floating-promises": "error", + "@typescript-eslint/promise-function-async": "error", + "@typescript-eslint/no-misused-promises": "error", + "no-shadow": "off", // This one is generating false positive no-shadow errors on exported/const enums + "@typescript-eslint/no-shadow": "error" + } + }, + { + "files": ["**/*.js"], "extends": "plugin:node/recommended", "rules": { - "node/shebang": "off", - "@typescript-eslint/no-unused-vars": "off", - "@typescript-eslint/no-var-requires": "off" + "node/shebang": "off" } } ]