|
@@ -1,30 +1,51 @@
|
|
|
-{
|
|
|
- "parser": "@typescript-eslint/parser",
|
|
|
- "parserOptions": {
|
|
|
- "ecmaVersion": 2020,
|
|
|
- "sourceType": "module",
|
|
|
- "allowImportExportEverywhere": true
|
|
|
- },
|
|
|
- "env": {
|
|
|
- "browser": true,
|
|
|
- "jasmine": true,
|
|
|
- "es6": true
|
|
|
- },
|
|
|
- "plugins": ["@typescript-eslint"],
|
|
|
- "extends": [
|
|
|
+import { defineConfig } from "eslint/config";
|
|
|
+import typescriptEslint from "@typescript-eslint/eslint-plugin";
|
|
|
+import globals from "globals";
|
|
|
+import tsParser from "@typescript-eslint/parser";
|
|
|
+import path from "node:path";
|
|
|
+import { fileURLToPath } from "node:url";
|
|
|
+import js from "@eslint/js";
|
|
|
+import { FlatCompat } from "@eslint/eslintrc";
|
|
|
+
|
|
|
+const __filename = fileURLToPath(import.meta.url);
|
|
|
+const __dirname = path.dirname(__filename);
|
|
|
+const compat = new FlatCompat({
|
|
|
+ baseDirectory: __dirname,
|
|
|
+ recommendedConfig: js.configs.recommended,
|
|
|
+ allConfig: js.configs.all
|
|
|
+});
|
|
|
+
|
|
|
+export default defineConfig([{
|
|
|
+ extends: compat.extends(
|
|
|
"eslint:recommended",
|
|
|
"plugin:@typescript-eslint/eslint-recommended",
|
|
|
- "plugin:@typescript-eslint/recommended"
|
|
|
- ],
|
|
|
- "globals": {
|
|
|
- "Uint8Array": true,
|
|
|
- "Promise": true,
|
|
|
- "define": true,
|
|
|
- "require": true,
|
|
|
- "sinon": true,
|
|
|
- "window": true
|
|
|
+ "plugin:@typescript-eslint/recommended",
|
|
|
+ ),
|
|
|
+
|
|
|
+ plugins: {
|
|
|
+ "@typescript-eslint": typescriptEslint,
|
|
|
+ },
|
|
|
+
|
|
|
+ languageOptions: {
|
|
|
+ globals: {
|
|
|
+ ...globals.browser,
|
|
|
+ ...globals.jasmine,
|
|
|
+ Uint8Array: true,
|
|
|
+ Promise: true,
|
|
|
+ define: true,
|
|
|
+ require: true,
|
|
|
+ sinon: true,
|
|
|
+ window: true,
|
|
|
+ },
|
|
|
+ parser: tsParser,
|
|
|
+ ecmaVersion: 2020,
|
|
|
+ sourceType: "module",
|
|
|
+ parserOptions: {
|
|
|
+ allowImportExportEverywhere: true,
|
|
|
+ },
|
|
|
},
|
|
|
- "rules": {
|
|
|
+
|
|
|
+ rules: {
|
|
|
"accessor-pairs": "error",
|
|
|
"array-bracket-spacing": "off",
|
|
|
"array-callback-return": "error",
|
|
@@ -35,33 +56,26 @@
|
|
|
"block-spacing": "off",
|
|
|
"brace-style": "off",
|
|
|
"callback-return": "off",
|
|
|
- "camelcase": "off",
|
|
|
+ camelcase: "off",
|
|
|
"capitalized-comments": "off",
|
|
|
"class-methods-use-this": "off",
|
|
|
"comma-dangle": "off",
|
|
|
"comma-spacing": "off",
|
|
|
"comma-style": "off",
|
|
|
- "complexity": "off",
|
|
|
- "computed-property-spacing": [
|
|
|
- "error",
|
|
|
- "never"
|
|
|
- ],
|
|
|
+ complexity: "off",
|
|
|
+ "computed-property-spacing": ["error", "never"],
|
|
|
"consistent-return": "off",
|
|
|
"consistent-this": "off",
|
|
|
- "curly": "off",
|
|
|
+ curly: "off",
|
|
|
"default-case": "off",
|
|
|
- "dot-location": [
|
|
|
- "error",
|
|
|
- "property"
|
|
|
- ],
|
|
|
- "dot-notation": [
|
|
|
- "off",
|
|
|
- {
|
|
|
- "allowKeywords": true
|
|
|
- }
|
|
|
- ],
|
|
|
+ "dot-location": ["error", "property"],
|
|
|
+
|
|
|
+ "dot-notation": ["off", {
|
|
|
+ allowKeywords: true,
|
|
|
+ }],
|
|
|
+
|
|
|
"eol-last": "error",
|
|
|
- "eqeqeq": "off",
|
|
|
+ eqeqeq: "off",
|
|
|
"func-call-spacing": "off",
|
|
|
"no-spaced-func": "off",
|
|
|
"no-redeclare": "off",
|
|
@@ -75,25 +89,24 @@
|
|
|
"id-blacklist": "error",
|
|
|
"id-length": "off",
|
|
|
"id-match": "error",
|
|
|
- "indent": "off",
|
|
|
+ indent: "off",
|
|
|
"init-declarations": "off",
|
|
|
"jsx-quotes": "error",
|
|
|
"key-spacing": "off",
|
|
|
"keyword-spacing": "off",
|
|
|
"line-comment-position": "off",
|
|
|
- "linebreak-style": [
|
|
|
- "error",
|
|
|
- "unix"
|
|
|
- ],
|
|
|
+ "linebreak-style": ["error", "unix"],
|
|
|
"lines-around-comment": "off",
|
|
|
"lines-around-directive": "off",
|
|
|
"max-depth": "error",
|
|
|
+
|
|
|
"max-len": ["error", {
|
|
|
- "code": 120,
|
|
|
- "ignoreStrings": true,
|
|
|
- "ignoreComments": true,
|
|
|
- "ignoreUrls": true
|
|
|
+ code: 120,
|
|
|
+ ignoreStrings: true,
|
|
|
+ ignoreComments: true,
|
|
|
+ ignoreUrls: true,
|
|
|
}],
|
|
|
+
|
|
|
"max-lines": "off",
|
|
|
"max-nested-callbacks": "off",
|
|
|
"max-params": "off",
|
|
@@ -111,10 +124,7 @@
|
|
|
"no-caller": "error",
|
|
|
"no-console": "off",
|
|
|
"no-catch-shadow": "off",
|
|
|
- "no-cond-assign": [
|
|
|
- "off",
|
|
|
- "except-parens"
|
|
|
- ],
|
|
|
+ "no-cond-assign": ["off", "except-parens"],
|
|
|
"no-confusing-arrow": "off",
|
|
|
"no-continue": "off",
|
|
|
"no-div-regex": "error",
|
|
@@ -131,10 +141,7 @@
|
|
|
"no-implicit-globals": "off",
|
|
|
"no-implied-eval": "error",
|
|
|
"no-inline-comments": "off",
|
|
|
- "no-inner-declarations": [
|
|
|
- "error",
|
|
|
- "functions"
|
|
|
- ],
|
|
|
+ "no-inner-declarations": ["error", "functions"],
|
|
|
"no-invalid-this": "off",
|
|
|
"no-iterator": "error",
|
|
|
"no-label-var": "error",
|
|
@@ -189,19 +196,21 @@
|
|
|
"no-underscore-dangle": "off",
|
|
|
"no-unmodified-loop-condition": "error",
|
|
|
"no-unneeded-ternary": "off",
|
|
|
- "no-unused-vars": ["error", { "argsIgnorePattern": "^_" }],
|
|
|
- "@typescript-eslint/no-unused-vars": [
|
|
|
- "error",
|
|
|
- {
|
|
|
- "args": "all",
|
|
|
- "argsIgnorePattern": "^_",
|
|
|
- "caughtErrors": "all",
|
|
|
- "caughtErrorsIgnorePattern": "^_",
|
|
|
- "destructuredArrayIgnorePattern": "^_",
|
|
|
- "varsIgnorePattern": "^_",
|
|
|
- "ignoreRestSiblings": true
|
|
|
- }
|
|
|
- ],
|
|
|
+
|
|
|
+ "no-unused-vars": ["error", {
|
|
|
+ argsIgnorePattern: "^_",
|
|
|
+ }],
|
|
|
+
|
|
|
+ "@typescript-eslint/no-unused-vars": ["error", {
|
|
|
+ args: "all",
|
|
|
+ argsIgnorePattern: "^_",
|
|
|
+ caughtErrors: "all",
|
|
|
+ caughtErrorsIgnorePattern: "^_",
|
|
|
+ destructuredArrayIgnorePattern: "^_",
|
|
|
+ varsIgnorePattern: "^_",
|
|
|
+ ignoreRestSiblings: true,
|
|
|
+ }],
|
|
|
+
|
|
|
"no-unused-expressions": "off",
|
|
|
"no-use-before-define": "off",
|
|
|
"no-useless-call": "error",
|
|
@@ -219,12 +228,11 @@
|
|
|
"no-with": "error",
|
|
|
"object-curly-newline": "off",
|
|
|
"object-curly-spacing": "off",
|
|
|
- "object-property-newline": [
|
|
|
- "off",
|
|
|
- {
|
|
|
- "allowMultiplePropertiesPerLine": true
|
|
|
- }
|
|
|
- ],
|
|
|
+
|
|
|
+ "object-property-newline": ["off", {
|
|
|
+ allowMultiplePropertiesPerLine: true,
|
|
|
+ }],
|
|
|
+
|
|
|
"object-shorthand": "off",
|
|
|
"one-var": "off",
|
|
|
"one-var-declaration-per-line": "off",
|
|
@@ -233,13 +241,12 @@
|
|
|
"padded-blocks": "off",
|
|
|
"prefer-arrow-callback": "off",
|
|
|
"prefer-const": "error",
|
|
|
- "prefer-destructuring": [
|
|
|
- "error",
|
|
|
- {
|
|
|
- "array": false,
|
|
|
- "object": false
|
|
|
- }
|
|
|
- ],
|
|
|
+
|
|
|
+ "prefer-destructuring": ["error", {
|
|
|
+ array: false,
|
|
|
+ object: false,
|
|
|
+ }],
|
|
|
+
|
|
|
"prefer-numeric-literals": "error",
|
|
|
"prefer-promise-reject-errors": "off",
|
|
|
"prefer-reflect": "off",
|
|
@@ -247,16 +254,13 @@
|
|
|
"prefer-spread": "off",
|
|
|
"prefer-template": "off",
|
|
|
"quote-props": "off",
|
|
|
- "quotes": "off",
|
|
|
- "radix": [
|
|
|
- "error",
|
|
|
- "always"
|
|
|
- ],
|
|
|
+ quotes: "off",
|
|
|
+ radix: ["error", "always"],
|
|
|
"require-atomic-updates": "off",
|
|
|
"require-await": "error",
|
|
|
"require-jsdoc": "off",
|
|
|
"rest-spread-spacing": "error",
|
|
|
- "semi": "off",
|
|
|
+ semi: "off",
|
|
|
"semi-spacing": "off",
|
|
|
"sort-imports": "off",
|
|
|
"sort-keys": "off",
|
|
@@ -267,21 +271,15 @@
|
|
|
"space-infix-ops": "off",
|
|
|
"space-unary-ops": "off",
|
|
|
"spaced-comment": "off",
|
|
|
- "strict": "off",
|
|
|
+ strict: "off",
|
|
|
"symbol-description": "error",
|
|
|
"template-curly-spacing": "off",
|
|
|
- "unicode-bom": [
|
|
|
- "error",
|
|
|
- "never"
|
|
|
- ],
|
|
|
+ "unicode-bom": ["error", "never"],
|
|
|
"valid-jsdoc": "off",
|
|
|
"vars-on-top": "off",
|
|
|
- "wrap-iife": [
|
|
|
- "error",
|
|
|
- "any"
|
|
|
- ],
|
|
|
+ "wrap-iife": ["error", "any"],
|
|
|
"wrap-regex": "error",
|
|
|
"yield-star-spacing": "error",
|
|
|
- "yoda": "off"
|
|
|
- }
|
|
|
-}
|
|
|
+ yoda: "off",
|
|
|
+ },
|
|
|
+}]);
|