diff --git a/.eslintcache b/.eslintcache index 5561bc2..67430b2 100644 --- a/.eslintcache +++ b/.eslintcache @@ -1 +1 @@ -[{"/Users/alopes/Desktop/dev-abel/eslint-config-tsr-pro/specs/index.snapshot.test.ts":"1","/Users/alopes/Desktop/dev-abel/eslint-config-tsr-pro/specs/index.unit.test.ts":"2","/Users/alopes/Desktop/dev-abel/eslint-config-tsr-pro/src/index.ts":"3","/Users/alopes/Desktop/dev-abel/eslint-config-tsr-pro/src/config-base.ts":"4","/Users/alopes/Desktop/dev-abel/eslint-config-tsr-pro/src/config-react.ts":"5","/Users/alopes/Desktop/dev-abel/eslint-config-tsr-pro/src/config-testing.ts":"6","/Users/alopes/Desktop/dev-abel/eslint-config-tsr-pro/src/config-typescript.ts":"7","/Users/alopes/Desktop/dev-abel/eslint-config-tsr-pro/jest.config.ts":"8"},{"size":170,"mtime":1707097005292,"results":"9","hashOfConfig":"10"},{"size":1049,"mtime":1707097482072,"results":"11","hashOfConfig":"10"},{"size":2102,"mtime":1707096715802,"results":"12","hashOfConfig":"10"},{"size":6165,"mtime":1707096822908,"results":"13","hashOfConfig":"10"},{"size":2978,"mtime":1707095421992,"results":"14","hashOfConfig":"10"},{"size":1362,"mtime":1707095346500,"results":"15","hashOfConfig":"10"},{"size":4412,"mtime":1707097531015,"results":"16","hashOfConfig":"10"},{"size":116,"mtime":1707097206664,"results":"17","hashOfConfig":"10"},{"filePath":"18","messages":"19","suppressedMessages":"20","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"u7ble2",{"filePath":"21","messages":"22","suppressedMessages":"23","errorCount":2,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"24","messages":"25","suppressedMessages":"26","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"27","messages":"28","suppressedMessages":"29","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"30","messages":"31","suppressedMessages":"32","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"33","messages":"34","suppressedMessages":"35","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"36","messages":"37","suppressedMessages":"38","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"39","messages":"40","suppressedMessages":"41","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"/Users/alopes/Desktop/dev-abel/eslint-config-tsr-pro/specs/index.snapshot.test.ts",[],[],"/Users/alopes/Desktop/dev-abel/eslint-config-tsr-pro/specs/index.unit.test.ts",["42","43"],["44"],"/Users/alopes/Desktop/dev-abel/eslint-config-tsr-pro/src/index.ts",[],[],"/Users/alopes/Desktop/dev-abel/eslint-config-tsr-pro/src/config-base.ts",[],[],"/Users/alopes/Desktop/dev-abel/eslint-config-tsr-pro/src/config-react.ts",[],[],"/Users/alopes/Desktop/dev-abel/eslint-config-tsr-pro/src/config-testing.ts",[],[],"/Users/alopes/Desktop/dev-abel/eslint-config-tsr-pro/src/config-typescript.ts",[],[],"/Users/alopes/Desktop/dev-abel/eslint-config-tsr-pro/jest.config.ts",[],[],{"ruleId":"45","severity":2,"message":"46","line":26,"column":7,"nodeType":"47","messageId":"48","endLine":26,"endColumn":18,"suggestions":"49"},{"ruleId":"45","severity":2,"message":"46","line":27,"column":7,"nodeType":"47","messageId":"48","endLine":27,"endColumn":18,"suggestions":"50"},{"ruleId":"51","severity":2,"message":"52","line":8,"column":7,"nodeType":"53","messageId":"54","endLine":11,"endColumn":10,"suppressions":"55"},"no-console","Unexpected console statement.","MemberExpression","unexpected",["56"],["57"],"no-new","Do not use 'new' for side effects.","ExpressionStatement","noNewStatement",["58"],{"messageId":"59","data":"60","fix":"61","desc":"62"},{"messageId":"59","data":"63","fix":"64","desc":"62"},{"kind":"65","justification":"66"},"removeConsole",{"propertyName":"67"},{"range":"68","text":"69"},"Remove the console.log().",{"propertyName":"67"},{"range":"70","text":"69"},"directive","in this case its necessary for testing","log",[622,639],"",[646,697]] \ No newline at end of file +[{"/Users/alopes/Desktop/dev-abel/eslint-config-tsr-pro/specs/index.snapshot.test.ts":"1","/Users/alopes/Desktop/dev-abel/eslint-config-tsr-pro/specs/index.unit.test.ts":"2","/Users/alopes/Desktop/dev-abel/eslint-config-tsr-pro/src/index.ts":"3","/Users/alopes/Desktop/dev-abel/eslint-config-tsr-pro/src/config-base.ts":"4","/Users/alopes/Desktop/dev-abel/eslint-config-tsr-pro/src/config-react.ts":"5","/Users/alopes/Desktop/dev-abel/eslint-config-tsr-pro/src/config-testing.ts":"6","/Users/alopes/Desktop/dev-abel/eslint-config-tsr-pro/src/config-typescript.ts":"7","/Users/alopes/Desktop/dev-abel/eslint-config-tsr-pro/jest.config.ts":"8"},{"size":170,"mtime":1707097005292,"results":"9","hashOfConfig":"10"},{"size":1436,"mtime":1708474853884,"results":"11","hashOfConfig":"10"},{"size":2119,"mtime":1708474914122,"results":"12","hashOfConfig":"10"},{"size":6249,"mtime":1708474927115,"results":"13","hashOfConfig":"10"},{"size":2635,"mtime":1707315687431,"results":"14","hashOfConfig":"10"},{"size":1318,"mtime":1707140324255,"results":"15","hashOfConfig":"10"},{"size":4425,"mtime":1707352264520,"results":"16","hashOfConfig":"10"},{"size":116,"mtime":1708474859080,"results":"17","hashOfConfig":"10"},{"filePath":"18","messages":"19","suppressedMessages":"20","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"1vwysot",{"filePath":"21","messages":"22","suppressedMessages":"23","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"24","messages":"25","suppressedMessages":"26","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"27","messages":"28","suppressedMessages":"29","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"30","messages":"31","suppressedMessages":"32","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"33","messages":"34","suppressedMessages":"35","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"36","messages":"37","suppressedMessages":"38","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"39","messages":"40","suppressedMessages":"41","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"/Users/alopes/Desktop/dev-abel/eslint-config-tsr-pro/specs/index.snapshot.test.ts",[],[],"/Users/alopes/Desktop/dev-abel/eslint-config-tsr-pro/specs/index.unit.test.ts",[],["42","43"],"/Users/alopes/Desktop/dev-abel/eslint-config-tsr-pro/src/index.ts",[],[],"/Users/alopes/Desktop/dev-abel/eslint-config-tsr-pro/src/config-base.ts",[],["44"],"/Users/alopes/Desktop/dev-abel/eslint-config-tsr-pro/src/config-react.ts",[],[],"/Users/alopes/Desktop/dev-abel/eslint-config-tsr-pro/src/config-testing.ts",[],[],"/Users/alopes/Desktop/dev-abel/eslint-config-tsr-pro/src/config-typescript.ts",[],[],"/Users/alopes/Desktop/dev-abel/eslint-config-tsr-pro/jest.config.ts",[],[],{"ruleId":"45","severity":2,"message":"46","line":9,"column":7,"nodeType":"47","messageId":"48","endLine":12,"endColumn":10,"suppressions":"49"},{"ruleId":"50","severity":2,"message":"51","line":42,"column":5,"nodeType":"52","messageId":"53","endLine":42,"endColumn":18,"suggestions":"54","suppressions":"55"},{"ruleId":"56","severity":1,"message":"57","line":158,"column":5,"nodeType":null,"messageId":"58","endLine":164,"endColumn":10,"suppressions":"59"},"no-new","Do not use 'new' for side effects.","ExpressionStatement","noNewStatement",["60"],"no-console","Unexpected console statement.","MemberExpression","unexpected",["61"],["62"],"etc/no-commented-out-code","Commented-out code is forbidden.","forbidden",["63"],{"kind":"64","justification":"65"},{"messageId":"66","data":"67","fix":"68","desc":"69"},{"kind":"64","justification":"70"},{"kind":"64","justification":"71"},"directive","in this case its necessary for testing","removeConsole",{"propertyName":"72"},{"range":"73","text":"74"},"Remove the console.error().","send information of deprecated rules to the console","TODO: to confirm ETC plugin rules","error",[1115,1365],""] \ No newline at end of file diff --git a/.eslintrc.js b/.eslintrc.js index 464b84d..86bbe06 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -2,9 +2,6 @@ const config = { extends: "./dist/index.js", - rules: { - "unicorn/prefer-module": 0, - }, }; module.exports = config; diff --git a/README.md b/README.md index 7be6a59..6385491 100644 --- a/README.md +++ b/README.md @@ -46,6 +46,8 @@ Used plugins / configs: - [x] [Eslint Comments](https://www.npmjs.com/package/eslint-plugin-eslint-comments) - [ ] [Stylistic (TODO)](https://www.npmjs.com/package/@stylistic/eslint-plugin) - [ ] [N (TODO)](https://www.npmjs.com/package/eslint-plugin-n) +- [ ] [Compat (TODO)](https://github.com/amilajack/eslint-plugin-compat) +- [ ] [Promise](https://github.com/eslint-community/eslint-plugin-promise) To achieve maximum consistency, use along with [prettier-config-pro](https://www.npmjs.com/package/@abelflopes/prettier-config-pro); diff --git a/jest.config.ts b/jest.config.ts index 566dde0..5347ed2 100644 --- a/jest.config.ts +++ b/jest.config.ts @@ -1,4 +1,4 @@ -import type { Config } from "jest"; +import { type Config } from "jest"; const config: Config = { testEnvironment: "node", diff --git a/package-lock.json b/package-lock.json index c3ed983..dc7b12a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13,8 +13,12 @@ "eslint-plugin-etc": "^2.0.3", "eslint-plugin-import": "^2.28.1", "eslint-plugin-jest": "^27.4.0", + "eslint-plugin-jsx-a11y": "^6.8.0", "eslint-plugin-prettier": "^5.0.0", "eslint-plugin-promise": "^6.1.1", + "eslint-plugin-react": "^7.33.2", + "eslint-plugin-react-hooks": "^4.6.0", + "eslint-plugin-react-refresh": "^0.4.5", "eslint-plugin-tsdoc": "^0.2.17", "eslint-plugin-workspaces": "^0.9.0" }, @@ -1744,7 +1748,6 @@ "version": "7.23.9", "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.23.9.tgz", "integrity": "sha512-0CX6F+BI2s9dkUqr08KFrAIZgNFj75rdBU/DjCyYLIaV/quFjkk6T+EJ2LkZHyZTbEV4L5p97mNkUsHl2wLFAw==", - "dev": true, "dependencies": { "regenerator-runtime": "^0.14.0" }, @@ -5193,6 +5196,14 @@ "integrity": "sha512-F2+Hkm9xFaRg+GkaNnbwXNDV5O6pnCFEmqyhvfC/Ic5LbgOWjJh3L+mN/s91rxVL3znE7DYVpW0GJFT+4YBgWw==", "dev": true }, + "node_modules/aria-query": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/aria-query/-/aria-query-5.3.0.tgz", + "integrity": "sha512-b0P0sZPKtyu8HkeRAfCq0IfURZK+SuwMjY1UXGBU27wpAiTwQAIlq56IbIO+ytk/JjS1fMR14ee5WBBfKi5J6A==", + "dependencies": { + "dequal": "^2.0.3" + } + }, "node_modules/array-buffer-byte-length": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/array-buffer-byte-length/-/array-buffer-byte-length-1.0.1.tgz", @@ -5292,6 +5303,18 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/array.prototype.tosorted": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/array.prototype.tosorted/-/array.prototype.tosorted-1.1.3.tgz", + "integrity": "sha512-/DdH4TiTmOKzyQbp/eadcCVexiCb36xJg7HshYOYJnNZFDj33GEv0P7GxsynpShhq4OLYJzbGcBDkLsDt7MnNg==", + "dependencies": { + "call-bind": "^1.0.5", + "define-properties": "^1.2.1", + "es-abstract": "^1.22.3", + "es-errors": "^1.1.0", + "es-shim-unscopables": "^1.0.2" + } + }, "node_modules/arraybuffer.prototype.slice": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/arraybuffer.prototype.slice/-/arraybuffer.prototype.slice-1.0.2.tgz", @@ -5321,6 +5344,19 @@ "node": ">=0.10.0" } }, + "node_modules/ast-types-flow": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/ast-types-flow/-/ast-types-flow-0.0.8.tgz", + "integrity": "sha512-OH/2E5Fg20h2aPrbe+QL8JZQFko0YZaF+j4mnQ7BGhfavO7OpSLa8a0y9sBwomHdSbkhTS8TQNayBfnW5DwbvQ==" + }, + "node_modules/asynciterator.prototype": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/asynciterator.prototype/-/asynciterator.prototype-1.0.0.tgz", + "integrity": "sha512-wwHYEIS0Q80f5mosx3L/dfG5t5rjEa9Ft51GTaNt862EnpyGHpgz2RkZvLPp1oF5TnAiTohkEKVEu8pQPJI7Vg==", + "dependencies": { + "has-symbols": "^1.0.3" + } + }, "node_modules/available-typed-arrays": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.6.tgz", @@ -5332,6 +5368,22 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/axe-core": { + "version": "4.7.0", + "resolved": "https://registry.npmjs.org/axe-core/-/axe-core-4.7.0.tgz", + "integrity": "sha512-M0JtH+hlOL5pLQwHOLNYZaXuhqmvS8oExsqB1SBYgA4Dk7u/xx+YdGHXaK5pyUfed5mYXdlYiphWq3G8cRi5JQ==", + "engines": { + "node": ">=4" + } + }, + "node_modules/axobject-query": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/axobject-query/-/axobject-query-3.2.1.tgz", + "integrity": "sha512-jsyHu61e6N4Vbz/v18DHwWYKK0bSWLqn47eeDSKPB7m8tqMHF9YJ+mhIk2lVteyZrY8tnSj/jHOv4YiTCuCJgg==", + "dependencies": { + "dequal": "^2.0.3" + } + }, "node_modules/babel-jest": { "version": "29.7.0", "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-29.7.0.tgz", @@ -6194,6 +6246,11 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/damerau-levenshtein": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/damerau-levenshtein/-/damerau-levenshtein-1.0.8.tgz", + "integrity": "sha512-sdQSFB7+llfUcQHUQO3+B8ERRj0Oa4w9POWMI/puGtuf7gFywGmkaLCElnudfTiKZV+NvHqL0ifzdrI8Ro7ESA==" + }, "node_modules/dargs": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/dargs/-/dargs-7.0.0.tgz", @@ -6325,6 +6382,14 @@ "integrity": "sha512-xmHIy4F3scKVwMsQ4WnVaS8bHOx0DmVwRywosKhaILI0ywMDWPtBSku2HNxRvF7jtwDRsoEwYQSfbxj8b7RlJQ==", "dev": true }, + "node_modules/dequal": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/dequal/-/dequal-2.0.3.tgz", + "integrity": "sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==", + "engines": { + "node": ">=6" + } + }, "node_modules/detect-newline": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/detect-newline/-/detect-newline-3.1.0.tgz", @@ -6413,6 +6478,11 @@ "url": "https://github.com/sindresorhus/emittery?sponsor=1" } }, + "node_modules/emoji-regex": { + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", + "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==" + }, "node_modules/emojilib": { "version": "2.4.0", "resolved": "https://registry.npmjs.org/emojilib/-/emojilib-2.4.0.tgz", @@ -6628,13 +6698,34 @@ } }, "node_modules/es-errors": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.0.0.tgz", - "integrity": "sha512-yHV74THqMJUyFKkHyN7hyENcEZM3Dj2a2IrdClY+IT4BFQHkIVwlh8s6uZfjsFydMdNHv0F5mWgAA3ajFbsvVQ==", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", "engines": { "node": ">= 0.4" } }, + "node_modules/es-iterator-helpers": { + "version": "1.0.15", + "resolved": "https://registry.npmjs.org/es-iterator-helpers/-/es-iterator-helpers-1.0.15.tgz", + "integrity": "sha512-GhoY8uYqd6iwUl2kgjTm4CZAf6oo5mHK7BPqx3rKgx893YSsy0LGHV6gfqqQvZt/8xM8xeOnfXBCfqclMKkJ5g==", + "dependencies": { + "asynciterator.prototype": "^1.0.0", + "call-bind": "^1.0.2", + "define-properties": "^1.2.1", + "es-abstract": "^1.22.1", + "es-set-tostringtag": "^2.0.1", + "function-bind": "^1.1.1", + "get-intrinsic": "^1.2.1", + "globalthis": "^1.0.3", + "has-property-descriptors": "^1.0.0", + "has-proto": "^1.0.1", + "has-symbols": "^1.0.3", + "internal-slot": "^1.0.5", + "iterator.prototype": "^1.1.2", + "safe-array-concat": "^1.0.1" + } + }, "node_modules/es-set-tostringtag": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.0.2.tgz", @@ -7084,6 +7175,55 @@ "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" }, + "node_modules/eslint-plugin-jsx-a11y": { + "version": "6.8.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-jsx-a11y/-/eslint-plugin-jsx-a11y-6.8.0.tgz", + "integrity": "sha512-Hdh937BS3KdwwbBaKd5+PLCOmYY6U4f2h9Z2ktwtNKvIdIEu137rjYbcb9ApSbVJfWxANNuiKTD/9tOKjK9qOA==", + "dependencies": { + "@babel/runtime": "^7.23.2", + "aria-query": "^5.3.0", + "array-includes": "^3.1.7", + "array.prototype.flatmap": "^1.3.2", + "ast-types-flow": "^0.0.8", + "axe-core": "=4.7.0", + "axobject-query": "^3.2.1", + "damerau-levenshtein": "^1.0.8", + "emoji-regex": "^9.2.2", + "es-iterator-helpers": "^1.0.15", + "hasown": "^2.0.0", + "jsx-ast-utils": "^3.3.5", + "language-tags": "^1.0.9", + "minimatch": "^3.1.2", + "object.entries": "^1.1.7", + "object.fromentries": "^2.0.7" + }, + "engines": { + "node": ">=4.0" + }, + "peerDependencies": { + "eslint": "^3 || ^4 || ^5 || ^6 || ^7 || ^8" + } + }, + "node_modules/eslint-plugin-jsx-a11y/node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/eslint-plugin-jsx-a11y/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, "node_modules/eslint-plugin-prettier": { "version": "5.1.3", "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-5.1.3.tgz", @@ -7124,6 +7264,101 @@ "eslint": "^7.0.0 || ^8.0.0" } }, + "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==", + "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", + "integrity": "sha512-oFc7Itz9Qxh2x4gNHStv3BqJq54ExXmfC+a1NjAta66IAN87Wu0R/QArgIS9qKzX3dXKPI9H5crl9QchNMY9+g==", + "engines": { + "node": ">=10" + }, + "peerDependencies": { + "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-refresh": { + "version": "0.4.5", + "resolved": "https://registry.npmjs.org/eslint-plugin-react-refresh/-/eslint-plugin-react-refresh-0.4.5.tgz", + "integrity": "sha512-D53FYKJa+fDmZMtriODxvhwrO+IOqrxoEo21gMA0sjHdU6dPVH4OhyFip9ypl8HOF5RV5KdTo+rBQLvnY2cO8w==", + "peerDependencies": { + "eslint": ">=7" + } + }, + "node_modules/eslint-plugin-react/node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "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==", + "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==", + "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==", + "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-tsdoc": { "version": "0.2.17", "resolved": "https://registry.npmjs.org/eslint-plugin-tsdoc/-/eslint-plugin-tsdoc-0.2.17.tgz", @@ -8300,6 +8535,20 @@ "integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==", "devOptional": true }, + "node_modules/is-async-function": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-async-function/-/is-async-function-2.0.0.tgz", + "integrity": "sha512-Y1JXKrfykRJGdlDwdKlLpLyMIiWqWvuSd17TvZk68PLAOGOoF4Xyav1z0Xhoi+gCYjZVeC5SI+hYFOfvXmGRCA==", + "dependencies": { + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/is-bigint": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.0.4.tgz", @@ -8370,6 +8619,17 @@ "node": ">=0.10.0" } }, + "node_modules/is-finalizationregistry": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-finalizationregistry/-/is-finalizationregistry-1.0.2.tgz", + "integrity": "sha512-0by5vtUJs8iFQb5TYUHHPudOR+qXYIMKtiUzvLIZITZUjknFmziyBJuLhVRc+Ds0dREFlskDNJKYIdIzu/9pfw==", + "dependencies": { + "call-bind": "^1.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/is-fullwidth-code-point": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", @@ -8387,6 +8647,20 @@ "node": ">=6" } }, + "node_modules/is-generator-function": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/is-generator-function/-/is-generator-function-1.0.10.tgz", + "integrity": "sha512-jsEjy9l3yiXEQ+PsXdmBwEPcOxaXWLspKdplFUVI9vq1iZgIekeC0L167qeu86czQaxed3q/Uzuw0swL0irL8A==", + "dependencies": { + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/is-glob": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", @@ -8398,6 +8672,14 @@ "node": ">=0.10.0" } }, + "node_modules/is-map": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/is-map/-/is-map-2.0.2.tgz", + "integrity": "sha512-cOZFQQozTha1f4MxLFzlgKYPTyj26picdZTx82hbc/Xf4K/tZOOXSCkMvU4pKioRXGDLJRn0GM7Upe7kR721yg==", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/is-negative-zero": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.2.tgz", @@ -8472,6 +8754,14 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/is-set": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/is-set/-/is-set-2.0.2.tgz", + "integrity": "sha512-+2cnTEZeY5z/iXGbLhPrOAaK/Mau5k5eXq9j14CpRTftq0pAJu2MwVRSZhyZWBzx3o6X795Lz6Bpb6R0GKf37g==", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/is-shared-array-buffer": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.2.tgz", @@ -8561,6 +8851,14 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/is-weakmap": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-weakmap/-/is-weakmap-2.0.1.tgz", + "integrity": "sha512-NSBR4kH5oVj1Uwvv970ruUkCV7O1mzgVFO4/rev2cLRda9Tm9HrL70ZPut4rOHgY0FNrUu9BCbXA2sdQ+x0chA==", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/is-weakref": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/is-weakref/-/is-weakref-1.0.2.tgz", @@ -8572,6 +8870,18 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/is-weakset": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/is-weakset/-/is-weakset-2.0.2.tgz", + "integrity": "sha512-t2yVvttHkQktwnNNmBQ98AhENLdPUTDTE21uPqAQ0ARwQfGeQKRVS0NNurH7bTf7RrvcVn1OOge45CnBeHCSmg==", + "dependencies": { + "call-bind": "^1.0.2", + "get-intrinsic": "^1.1.1" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/isarray": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", @@ -8718,6 +9028,18 @@ "node": ">=8" } }, + "node_modules/iterator.prototype": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/iterator.prototype/-/iterator.prototype-1.1.2.tgz", + "integrity": "sha512-DR33HMMr8EzwuRL8Y9D3u2BMj8+RqSE850jfGu59kS7tbmPLzGkZmVSfyCFSDxuZiEY6Rzt3T2NA/qU+NwVj1w==", + "dependencies": { + "define-properties": "^1.2.1", + "get-intrinsic": "^1.2.1", + "has-symbols": "^1.0.3", + "reflect.getprototypeof": "^1.0.4", + "set-function-name": "^2.0.1" + } + }, "node_modules/java-properties": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/java-properties/-/java-properties-1.0.2.tgz", @@ -10312,8 +10634,7 @@ "node_modules/js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", - "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", - "devOptional": true + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==" }, "node_modules/js-yaml": { "version": "4.1.0", @@ -10426,6 +10747,20 @@ "node": "*" } }, + "node_modules/jsx-ast-utils": { + "version": "3.3.5", + "resolved": "https://registry.npmjs.org/jsx-ast-utils/-/jsx-ast-utils-3.3.5.tgz", + "integrity": "sha512-ZZow9HBI5O6EPgSJLUb8n2NKgmVWTwCvHGwFuJlMjvLFqlGG6pjirPhtdsseaLZjSibD8eegzmYpUZwoIlj2cQ==", + "dependencies": { + "array-includes": "^3.1.6", + "array.prototype.flat": "^1.3.1", + "object.assign": "^4.1.4", + "object.values": "^1.1.6" + }, + "engines": { + "node": ">=4.0" + } + }, "node_modules/keyv": { "version": "4.5.4", "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", @@ -10452,6 +10787,22 @@ "node": ">=6" } }, + "node_modules/language-subtag-registry": { + "version": "0.3.22", + "resolved": "https://registry.npmjs.org/language-subtag-registry/-/language-subtag-registry-0.3.22.tgz", + "integrity": "sha512-tN0MCzyWnoz/4nHS6uxdlFWoUZT7ABptwKPQ52Ea7URk6vll88bWBVhodtnlfEuCcKWNGoc+uGbw1cwa9IKh/w==" + }, + "node_modules/language-tags": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/language-tags/-/language-tags-1.0.9.tgz", + "integrity": "sha512-MbjN408fEndfiQXbFQ1vnd+1NoLDsnQW41410oQBXiyXDMYH5z505juWa4KUE1LqxRC7DgOgZDbKLxHIwm27hA==", + "dependencies": { + "language-subtag-registry": "^0.3.20" + }, + "engines": { + "node": ">=0.10" + } + }, "node_modules/leven": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/leven/-/leven-3.1.0.tgz", @@ -10631,6 +10982,17 @@ "integrity": "sha512-sReKOYJIJf74dhJONhU4e0/shzi1trVbSWDOhKYE5XV2O+H7Sb2Dihwuc7xWxVl+DgFPyTqIN3zMfT9cq5iWDg==", "dev": true }, + "node_modules/loose-envify": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", + "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", + "dependencies": { + "js-tokens": "^3.0.0 || ^4.0.0" + }, + "bin": { + "loose-envify": "cli.js" + } + }, "node_modules/lru-cache": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", @@ -13805,6 +14167,14 @@ "inBundle": true, "license": "ISC" }, + "node_modules/object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/object-inspect": { "version": "1.13.1", "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.1.tgz", @@ -13838,6 +14208,19 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/object.entries": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/object.entries/-/object.entries-1.1.7.tgz", + "integrity": "sha512-jCBs/0plmPsOnrKAfFQXRG2NFjlhZgjjcBLSmTnEhU8U6vVTsVe8ANeQJCHTl3gSsI4J+0emOoCgoKlmQPMgmA==", + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/object.fromentries": { "version": "2.0.7", "resolved": "https://registry.npmjs.org/object.fromentries/-/object.fromentries-2.0.7.tgz", @@ -13865,6 +14248,18 @@ "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==", + "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", @@ -14355,6 +14750,21 @@ "node": ">= 6" } }, + "node_modules/prop-types": { + "version": "15.8.1", + "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.8.1.tgz", + "integrity": "sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg==", + "dependencies": { + "loose-envify": "^1.4.0", + "object-assign": "^4.1.1", + "react-is": "^16.13.1" + } + }, + "node_modules/prop-types/node_modules/react-is": { + "version": "16.13.1", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", + "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==" + }, "node_modules/proto-list": { "version": "1.2.4", "resolved": "https://registry.npmjs.org/proto-list/-/proto-list-1.2.4.tgz", @@ -14615,6 +15025,25 @@ "esprima": "~4.0.0" } }, + "node_modules/reflect.getprototypeof": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/reflect.getprototypeof/-/reflect.getprototypeof-1.0.4.tgz", + "integrity": "sha512-ECkTw8TmJwW60lOTR+ZkODISW6RQ8+2CL3COqtiJKLd6MmB45hN51HprHFziKLGkAuTGQhBb91V8cy+KHlaCjw==", + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1", + "get-intrinsic": "^1.2.1", + "globalthis": "^1.0.3", + "which-builtin-type": "^1.1.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/regenerate": { "version": "1.4.2", "resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.4.2.tgz", @@ -14636,8 +15065,7 @@ "node_modules/regenerator-runtime": { "version": "0.14.1", "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz", - "integrity": "sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw==", - "dev": true + "integrity": "sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw==" }, "node_modules/regenerator-transform": { "version": "0.15.2", @@ -15562,6 +15990,25 @@ "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" }, + "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==", + "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.trim": { "version": "1.2.8", "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.8.tgz", @@ -16379,6 +16826,45 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/which-builtin-type": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/which-builtin-type/-/which-builtin-type-1.1.3.tgz", + "integrity": "sha512-YmjsSMDBYsM1CaFiayOVT06+KJeXf0o5M/CAd4o1lTadFAtacTUM49zoYxr/oroopFDfhvN6iEcBxUyc3gvKmw==", + "dependencies": { + "function.prototype.name": "^1.1.5", + "has-tostringtag": "^1.0.0", + "is-async-function": "^2.0.0", + "is-date-object": "^1.0.5", + "is-finalizationregistry": "^1.0.2", + "is-generator-function": "^1.0.10", + "is-regex": "^1.1.4", + "is-weakref": "^1.0.2", + "isarray": "^2.0.5", + "which-boxed-primitive": "^1.0.2", + "which-collection": "^1.0.1", + "which-typed-array": "^1.1.9" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/which-collection": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/which-collection/-/which-collection-1.0.1.tgz", + "integrity": "sha512-W8xeTUwaln8i3K/cY1nGXzdnVZlidBcagyNFtBdD5kxnb4TvGKR7FfSIS3mYpwWS1QUCutfKz8IY8RjftB0+1A==", + "dependencies": { + "is-map": "^2.0.1", + "is-set": "^2.0.1", + "is-weakmap": "^2.0.1", + "is-weakset": "^2.0.1" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/which-typed-array": { "version": "1.1.14", "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.14.tgz", diff --git a/package.json b/package.json index eb223e9..07aae23 100644 --- a/package.json +++ b/package.json @@ -52,8 +52,12 @@ "eslint-plugin-etc": "^2.0.3", "eslint-plugin-import": "^2.28.1", "eslint-plugin-jest": "^27.4.0", + "eslint-plugin-jsx-a11y": "^6.8.0", "eslint-plugin-prettier": "^5.0.0", "eslint-plugin-promise": "^6.1.1", + "eslint-plugin-react": "^7.33.2", + "eslint-plugin-react-hooks": "^4.6.0", + "eslint-plugin-react-refresh": "^0.4.5", "eslint-plugin-tsdoc": "^0.2.17", "eslint-plugin-workspaces": "^0.9.0" }, diff --git a/specs/__snapshots__/index.snapshot.test.ts.snap b/specs/__snapshots__/index.snapshot.test.ts.snap index de1abec..18be546 100644 --- a/specs/__snapshots__/index.snapshot.test.ts.snap +++ b/specs/__snapshots__/index.snapshot.test.ts.snap @@ -14,9 +14,9 @@ exports[`eslint config configuration remains as expected 1`] = ` "plugin:etc/recommended", ], "ignorePatterns": [ - "dist", - "node_modules", - "tmp", + "**/dist/**", + "**/node_modules/*", + "**/tmp/**", ], "overrides": [ { @@ -38,7 +38,6 @@ exports[`eslint config configuration remains as expected 1`] = ` "max": 3, }, ], - "jest/no-conditional-in-test": "error", "jest/no-confusing-set-timeout": "warn", "jest/no-duplicate-hooks": "error", "jest/no-large-snapshots": "warn", @@ -67,7 +66,7 @@ exports[`eslint config configuration remains as expected 1`] = ` }, { "extends": [ - "plugin:@typescript-eslint/recommended", + "plugin:@typescript-eslint/recommended-type-checked", ], "files": [ "**/*.ts*", @@ -106,7 +105,7 @@ exports[`eslint config configuration remains as expected 1`] = ` ], "@typescript-eslint/default-param-last": "error", "@typescript-eslint/dot-notation": "error", - "@typescript-eslint/explicit-function-return-type": "warn", + "@typescript-eslint/explicit-function-return-type": "error", "@typescript-eslint/explicit-member-accessibility": "warn", "@typescript-eslint/explicit-module-boundary-types": "warn", "@typescript-eslint/init-declarations": "warn", @@ -126,7 +125,7 @@ exports[`eslint config configuration remains as expected 1`] = ` "@typescript-eslint/no-non-null-assertion": "error", "@typescript-eslint/no-throw-literal": "error", "@typescript-eslint/no-unnecessary-boolean-literal-compare": "error", - "@typescript-eslint/no-unnecessary-condition": "error", + "@typescript-eslint/no-unnecessary-condition": "warn", "@typescript-eslint/no-unnecessary-qualifier": "error", "@typescript-eslint/no-unnecessary-type-arguments": "warn", "@typescript-eslint/no-unsafe-unary-minus": "error", @@ -143,7 +142,6 @@ exports[`eslint config configuration remains as expected 1`] = ` "@typescript-eslint/prefer-optional-chain": "warn", "@typescript-eslint/prefer-promise-reject-errors": "error", "@typescript-eslint/prefer-readonly": "warn", - "@typescript-eslint/prefer-readonly-parameter-types": "warn", "@typescript-eslint/prefer-reduce-type-parameter": "error", "@typescript-eslint/prefer-string-starts-ends-with": "warn", "@typescript-eslint/promise-function-async": "error", @@ -209,7 +207,6 @@ exports[`eslint config configuration remains as expected 1`] = ` "react/iframe-missing-sandbox": "warn", "react/jsx-boolean-value": "warn", "react/jsx-child-element-spacing": "warn", - "react/jsx-closing-bracket-location": "warn", "react/jsx-closing-tag-location": "warn", "react/jsx-curly-spacing": "warn", "react/jsx-equals-spacing": "warn", @@ -225,35 +222,15 @@ exports[`eslint config configuration remains as expected 1`] = ` "react/jsx-first-prop-new-line": "warn", "react/jsx-fragments": "warn", "react/jsx-handler-names": "warn", - "react/jsx-indent": [ - "warn", - 2, - { - "checkAttributes": true, - "indentLogicalExpressions": true, - }, - ], - "react/jsx-indent-props": "warn", "react/jsx-max-depth": [ "warn", { "max": 4, }, ], - "react/jsx-max-props-per-line": [ - "warn", - { - "maximum": { - "multi": 1, - "single": 3, - }, - }, - ], - "react/jsx-newline": "warn", "react/jsx-no-constructed-context-values": "error", "react/jsx-no-leaked-render": "warn", "react/jsx-no-useless-fragment": "error", - "react/jsx-one-expression-per-line": "warn", "react/jsx-pascal-case": "warn", "react/jsx-props-no-multi-spaces": "warn", "react/jsx-sort-props": [ @@ -281,15 +258,20 @@ exports[`eslint config configuration remains as expected 1`] = ` "react/no-typos": "error", "react/no-unstable-nested-components": "error", "react/prefer-read-only-props": "error", + "react/prop-types": "off", "react/self-closing-comp": "warn", - "react/style-prop-object": "error", "react/void-dom-elements-no-children": "error", }, + "settings": { + "react": { + "version": "detect", + }, + }, }, ], "parserOptions": { - "ecmaVersion": "latest", - "project": "/Users/alopes/Desktop/dev-abel/eslint-config-tsr-pro/tsconfig.json", + "ecmaVersion": 2015, + "project": true, "sourceType": "module", }, "plugins": [ @@ -307,9 +289,8 @@ exports[`eslint config configuration remains as expected 1`] = ` "class-methods-use-this": "warn", "complexity": [ "warn", - 3, + 10, ], - "consistent-return": "warn", "consistent-this": "warn", "curly": [ "error", @@ -322,22 +303,27 @@ exports[`eslint config configuration remains as expected 1`] = ` "dot-notation": "error", "eqeqeq": "error", "eslint-comments/no-unused-disable": "warn", - "eslint-comments/require-description": "warn", + "eslint-comments/require-description": [ + "warn", + { + "ignore": [ + "eslint-enable", + ], + }, + ], "etc/no-commented-out-code": "warn", "etc/no-const-enum": "warn", "etc/no-enum": "warn", - "etc/no-misused-generics": "error", - "etc/prefer-interface": "warn", - "etc/prefer-less-than": "warn", "etc/throw-error": "error", "etc/underscore-internal": "warn", "grouped-accessor-pairs": "error", - "import/consistent-type-specifier-style": "warn", + "import/consistent-type-specifier-style": [ + "warn", + "prefer-inline", + ], "import/export": "warn", "import/exports-last": "warn", - "import/extensions": "error", "import/first": "error", - "import/group-exports": "warn", "import/named": "warn", "import/newline-after-import": "warn", "import/no-absolute-path": "error", @@ -346,7 +332,6 @@ exports[`eslint config configuration remains as expected 1`] = ` "import/no-duplicates": "warn", "import/no-empty-named-blocks": "error", "import/no-extraneous-dependencies": "error", - "import/no-internal-modules": "warn", "import/no-mutable-exports": "warn", "import/no-named-as-default": "warn", "import/no-named-as-default-member": "warn", @@ -382,7 +367,10 @@ exports[`eslint config configuration remains as expected 1`] = ` "warn", 200, ], - "max-lines-per-function": "warn", + "max-lines-per-function": [ + "warn", + 150, + ], "max-nested-callbacks": [ "warn", 5, @@ -488,7 +476,6 @@ exports[`eslint config configuration remains as expected 1`] = ` "as-needed", ], "require-atomic-updates": "error", - "require-await": "error", "require-unicode-regexp": "warn", "sort-imports": [ "warn", @@ -500,7 +487,6 @@ exports[`eslint config configuration remains as expected 1`] = ` ], "symbol-description": "error", "vars-on-top": "error", - "workspaces/no-cross-imports": "error", "yoda": "warn", }, } diff --git a/specs/index.unit.test.ts b/specs/index.unit.test.ts index dbc70e9..4a4d212 100644 --- a/specs/index.unit.test.ts +++ b/specs/index.unit.test.ts @@ -36,6 +36,19 @@ describe("eslint config", () => { filePath: "./index.ts", }); - expect(res.map((i) => i.usedDeprecatedRules).length).toBeLessThanOrEqual(5); + const deprecatedRules = res.flatMap((i) => i.usedDeprecatedRules); + + // eslint-disable-next-line no-console -- send information of deprecated rules to the console + console.error( + "Deprecated rules:", + deprecatedRules + .map( + ({ ruleId, replacedBy }) => + `\n - ${ruleId}${replacedBy.length ? ` (replaced by ${replacedBy.join("; ")})` : ""}`, + ) + .join(""), + ); + + expect(deprecatedRules.length).toBeLessThanOrEqual(5); }); }); diff --git a/src/config-base.ts b/src/config-base.ts index f2f57f9..c074b0e 100644 --- a/src/config-base.ts +++ b/src/config-base.ts @@ -1,5 +1,6 @@ -import type { Linter } from "eslint"; -import path from "path"; +/* eslint-disable etc/no-commented-out-code -- TODO: to confirm ETC plugin rules */ + +import { type Linter } from "eslint"; export const configBase = { env: { @@ -8,8 +9,8 @@ export const configBase = { node: true, }, parserOptions: { - project: path.resolve(process.cwd(), "./tsconfig.json"), - ecmaVersion: "latest", + project: true, + ecmaVersion: 2015, sourceType: "module", }, plugins: ["prettier", "import", "eslint-comments"], @@ -38,8 +39,7 @@ export const configBase = { "arrow-body-style": ["error", "as-needed"], "block-scoped-var": "error", "class-methods-use-this": "warn", - "complexity": ["warn", 3], - "consistent-return": "warn", + "complexity": ["warn", 10], "consistent-this": "warn", "curly": ["error", "multi-or-nest", "consistent"], "default-case": "warn", @@ -52,7 +52,7 @@ export const configBase = { "max-classes-per-file": "error", "max-depth": ["warn", 4], "max-lines": ["warn", 200], - "max-lines-per-function": "warn", + "max-lines-per-function": ["warn", 150], "max-nested-callbacks": ["warn", 5], "max-params": "error", "new-cap": "warn", @@ -113,7 +113,7 @@ export const configBase = { "prefer-spread": "warn", "prefer-template": "warn", "radix": ["error", "as-needed"], - "require-await": "error", + // "require-await": "error", // FIXME: require await or return promise "require-unicode-regexp": "warn", "sort-imports": [ "warn", @@ -126,8 +126,6 @@ export const configBase = { "line-comment-position": ["warn", { position: "above" }], // Prettier "prettier/prettier": "warn", - // Workspaces - "workspaces/no-cross-imports": "error", // Import "import/export": "warn", "import/no-deprecated": "error", @@ -140,29 +138,30 @@ export const configBase = { "import/named": "warn", "import/no-absolute-path": "error", "import/no-cycle": "error", - "import/no-internal-modules": "warn", "import/no-relative-packages": "error", "import/no-relative-parent-imports": "warn", "import/no-self-import": "error", "import/no-useless-path-segments": "error", "import/no-webpack-loader-syntax": "warn", - "import/consistent-type-specifier-style": "warn", + "import/consistent-type-specifier-style": ["warn", "prefer-inline"], "import/exports-last": "warn", - "import/extensions": "error", "import/first": "error", - "import/group-exports": "warn", "import/newline-after-import": "warn", "import/no-duplicates": "warn", // Comments "eslint-comments/no-unused-disable": "warn", - "eslint-comments/require-description": "warn", + "eslint-comments/require-description": ["warn", { ignore: ["eslint-enable"] }], // Etc "etc/no-commented-out-code": "warn", "etc/no-const-enum": "warn", "etc/no-enum": "warn", - "etc/no-misused-generics": "error", - "etc/prefer-interface": "warn", - "etc/prefer-less-than": "warn", + // "etc/no-misused-generics": "error", // FIXME: https://github.com/cartant/eslint-plugin-etc/issues/64 + // "etc/prefer-interface": [ // FIXME: allow functions to be type alias + // "warn", + // { + // allowLocal: true, + // }, + // ], "etc/throw-error": "error", "etc/underscore-internal": "warn", // Stylistic / TODO: check deprecated @@ -196,3 +195,5 @@ export const configBase = { ], }, } satisfies Linter.Config; + +/* eslint-enable */ diff --git a/src/config-react.ts b/src/config-react.ts index c1ecb3c..7cfd178 100644 --- a/src/config-react.ts +++ b/src/config-react.ts @@ -1,7 +1,12 @@ -import type { Linter } from "eslint"; +import { type Linter } from "eslint"; export const configReact = { files: ["**/*.{tsx,jsx}"], + settings: { + react: { + version: "detect", + }, + }, parserOptions: { ecmaFeatures: { jsx: true, @@ -21,30 +26,17 @@ export const configReact = { "react/iframe-missing-sandbox": "warn", "react/jsx-boolean-value": "warn", "react/jsx-child-element-spacing": "warn", - "react/jsx-closing-bracket-location": "warn", "react/jsx-closing-tag-location": "warn", "react/jsx-curly-spacing": "warn", "react/jsx-equals-spacing": "warn", "react/jsx-filename-extension": ["warn", { extensions: [".jsx", ".tsx"] }], "react/jsx-first-prop-new-line": "warn", "react/jsx-handler-names": "warn", - "react/jsx-indent": [ - "warn", - 2, - { - checkAttributes: true, - indentLogicalExpressions: true, - }, - ], "react/jsx-fragments": "warn", - "react/jsx-indent-props": "warn", "react/jsx-max-depth": ["warn", { max: 4 }], - "react/jsx-max-props-per-line": ["warn", { maximum: { single: 3, multi: 1 } }], - "react/jsx-newline": "warn", "react/jsx-no-constructed-context-values": "error", "react/jsx-no-leaked-render": "warn", "react/jsx-no-useless-fragment": "error", - "react/jsx-one-expression-per-line": "warn", "react/jsx-pascal-case": "warn", "react/jsx-props-no-multi-spaces": "warn", "react/jsx-sort-props": [ @@ -72,8 +64,8 @@ export const configReact = { "react/no-typos": "error", "react/no-unstable-nested-components": "error", "react/prefer-read-only-props": "error", + "react/prop-types": "off", "react/self-closing-comp": "warn", - "react/style-prop-object": "error", "react/void-dom-elements-no-children": "error", // React Refresh "react-refresh/only-export-components": "warn", diff --git a/src/config-testing.ts b/src/config-testing.ts index 9bb8c77..c2b75be 100644 --- a/src/config-testing.ts +++ b/src/config-testing.ts @@ -1,4 +1,4 @@ -import type { Linter } from "eslint"; +import { type Linter } from "eslint"; export const configTesting = { files: ["**/*.{test,spec}.*"], @@ -8,7 +8,6 @@ export const configTesting = { "jest/consistent-test-it": "error", "jest/max-expects": "error", "jest/max-nested-describe": ["error", { max: 3 }], - "jest/no-conditional-in-test": "error", "jest/no-confusing-set-timeout": "warn", "jest/no-duplicate-hooks": "error", "jest/no-large-snapshots": "warn", diff --git a/src/config-typescript.ts b/src/config-typescript.ts index 29d8d87..13d42a6 100644 --- a/src/config-typescript.ts +++ b/src/config-typescript.ts @@ -1,11 +1,11 @@ -import type { Linter } from "eslint"; +import { type Linter } from "eslint"; import { configBase } from "./config-base"; export const configTypescript = { files: ["**/*.ts*"], parser: "@typescript-eslint/parser", plugins: ["@typescript-eslint", "eslint-plugin-tsdoc"], - extends: ["plugin:@typescript-eslint/recommended"], + extends: ["plugin:@typescript-eslint/recommended-type-checked"], rules: { // TSDOC "tsdoc/syntax": "warn", @@ -28,7 +28,7 @@ export const configTypescript = { "@typescript-eslint/default-param-last": configBase.rules["default-param-last"], "dot-notation": "off", "@typescript-eslint/dot-notation": configBase.rules["dot-notation"], - "@typescript-eslint/explicit-function-return-type": "warn", + "@typescript-eslint/explicit-function-return-type": "error", "@typescript-eslint/explicit-member-accessibility": "warn", "@typescript-eslint/explicit-module-boundary-types": "warn", "init-declarations": "off", @@ -53,7 +53,7 @@ export const configTypescript = { "no-throw-literal": "off", "@typescript-eslint/no-throw-literal": configBase.rules["no-throw-literal"], "@typescript-eslint/no-unnecessary-boolean-literal-compare": "error", - "@typescript-eslint/no-unnecessary-condition": "error", + "@typescript-eslint/no-unnecessary-condition": "warn", "@typescript-eslint/no-unnecessary-qualifier": "error", "@typescript-eslint/no-unnecessary-type-arguments": "warn", "@typescript-eslint/no-unsafe-unary-minus": "error", diff --git a/src/index.ts b/src/index.ts index 70f9550..64422db 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,4 +1,4 @@ -import type { Linter } from "eslint"; +import { type Linter } from "eslint"; import { configBase } from "./config-base"; import { configTesting } from "./config-testing"; import { configTypescript } from "./config-typescript"; @@ -33,7 +33,7 @@ import { configReact } from "./config-react"; const config: Linter.Config = { ...configBase, overrides: [configTesting, configTypescript, configReact], - ignorePatterns: ["dist", "node_modules", "tmp"], + ignorePatterns: ["**/dist/**", "**/node_modules/*", "**/tmp/**"], }; module.exports = config;