From 6a2c3361cd3f55537d6598eb48968d03d10b8536 Mon Sep 17 00:00:00 2001 From: Kevin Ross Date: Sat, 6 Jul 2024 12:50:38 -0500 Subject: [PATCH 1/3] ncu --- package.json | 4 ++-- yarn.lock | 14 +++++++------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/package.json b/package.json index c428350..d2bca66 100644 --- a/package.json +++ b/package.json @@ -58,7 +58,7 @@ "eslint-plugin-markdown": "^5.0.0", "eslint-plugin-n": "^17.9.0", "eslint-plugin-prettier": "^5.1.3", - "eslint-plugin-react-hooks": "^5.1.0-rc-3da26163a3-20240704", + "eslint-plugin-react-hooks": "^5.1.0-rc-f38c22b244-20240704", "eslint-plugin-simple-import-sort": "^12.1.1", "eslint-plugin-storybook": "0.9.0--canary.156.26b630a.0", "eslint-plugin-unicorn": "^54.0.0", @@ -77,7 +77,7 @@ "husky": "^9.0.11", "lint-staged": "^15.2.7", "prettier": "^3.3.2", - "rimraf": "^5.0.7", + "rimraf": "^5.0.8", "typescript": "^5.5.3" }, "peerDependencies": { diff --git a/yarn.lock b/yarn.lock index 8c4e25a..1569d86 100644 --- a/yarn.lock +++ b/yarn.lock @@ -29,7 +29,7 @@ __metadata: eslint-plugin-markdown: "npm:^5.0.0" eslint-plugin-n: "npm:^17.9.0" eslint-plugin-prettier: "npm:^5.1.3" - eslint-plugin-react-hooks: "npm:^5.1.0-rc-3da26163a3-20240704" + eslint-plugin-react-hooks: "npm:^5.1.0-rc-f38c22b244-20240704" eslint-plugin-simple-import-sort: "npm:^12.1.1" eslint-plugin-storybook: "npm:0.9.0--canary.156.26b630a.0" eslint-plugin-unicorn: "npm:^54.0.0" @@ -39,7 +39,7 @@ __metadata: husky: "npm:^9.0.11" lint-staged: "npm:^15.2.7" prettier: "npm:^3.3.2" - rimraf: "npm:^5.0.7" + rimraf: "npm:^5.0.8" typescript: "npm:^5.5.3" typescript-eslint: "npm:^7.15.0" peerDependencies: @@ -2153,7 +2153,7 @@ __metadata: languageName: node linkType: hard -"eslint-plugin-react-hooks@npm:^5.1.0-rc-3da26163a3-20240704": +"eslint-plugin-react-hooks@npm:^5.1.0-rc-f38c22b244-20240704": version: 5.1.0-rc-fb9a90fa48-20240614 resolution: "eslint-plugin-react-hooks@npm:5.1.0-rc-fb9a90fa48-20240614" peerDependencies: @@ -4586,14 +4586,14 @@ __metadata: languageName: node linkType: hard -"rimraf@npm:^5.0.7": - version: 5.0.7 - resolution: "rimraf@npm:5.0.7" +"rimraf@npm:^5.0.8": + version: 5.0.8 + resolution: "rimraf@npm:5.0.8" dependencies: glob: "npm:^10.3.7" bin: rimraf: dist/esm/bin.mjs - checksum: 10/1e3cecfe59ee2383dfd9ba5373caeed48ed941318a0360119419b7dffc63115661408b9427f67e1f66b5bbb8855a3953db09e55a7362b3df904a44453dfa22fb + checksum: 10/ab8f1bcb49762d16120813a127f90773da657bb5c6f29d3865c1b3c1ceb0d2291cd3e7b439adb7571024be47dce8443b3ffd1b116ec78b6122fca0571da87a79 languageName: node linkType: hard From 99018a3acafb5742a8182ad3fed853713eb4882e Mon Sep 17 00:00:00 2001 From: Kevin Ross Date: Sat, 6 Jul 2024 12:51:09 -0500 Subject: [PATCH 2/3] simplify import-x/resolver ts config --- src/configs/js.js | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/configs/js.js b/src/configs/js.js index 9d2f9d0..134759d 100644 --- a/src/configs/js.js +++ b/src/configs/js.js @@ -68,13 +68,15 @@ const configs = tseslint.config( '@typescript-eslint/parser': ALL_JS_FILES, }, 'import-x/resolver': { - typescript: { - alwaysTryTypes: true, - project: ['packages/*/tsconfig.json'], - }, - node: { - extensions: ALL_JS_FILES, - }, + typescript: true, + node: true, + // typescript: { + // alwaysTryTypes: true, + // project: ['packages/*/tsconfig.json'], + // }, + // node: { + // extensions: ALL_JS_FILES, + // }, }, }, plugins: { @@ -123,6 +125,7 @@ const configs = tseslint.config( }, ], '@typescript-eslint/member-ordering': 'error', + '@typescript-eslint/no-base-to-string': 'off', // annoying about stringifying objects '@typescript-eslint/no-empty-function': 'off', '@typescript-eslint/no-empty-interface': 'off', '@typescript-eslint/no-explicit-any': 'off', From f91c028cac408c13665e473f571979861aaf2a50 Mon Sep 17 00:00:00 2001 From: Kevin Ross Date: Sat, 6 Jul 2024 12:51:59 -0500 Subject: [PATCH 3/3] add react limits --- src/limits/index.js | 2 ++ src/limits/jsOnly.js | 2 +- src/limits/jsOnlyScripts.js | 2 +- src/limits/react.js | 22 ++++++++++++++++++++++ 4 files changed, 26 insertions(+), 2 deletions(-) create mode 100644 src/limits/react.js diff --git a/src/limits/index.js b/src/limits/index.js index f2213e9..ff597a1 100644 --- a/src/limits/index.js +++ b/src/limits/index.js @@ -1,8 +1,10 @@ import jsOnly from './jsOnly.js' import jsOnlyScripts from './jsOnlyScripts.js' +import react from './react.js' const ruleset = { jsOnly, jsOnlyScripts, + react, } export default ruleset diff --git a/src/limits/jsOnly.js b/src/limits/jsOnly.js index 2f97f2e..972fa22 100644 --- a/src/limits/jsOnly.js +++ b/src/limits/jsOnly.js @@ -10,7 +10,7 @@ import { JS_FILES } from '../constants.js' * View config with `npx @eslint/config-inspector` */ const configs = tseslint.config({ - name: 'alienfast-js-only', + name: 'alienfast-limits-js-only', files: JS_FILES, ...tseslint.configs.disableTypeChecked, // rules: { diff --git a/src/limits/jsOnlyScripts.js b/src/limits/jsOnlyScripts.js index af0407a..bce76b2 100644 --- a/src/limits/jsOnlyScripts.js +++ b/src/limits/jsOnlyScripts.js @@ -11,7 +11,7 @@ import jsOnly from './jsOnly.js' * View config with `npx @eslint/config-inspector` */ const configs = tseslint.config({ - name: 'alienfast-js-only-scripts', + name: 'alienfast-limits-js-only-scripts', extends: [...jsOnly], files: SCRIPTS, rules: { diff --git a/src/limits/react.js b/src/limits/react.js new file mode 100644 index 0000000..e52326c --- /dev/null +++ b/src/limits/react.js @@ -0,0 +1,22 @@ +import tseslint from 'typescript-eslint' + +import { JS_FILES } from '../constants.js' + +/** + * Turn off rules not necessary for js only files. + * + * Do not extend configs, it will alter files/ignores behavior. + * + * View config with `npx @eslint/config-inspector` + */ +const configs = tseslint.config({ + name: 'alienfast-limits-react', + files: JS_FILES, + rules: { + // this gets really messy in tsx and graphql when types are forced to any e.g. policies + '@typescript-eslint/no-unsafe-assignment': 'off', // 57% of the time + '@typescript-eslint/no-unsafe-member-access': 'off', + }, +}) + +export default configs