From e58a71e5696e393c543236dfdce733fe5eca1537 Mon Sep 17 00:00:00 2001 From: Logan McAnsh Date: Wed, 14 Dec 2022 10:27:38 -0500 Subject: [PATCH 1/2] chore: have eslint report unused eslint comments Signed-off-by: Logan McAnsh --- .eslintignore | 2 +- .eslintrc.js | 4 ++++ package.json | 2 +- packages/remix-react/__tests__/hook-types-test.tsx | 2 +- packages/remix-server-runtime/rollup.config.js | 2 +- packages/remix/rollup.config.js | 1 - 6 files changed, 8 insertions(+), 5 deletions(-) diff --git a/.eslintignore b/.eslintignore index 559d94f603b..3188ea44744 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1,11 +1,11 @@ **/build/ **/tests/__snapshots/ **/node_modules/ -!.eslintrc.js .tmp /playground **/__tests__/fixtures **/__tests__/**/*/fixtures +/packages/*/dist/ # Deno integration/helpers/deno-template diff --git a/.eslintrc.js b/.eslintrc.js index 212b09c1f07..87de326cd14 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -24,4 +24,8 @@ module.exports = { }, }, ], + // Report unused `eslint-disable` comments. + reportUnusedDisableDirectives: true, + // Tell ESLint not to ignore dot-files, which are ignored by default. + ignorePatterns: ["!.*.js"], }; diff --git a/package.json b/package.json index 8bf4d567905..b3c1f3d7dd2 100644 --- a/package.json +++ b/package.json @@ -29,7 +29,7 @@ "format": "prettier --ignore-path .eslintignore --write ./ && npm run lint:fix", "format:deno": "deno fmt integration/helpers/deno-template packages/remix-deno templates/deno --ignore=packages/remix-deno/node_modules", "license": "node ./scripts/license.js", - "lint": "eslint --cache --ext .tsx,.ts,.js,.jsx,.md .", + "lint": "eslint --cache .", "lint:deno": "deno lint integration/helpers/deno-template packages/remix-deno templates/deno --ignore=packages/remix-deno/node_modules", "lint:fix": "yarn lint --fix", "playground:new": "node ./scripts/playground/new.js", diff --git a/packages/remix-react/__tests__/hook-types-test.tsx b/packages/remix-react/__tests__/hook-types-test.tsx index 720bc7ec876..b8effef00fb 100644 --- a/packages/remix-react/__tests__/hook-types-test.tsx +++ b/packages/remix-react/__tests__/hook-types-test.tsx @@ -7,7 +7,7 @@ function isEqual( ): void {} // not sure why `eslint` thinks the `T` generic is not used... -// eslint-disable-next-line @typescript-eslint/no-unused-vars + type LoaderData = ReturnType>; describe("useLoaderData", () => { diff --git a/packages/remix-server-runtime/rollup.config.js b/packages/remix-server-runtime/rollup.config.js index 256dfeab6ea..2ece3985507 100644 --- a/packages/remix-server-runtime/rollup.config.js +++ b/packages/remix-server-runtime/rollup.config.js @@ -1,4 +1,4 @@ -/* eslint-disable no-restricted-globals, import/no-nodejs-modules */ +/* eslint-disable import/no-nodejs-modules */ const path = require("path"); const babel = require("@rollup/plugin-babel").default; const nodeResolve = require("@rollup/plugin-node-resolve").default; diff --git a/packages/remix/rollup.config.js b/packages/remix/rollup.config.js index 0e7fc8f1222..1948486d0c3 100644 --- a/packages/remix/rollup.config.js +++ b/packages/remix/rollup.config.js @@ -1,4 +1,3 @@ -/* eslint-disable import/no-extraneous-dependencies */ const babel = require("@rollup/plugin-babel").default; const path = require("path"); From 73918cc542fd958aa0e0326db589f4c2aaf9ea53 Mon Sep 17 00:00:00 2001 From: Logan McAnsh Date: Wed, 14 Dec 2022 11:31:59 -0500 Subject: [PATCH 2/2] chore: remove additional comment --- packages/remix-react/__tests__/hook-types-test.tsx | 2 -- 1 file changed, 2 deletions(-) diff --git a/packages/remix-react/__tests__/hook-types-test.tsx b/packages/remix-react/__tests__/hook-types-test.tsx index b8effef00fb..9c2f6821370 100644 --- a/packages/remix-react/__tests__/hook-types-test.tsx +++ b/packages/remix-react/__tests__/hook-types-test.tsx @@ -6,8 +6,6 @@ function isEqual( arg: A extends B ? (B extends A ? true : false) : false ): void {} -// not sure why `eslint` thinks the `T` generic is not used... - type LoaderData = ReturnType>; describe("useLoaderData", () => {