From deb728a7a54a65f7ec6c84582a5b4ed739b9841e Mon Sep 17 00:00:00 2001 From: Dave Bauman Date: Mon, 8 Jan 2024 16:04:06 -0500 Subject: [PATCH] chore: Simplify ESLint configuration to run at the root-level --- .eslintignore | 4 - .eslintrc.yml | 23 +- package-lock.json | 352 +++++++++++++++++-------- package.json | 4 +- packages/backend/.eslintignore | 5 - packages/backend/.eslintrc.yml | 113 ++++---- packages/backend/package.json | 8 - packages/backend/tsconfig.eslint.json | 10 + packages/convertbot/.eslintignore | 3 - packages/convertbot/package.json | 8 - packages/frontend/.eslintignore | 5 - packages/frontend/.eslintrc.yml | 14 +- packages/frontend/package.json | 8 +- packages/frontend/tsconfig.eslint.json | 9 + packages/models/.eslintignore | 4 - packages/mq/.eslintignore | 3 - packages/shared/.eslintignore | 3 - packages/slackbot/.eslintignore | 4 - packages/slackbot/package.json | 8 - scripts/verify-file-headers.ts | 1 + tsconfig.eslint.json | 11 + 21 files changed, 360 insertions(+), 240 deletions(-) delete mode 100644 .eslintignore delete mode 100644 packages/backend/.eslintignore create mode 100644 packages/backend/tsconfig.eslint.json delete mode 100644 packages/convertbot/.eslintignore delete mode 100644 packages/frontend/.eslintignore create mode 100644 packages/frontend/tsconfig.eslint.json delete mode 100644 packages/models/.eslintignore delete mode 100644 packages/mq/.eslintignore delete mode 100644 packages/shared/.eslintignore delete mode 100644 packages/slackbot/.eslintignore create mode 100644 tsconfig.eslint.json diff --git a/.eslintignore b/.eslintignore deleted file mode 100644 index e455c7ef2..000000000 --- a/.eslintignore +++ /dev/null @@ -1,4 +0,0 @@ -# Please note this file is not inherited by sub-packages! - -scripts/*.js -node_modules diff --git a/.eslintrc.yml b/.eslintrc.yml index 7b6fdb976..579a4ceb3 100644 --- a/.eslintrc.yml +++ b/.eslintrc.yml @@ -1,11 +1,18 @@ root: true env: - es6: true + node: true + es2022: true +ignorePatterns: + - '**/coverage/' + - '**/dist/' + - '**/generated/graphql.ts' + - '**/node_modules/' parser: '@typescript-eslint/parser' parserOptions: - ecmaVersion: 2020 + ecmaVersion: 2022 + project: './tsconfig.eslint.json' #['./packages/*/tsconfig.json'] sourceType: module - warnOnUnsupportedTypeScriptVersion: false + warnOnUnsupportedTypeScriptVersion: false, plugins: - '@typescript-eslint' - unicorn @@ -16,6 +23,7 @@ extends: - plugin:@typescript-eslint/recommended - plugin:prettier/recommended - plugin:unicorn/recommended +overrides: [{ files: ['*.js'], extends: ['plugin:@typescript-eslint/disable-type-checked'] }] settings: import/resolver: typescript: @@ -27,8 +35,7 @@ rules: no-console: ['error'] '@typescript-eslint/consistent-type-imports': - error - - - prefer: type-imports + - prefer: type-imports disallowTypeAnnotations: false '@typescript-eslint/no-explicit-any': off '@typescript-eslint/no-non-null-assertion': off @@ -48,8 +55,7 @@ rules: newlines-between: always unicorn/consistent-function-scoping: - error - - - checkArrowFunctions: false + - checkArrowFunctions: false unicorn/no-array-for-each: off unicorn/no-array-reduce: off unicorn/no-null: off @@ -60,8 +66,7 @@ rules: unicorn/prefer-object-from-entries: off unicorn/prevent-abbreviations: - off - - - checkFilenames: false + - checkFilenames: false allowList: req: true res: true diff --git a/package-lock.json b/package-lock.json index 12d43fc47..dd3b585f0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8427,6 +8427,19 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/array.prototype.tosorted": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/array.prototype.tosorted/-/array.prototype.tosorted-1.1.2.tgz", + "integrity": "sha512-HuQCHOlk1Weat5jzStICBCd83NxiIMwqDg/dHEsoefabn/hJRj5pVdWcPUSpRrwhwxZOsQassMpgN/xRYFBMIg==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1", + "es-shim-unscopables": "^1.0.0", + "get-intrinsic": "^1.2.1" + } + }, "node_modules/arraybuffer.prototype.slice": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/arraybuffer.prototype.slice/-/arraybuffer.prototype.slice-1.0.2.tgz", @@ -11204,6 +11217,36 @@ } } }, + "node_modules/eslint-plugin-react": { + "version": "7.33.2", + "resolved": "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-7.33.2.tgz", + "integrity": "sha512-73QQMKALArI8/7xGLNI/3LylrEYrlKZSb5C9+q3OtOewTnMQi5cT+aE9E41sLCmli3I9PGGmD1yiZydyo4FEPw==", + "dev": true, + "dependencies": { + "array-includes": "^3.1.6", + "array.prototype.flatmap": "^1.3.1", + "array.prototype.tosorted": "^1.1.1", + "doctrine": "^2.1.0", + "es-iterator-helpers": "^1.0.12", + "estraverse": "^5.3.0", + "jsx-ast-utils": "^2.4.1 || ^3.0.0", + "minimatch": "^3.1.2", + "object.entries": "^1.1.6", + "object.fromentries": "^2.0.6", + "object.hasown": "^1.1.2", + "object.values": "^1.1.6", + "prop-types": "^15.8.1", + "resolve": "^2.0.0-next.4", + "semver": "^6.3.1", + "string.prototype.matchall": "^4.0.8" + }, + "engines": { + "node": ">=4" + }, + "peerDependencies": { + "eslint": "^3 || ^4 || ^5 || ^6 || ^7 || ^8" + } + }, "node_modules/eslint-plugin-react-hooks": { "version": "4.6.0", "resolved": "https://registry.npmjs.org/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-4.6.0.tgz", @@ -11216,6 +11259,56 @@ "eslint": "^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0-0" } }, + "node_modules/eslint-plugin-react/node_modules/doctrine": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", + "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", + "dev": true, + "dependencies": { + "esutils": "^2.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/eslint-plugin-react/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/eslint-plugin-react/node_modules/resolve": { + "version": "2.0.0-next.5", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-2.0.0-next.5.tgz", + "integrity": "sha512-U7WjGVG9sH8tvjW5SmGbQuui75FiyjAX72HX15DwBBwF9dNiQZRQAg9nnPhYy+TUnE0+VcrttuvNI8oSxZcocA==", + "dev": true, + "dependencies": { + "is-core-module": "^2.13.0", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + }, + "bin": { + "resolve": "bin/resolve" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/eslint-plugin-react/node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + } + }, "node_modules/eslint-plugin-unicorn": { "version": "50.0.1", "resolved": "https://registry.npmjs.org/eslint-plugin-unicorn/-/eslint-plugin-unicorn-50.0.1.tgz", @@ -11391,15 +11484,6 @@ "url": "https://opencollective.com/eslint" } }, - "node_modules/eslint/node_modules/estraverse": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", - "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", - "dev": true, - "engines": { - "node": ">=4.0" - } - }, "node_modules/eslint/node_modules/glob-parent": { "version": "6.0.2", "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", @@ -11476,15 +11560,6 @@ "node": ">=0.10" } }, - "node_modules/esquery/node_modules/estraverse": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", - "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", - "dev": true, - "engines": { - "node": ">=4.0" - } - }, "node_modules/esrecurse": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", @@ -11497,7 +11572,7 @@ "node": ">=4.0" } }, - "node_modules/esrecurse/node_modules/estraverse": { + "node_modules/estraverse": { "version": "5.3.0", "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", @@ -17237,6 +17312,19 @@ "get-intrinsic": "^1.2.1" } }, + "node_modules/object.hasown": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/object.hasown/-/object.hasown-1.1.3.tgz", + "integrity": "sha512-fFI4VcYpRHvSLXxP7yiZOMAd331cPfd2p7PFDVbgUsYOfCT3tICVqXWngbjr4m49OvsBwUBQ6O2uQoJvy3RexA==", + "dev": true, + "dependencies": { + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/object.values": { "version": "1.1.7", "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.1.7.tgz", @@ -20377,6 +20465,26 @@ "node": ">=8" } }, + "node_modules/string.prototype.matchall": { + "version": "4.0.10", + "resolved": "https://registry.npmjs.org/string.prototype.matchall/-/string.prototype.matchall-4.0.10.tgz", + "integrity": "sha512-rGXbGmOEosIQi6Qva94HUjgPs9vKW+dkG7Y8Q5O2OYkWL6wFaTRZO8zM4mhP94uX55wgyrXzfS2aGtGzUL7EJQ==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1", + "get-intrinsic": "^1.2.1", + "has-symbols": "^1.0.3", + "internal-slot": "^1.0.5", + "regexp.prototype.flags": "^1.5.0", + "set-function-name": "^2.0.0", + "side-channel": "^1.0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/string.prototype.padend": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/string.prototype.padend/-/string.prototype.padend-3.1.3.tgz", @@ -21892,6 +22000,12 @@ "vega-lite": "*" } }, + "node_modules/vega-embed/node_modules/yallist": { + "version": "4.0.0", + "extraneous": true, + "inBundle": true, + "license": "ISC" + }, "node_modules/vega-encode": { "version": "4.9.1", "resolved": "https://registry.npmjs.org/vega-encode/-/vega-encode-4.9.1.tgz", @@ -23107,19 +23221,11 @@ "@types/tmp": "0.2.6", "@types/turndown": "5.0.1", "@types/validator": "13.11.7", - "@typescript-eslint/eslint-plugin": "6.18.0", - "@typescript-eslint/parser": "6.18.0", - "eslint": "8.56.0", - "eslint-config-prettier": "9.1.0", - "eslint-import-resolver-typescript": "3.6.1", - "eslint-plugin-import": "2.29.1", - "eslint-plugin-prettier": "5.1.2", "find": "0.3.0", "fs-extra": "11.2.0", "jsonfile": "6.1.0", "nodemon": "3.0.2", "npm-run-all": "4.1.5", - "prettier": "3.1.1", "supertest": "6.3.3", "typescript": "4.6.4" } @@ -23145,16 +23251,8 @@ "@types/module-alias": "2.0.4", "@types/node": "18.15.11", "@types/tmp": "0.2.6", - "@typescript-eslint/eslint-plugin": "6.18.0", - "@typescript-eslint/parser": "6.18.0", - "eslint": "8.56.0", - "eslint-config-prettier": "9.1.0", - "eslint-import-resolver-typescript": "3.6.1", - "eslint-plugin-import": "2.29.1", - "eslint-plugin-prettier": "5.1.2", "nodemon": "3.0.2", "npm-run-all": "4.1.5", - "prettier": "3.1.1", "typescript": "4.6.4" } }, @@ -23243,17 +23341,11 @@ "@types/react-linkify": "1.0.4", "@types/react-router-dom": "5.3.3", "@types/react-table": "7.7.14", - "@typescript-eslint/eslint-plugin": "6.18.0", - "@typescript-eslint/parser": "6.18.0", "@vitejs/plugin-react": "4.2.1", "esbuild": "0.19.11", - "eslint": "8.56.0", - "eslint-config-prettier": "9.1.0", - "eslint-plugin-import": "2.29.1", "eslint-plugin-jsx-a11y": "6.8.0", - "eslint-plugin-prettier": "5.1.2", + "eslint-plugin-react": "7.33.2", "eslint-plugin-react-hooks": "4.6.0", - "prettier": "3.1.1", "rollup-plugin-visualizer": "5.12.0", "typescript": "4.6.4", "vite": "5.0.10" @@ -24773,16 +24865,8 @@ "@types/module-alias": "2.0.4", "@types/node": "18.15.11", "@types/tmp": "0.2.6", - "@typescript-eslint/eslint-plugin": "6.18.0", - "@typescript-eslint/parser": "6.18.0", - "eslint": "8.56.0", - "eslint-config-prettier": "9.1.0", - "eslint-import-resolver-typescript": "3.6.1", - "eslint-plugin-import": "2.29.1", - "eslint-plugin-prettier": "5.1.2", "nodemon": "3.0.2", "npm-run-all": "4.1.5", - "prettier": "3.1.1", "typescript": "4.6.4" } } @@ -28570,8 +28654,6 @@ "@types/tmp": "0.2.6", "@types/turndown": "5.0.1", "@types/validator": "13.11.7", - "@typescript-eslint/eslint-plugin": "6.18.0", - "@typescript-eslint/parser": "6.18.0", "apollo-server-core": "3.13.0", "apollo-server-express": "3.13.0", "axios": "1.6.3", @@ -28584,11 +28666,6 @@ "dataloader": "2.2.2", "deep-object-diff": "1.1.9", "dotenv-flow": "3.2.0", - "eslint": "8.56.0", - "eslint-config-prettier": "9.1.0", - "eslint-import-resolver-typescript": "3.6.1", - "eslint-plugin-import": "2.29.1", - "eslint-plugin-prettier": "5.1.2", "express": "4.18.1", "express-async-errors": "3.1.1", "file-type": "16.5.3", @@ -28620,7 +28697,6 @@ "p-retry": "4.6.2", "parsimmon": "1.18.1", "pg": "8.11.3", - "prettier": "3.1.1", "reading-time": "1.5.0", "reflect-metadata": "0.1.13", "supertest": "6.3.3", @@ -28643,15 +28719,8 @@ "@types/module-alias": "2.0.4", "@types/node": "18.15.11", "@types/tmp": "0.2.6", - "@typescript-eslint/eslint-plugin": "6.18.0", - "@typescript-eslint/parser": "6.18.0", "compression": "1.7.4", "dotenv-flow": "3.2.0", - "eslint": "8.56.0", - "eslint-config-prettier": "9.1.0", - "eslint-import-resolver-typescript": "3.6.1", - "eslint-plugin-import": "2.29.1", - "eslint-plugin-prettier": "5.1.2", "express": "4.18.1", "express-async-errors": "3.1.1", "helmet": "5.1.0", @@ -28659,7 +28728,6 @@ "module-alias": "2.2.3", "nodemon": "3.0.2", "npm-run-all": "4.1.5", - "prettier": "3.1.1", "reflect-metadata": "0.1.13", "tmp-promise": "3.0.3", "typescript": "4.6.4" @@ -28688,8 +28756,6 @@ "@types/react-linkify": "1.0.4", "@types/react-router-dom": "5.3.3", "@types/react-table": "7.7.14", - "@typescript-eslint/eslint-plugin": "6.18.0", - "@typescript-eslint/parser": "6.18.0", "@urql/core": "2.6.0", "@urql/exchange-graphcache": "4.4.3", "@urql/exchange-multipart-fetch": "0.1.14", @@ -28699,11 +28765,8 @@ "chart.xkcd": "1.1.15", "chart.xkcd-react": "0.0.6", "esbuild": "0.19.11", - "eslint": "8.56.0", - "eslint-config-prettier": "9.1.0", - "eslint-plugin-import": "2.29.1", "eslint-plugin-jsx-a11y": "6.8.0", - "eslint-plugin-prettier": "5.1.2", + "eslint-plugin-react": "7.33.2", "eslint-plugin-react-hooks": "4.6.0", "framer-motion": "10.11.2", "graphql": "15.8.0", @@ -28716,7 +28779,6 @@ "node-emoji": "2.1.3", "papaparse": "5.4.1", "parsimmon": "1.18.1", - "prettier": "3.1.1", "react": "18.2.0", "react-ace": "10.1.0", "react-confetti": "6.1.0", @@ -29816,19 +29878,11 @@ "@types/module-alias": "2.0.4", "@types/node": "18.15.11", "@types/tmp": "0.2.6", - "@typescript-eslint/eslint-plugin": "6.18.0", - "@typescript-eslint/parser": "6.18.0", "dotenv-flow": "3.2.0", - "eslint": "8.56.0", - "eslint-config-prettier": "9.1.0", - "eslint-import-resolver-typescript": "3.6.1", - "eslint-plugin-import": "2.29.1", - "eslint-plugin-prettier": "5.1.2", "express": "4.18.1", "module-alias": "2.2.3", "nodemon": "3.0.2", "npm-run-all": "4.1.5", - "prettier": "3.1.1", "reflect-metadata": "0.1.13", "tmp-promise": "3.0.3", "typescript": "4.6.4" @@ -32802,6 +32856,19 @@ "is-string": "^1.0.7" } }, + "array.prototype.tosorted": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/array.prototype.tosorted/-/array.prototype.tosorted-1.1.2.tgz", + "integrity": "sha512-HuQCHOlk1Weat5jzStICBCd83NxiIMwqDg/dHEsoefabn/hJRj5pVdWcPUSpRrwhwxZOsQassMpgN/xRYFBMIg==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1", + "es-shim-unscopables": "^1.0.0", + "get-intrinsic": "^1.2.1" + } + }, "arraybuffer.prototype.slice": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/arraybuffer.prototype.slice/-/arraybuffer.prototype.slice-1.0.2.tgz", @@ -34787,12 +34854,6 @@ "estraverse": "^5.2.0" } }, - "estraverse": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", - "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", - "dev": true - }, "glob-parent": { "version": "6.0.2", "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", @@ -34997,6 +35058,67 @@ "synckit": "^0.8.6" } }, + "eslint-plugin-react": { + "version": "7.33.2", + "resolved": "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-7.33.2.tgz", + "integrity": "sha512-73QQMKALArI8/7xGLNI/3LylrEYrlKZSb5C9+q3OtOewTnMQi5cT+aE9E41sLCmli3I9PGGmD1yiZydyo4FEPw==", + "dev": true, + "requires": { + "array-includes": "^3.1.6", + "array.prototype.flatmap": "^1.3.1", + "array.prototype.tosorted": "^1.1.1", + "doctrine": "^2.1.0", + "es-iterator-helpers": "^1.0.12", + "estraverse": "^5.3.0", + "jsx-ast-utils": "^2.4.1 || ^3.0.0", + "minimatch": "^3.1.2", + "object.entries": "^1.1.6", + "object.fromentries": "^2.0.6", + "object.hasown": "^1.1.2", + "object.values": "^1.1.6", + "prop-types": "^15.8.1", + "resolve": "^2.0.0-next.4", + "semver": "^6.3.1", + "string.prototype.matchall": "^4.0.8" + }, + "dependencies": { + "doctrine": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", + "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", + "dev": true, + "requires": { + "esutils": "^2.0.2" + } + }, + "minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "resolve": { + "version": "2.0.0-next.5", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-2.0.0-next.5.tgz", + "integrity": "sha512-U7WjGVG9sH8tvjW5SmGbQuui75FiyjAX72HX15DwBBwF9dNiQZRQAg9nnPhYy+TUnE0+VcrttuvNI8oSxZcocA==", + "dev": true, + "requires": { + "is-core-module": "^2.13.0", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + } + }, + "semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true + } + } + }, "eslint-plugin-react-hooks": { "version": "4.6.0", "resolved": "https://registry.npmjs.org/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-4.6.0.tgz", @@ -35139,14 +35261,6 @@ "dev": true, "requires": { "estraverse": "^5.1.0" - }, - "dependencies": { - "estraverse": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", - "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", - "dev": true - } } }, "esrecurse": { @@ -35156,16 +35270,14 @@ "dev": true, "requires": { "estraverse": "^5.2.0" - }, - "dependencies": { - "estraverse": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", - "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", - "dev": true - } } }, + "estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true + }, "estree-walker": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-3.0.3.tgz", @@ -39328,6 +39440,16 @@ "get-intrinsic": "^1.2.1" } }, + "object.hasown": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/object.hasown/-/object.hasown-1.1.3.tgz", + "integrity": "sha512-fFI4VcYpRHvSLXxP7yiZOMAd331cPfd2p7PFDVbgUsYOfCT3tICVqXWngbjr4m49OvsBwUBQ6O2uQoJvy3RexA==", + "dev": true, + "requires": { + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1" + } + }, "object.values": { "version": "1.1.7", "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.1.7.tgz", @@ -41653,6 +41775,23 @@ "strip-ansi": "^6.0.1" } }, + "string.prototype.matchall": { + "version": "4.0.10", + "resolved": "https://registry.npmjs.org/string.prototype.matchall/-/string.prototype.matchall-4.0.10.tgz", + "integrity": "sha512-rGXbGmOEosIQi6Qva94HUjgPs9vKW+dkG7Y8Q5O2OYkWL6wFaTRZO8zM4mhP94uX55wgyrXzfS2aGtGzUL7EJQ==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1", + "get-intrinsic": "^1.2.1", + "has-symbols": "^1.0.3", + "internal-slot": "^1.0.5", + "regexp.prototype.flags": "^1.5.0", + "set-function-name": "^2.0.0", + "side-channel": "^1.0.4" + } + }, "string.prototype.padend": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/string.prototype.padend/-/string.prototype.padend-3.1.3.tgz", @@ -42740,6 +42879,13 @@ "vega-schema-url-parser": "^2.2.0", "vega-themes": "^2.10.0", "vega-tooltip": "^0.27.0" + }, + "dependencies": { + "yallist": { + "version": "4.0.0", + "bundled": true, + "extraneous": true + } } }, "vega-encode": { diff --git a/package.json b/package.json index d2258ad8e..53370eec9 100644 --- a/package.json +++ b/package.json @@ -62,8 +62,8 @@ "start": "npm run generate && run-p start:frontend start:backend", "start:nogen": "run-p start:frontend:nogen start:backend", "-------": "-----------------------------------", - "lint": "npm run lint --workspaces", - "lint:fix": "npm run lint:fix --workspaces", + "lint": "eslint . --ext .ts,.tsx,.js,.jsx", + "lint:fix": "eslint . --ext .ts,.tsx,.js,.jsx --fix", "verify:headers": "ts-node scripts/verify-file-headers.ts", "------": "------------------------------------", "generate": "graphql-codegen", diff --git a/packages/backend/.eslintignore b/packages/backend/.eslintignore deleted file mode 100644 index 18e612f0d..000000000 --- a/packages/backend/.eslintignore +++ /dev/null @@ -1,5 +0,0 @@ -coverage -dist -migrations -node_modules -**/generated/graphql.ts diff --git a/packages/backend/.eslintrc.yml b/packages/backend/.eslintrc.yml index 8e3bac744..9d02f1b67 100644 --- a/packages/backend/.eslintrc.yml +++ b/packages/backend/.eslintrc.yml @@ -1,80 +1,75 @@ -env: - node: true -settings: - import/resolver: - typescript: - projects: - - tsconfig.json +ignorePatterns: + - migrations/ rules: no-console: ['error'] '@typescript-eslint/consistent-type-imports': off - '@typescript-eslint/no-explicit-any': off - '@typescript-eslint/no-non-null-assertion': off - '@typescript-eslint/member-ordering': [ - 'error', - { - 'default': [ - 'signature', + '@typescript-eslint/member-ordering': + [ + 'error', + { + 'default': + [ + 'signature', - 'public-static-field', - 'protected-static-field', - 'private-static-field', + 'public-static-field', + 'protected-static-field', + 'private-static-field', - 'public-decorated-field', - 'protected-decorated-field', - 'private-decorated-field', + 'public-decorated-field', + 'protected-decorated-field', + 'private-decorated-field', - 'public-instance-field', - 'protected-instance-field', - 'private-instance-field', + 'public-instance-field', + 'protected-instance-field', + 'private-instance-field', - 'public-abstract-field', - 'protected-abstract-field', + 'public-abstract-field', + 'protected-abstract-field', - 'public-field', - 'protected-field', - 'private-field', + 'public-field', + 'protected-field', + 'private-field', - 'static-field', - 'instance-field', - 'abstract-field', + 'static-field', + 'instance-field', + 'abstract-field', - 'decorated-field', + 'decorated-field', - 'field', + 'field', - 'public-constructor', - 'protected-constructor', - 'private-constructor', + 'public-constructor', + 'protected-constructor', + 'private-constructor', - 'constructor', + 'constructor', - 'public-static-method', - 'protected-static-method', - 'private-static-method', + 'public-static-method', + 'protected-static-method', + 'private-static-method', - 'public-decorated-method', - 'protected-decorated-method', - 'private-decorated-method', + 'public-decorated-method', + 'protected-decorated-method', + 'private-decorated-method', - 'public-instance-method', - 'protected-instance-method', - 'private-instance-method', + 'public-instance-method', + 'protected-instance-method', + 'private-instance-method', - 'public-abstract-method', - 'protected-abstract-method', + 'public-abstract-method', + 'protected-abstract-method', - 'public-method', - 'protected-method', - 'private-method', + 'public-method', + 'protected-method', + 'private-method', - 'static-method', - 'instance-method', - 'abstract-method', + 'static-method', + 'instance-method', + 'abstract-method', - 'decorated-method', + 'decorated-method', - 'method' - ] - } - ] + 'method' + ] + } + ] diff --git a/packages/backend/package.json b/packages/backend/package.json index 2c0c721eb..f51e3dc30 100644 --- a/packages/backend/package.json +++ b/packages/backend/package.json @@ -99,19 +99,11 @@ "@types/tmp": "0.2.6", "@types/turndown": "5.0.1", "@types/validator": "13.11.7", - "@typescript-eslint/eslint-plugin": "6.18.0", - "@typescript-eslint/parser": "6.18.0", - "eslint": "8.56.0", - "eslint-config-prettier": "9.1.0", - "eslint-import-resolver-typescript": "3.6.1", - "eslint-plugin-import": "2.29.1", - "eslint-plugin-prettier": "5.1.2", "find": "0.3.0", "fs-extra": "11.2.0", "jsonfile": "6.1.0", "nodemon": "3.0.2", "npm-run-all": "4.1.5", - "prettier": "3.1.1", "supertest": "6.3.3", "typescript": "4.6.4" } diff --git a/packages/backend/tsconfig.eslint.json b/packages/backend/tsconfig.eslint.json new file mode 100644 index 000000000..49d96e73d --- /dev/null +++ b/packages/backend/tsconfig.eslint.json @@ -0,0 +1,10 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "noEmit": true + }, + "include": [ + "src", + "test" + ], +} diff --git a/packages/convertbot/.eslintignore b/packages/convertbot/.eslintignore deleted file mode 100644 index 0e75fe557..000000000 --- a/packages/convertbot/.eslintignore +++ /dev/null @@ -1,3 +0,0 @@ -node_modules -dist -coverage diff --git a/packages/convertbot/package.json b/packages/convertbot/package.json index 0cb3836fd..e783c469d 100644 --- a/packages/convertbot/package.json +++ b/packages/convertbot/package.json @@ -41,16 +41,8 @@ "@types/module-alias": "2.0.4", "@types/node": "18.15.11", "@types/tmp": "0.2.6", - "@typescript-eslint/eslint-plugin": "6.18.0", - "@typescript-eslint/parser": "6.18.0", - "eslint": "8.56.0", - "eslint-config-prettier": "9.1.0", - "eslint-import-resolver-typescript": "3.6.1", - "eslint-plugin-import": "2.29.1", - "eslint-plugin-prettier": "5.1.2", "nodemon": "3.0.2", "npm-run-all": "4.1.5", - "prettier": "3.1.1", "typescript": "4.6.4" } } diff --git a/packages/frontend/.eslintignore b/packages/frontend/.eslintignore deleted file mode 100644 index ed2f03832..000000000 --- a/packages/frontend/.eslintignore +++ /dev/null @@ -1,5 +0,0 @@ -coverage -dist -node_modules - -**/generated/graphql.ts diff --git a/packages/frontend/.eslintrc.yml b/packages/frontend/.eslintrc.yml index 68ed2ae37..4f42274ef 100644 --- a/packages/frontend/.eslintrc.yml +++ b/packages/frontend/.eslintrc.yml @@ -1,13 +1,17 @@ parser: '@typescript-eslint/parser' -parserOptions: - ecmaVersion: 2020 - sourceType: module - warnOnUnsupportedTypeScriptVersion: false +env: + node: false + browser: true plugins: - jsx-a11y extends: - - plugin:jsx-a11y/recommended + # - plugin:react/recommended + # - plugin:react/jsx-runtime - plugin:react-hooks/recommended + - plugin:jsx-a11y/recommended +settings: + react: + version: 'detect' rules: '@typescript-eslint/explicit-function-return-type': off '@typescript-eslint/no-unused-vars': off diff --git a/packages/frontend/package.json b/packages/frontend/package.json index 61fee840e..d90248ee9 100644 --- a/packages/frontend/package.json +++ b/packages/frontend/package.json @@ -85,17 +85,11 @@ "@types/react-linkify": "1.0.4", "@types/react-router-dom": "5.3.3", "@types/react-table": "7.7.14", - "@typescript-eslint/eslint-plugin": "6.18.0", - "@typescript-eslint/parser": "6.18.0", "@vitejs/plugin-react": "4.2.1", "esbuild": "0.19.11", - "eslint": "8.56.0", - "eslint-config-prettier": "9.1.0", - "eslint-plugin-import": "2.29.1", "eslint-plugin-jsx-a11y": "6.8.0", - "eslint-plugin-prettier": "5.1.2", + "eslint-plugin-react": "7.33.2", "eslint-plugin-react-hooks": "4.6.0", - "prettier": "3.1.1", "rollup-plugin-visualizer": "5.12.0", "typescript": "4.6.4", "vite": "5.0.10" diff --git a/packages/frontend/tsconfig.eslint.json b/packages/frontend/tsconfig.eslint.json new file mode 100644 index 000000000..9e2bcdcf8 --- /dev/null +++ b/packages/frontend/tsconfig.eslint.json @@ -0,0 +1,9 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "noEmit": true + }, + "include": [ + "src" + ], +} diff --git a/packages/models/.eslintignore b/packages/models/.eslintignore deleted file mode 100644 index 264ee62e4..000000000 --- a/packages/models/.eslintignore +++ /dev/null @@ -1,4 +0,0 @@ -node_modules -dist -coverage -**/generated/graphql.ts diff --git a/packages/mq/.eslintignore b/packages/mq/.eslintignore deleted file mode 100644 index 0e75fe557..000000000 --- a/packages/mq/.eslintignore +++ /dev/null @@ -1,3 +0,0 @@ -node_modules -dist -coverage diff --git a/packages/shared/.eslintignore b/packages/shared/.eslintignore deleted file mode 100644 index 0e75fe557..000000000 --- a/packages/shared/.eslintignore +++ /dev/null @@ -1,3 +0,0 @@ -node_modules -dist -coverage diff --git a/packages/slackbot/.eslintignore b/packages/slackbot/.eslintignore deleted file mode 100644 index 264ee62e4..000000000 --- a/packages/slackbot/.eslintignore +++ /dev/null @@ -1,4 +0,0 @@ -node_modules -dist -coverage -**/generated/graphql.ts diff --git a/packages/slackbot/package.json b/packages/slackbot/package.json index 310396ec5..b8ddf51de 100644 --- a/packages/slackbot/package.json +++ b/packages/slackbot/package.json @@ -38,16 +38,8 @@ "@types/module-alias": "2.0.4", "@types/node": "18.15.11", "@types/tmp": "0.2.6", - "@typescript-eslint/eslint-plugin": "6.18.0", - "@typescript-eslint/parser": "6.18.0", - "eslint": "8.56.0", - "eslint-config-prettier": "9.1.0", - "eslint-import-resolver-typescript": "3.6.1", - "eslint-plugin-import": "2.29.1", - "eslint-plugin-prettier": "5.1.2", "nodemon": "3.0.2", "npm-run-all": "4.1.5", - "prettier": "3.1.1", "typescript": "4.6.4" } } diff --git a/scripts/verify-file-headers.ts b/scripts/verify-file-headers.ts index 4128bb5cd..820845444 100644 --- a/scripts/verify-file-headers.ts +++ b/scripts/verify-file-headers.ts @@ -47,4 +47,5 @@ async function verifyFileHeaders() { console.info('All files contain a valid copyright header!'); } +// eslint-disable-next-line unicorn/prefer-top-level-await verifyFileHeaders(); diff --git a/tsconfig.eslint.json b/tsconfig.eslint.json new file mode 100644 index 000000000..f8b654a3d --- /dev/null +++ b/tsconfig.eslint.json @@ -0,0 +1,11 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "noEmit": true + }, + "include": [ + "*.ts", + "scripts/*.ts", + "packages/**/*" + ] +}