From a7c440cd1f34c288383718cbf6fe22314690703a Mon Sep 17 00:00:00 2001 From: Adam Laycock Date: Wed, 30 Oct 2024 19:44:37 +0000 Subject: [PATCH] chore: update deps, and apply new lint rules --- .eslintrc.cjs | 83 - app/entry.server.tsx | 7 +- app/lib/components/button.tsx | 1 - app/lib/components/input.tsx | 3 - app/lib/fields/relation.server.ts | 2 +- app/lib/fields/relation.tsx | 1 - app/lib/prisma.server.ts | 1 - app/routes/api.backup.tsx | 2 +- app/routes/app.$assetslug.$entry.delete.tsx | 2 +- app/routes/app.$assetslug.import.tsx | 4 +- app/routes/app._index.tsx | 2 - app/routes/app.acl-manager.$acl.tsx | 4 +- app/routes/app.passwords.$password._index.tsx | 8 +- app/routes/app.process.$process._index.tsx | 4 +- app/routes/app.system.tsx | 4 +- app/routes/app.tsx | 4 +- app/routes/app.user.tsx | 2 +- eslint.config.js | 280 +++ package-lock.json | 1554 ++++++++--------- package.json | 41 +- prisma/seed.js | 1 - tests/unit-utils.ts | 2 +- tests/unit/rbac.spec.ts | 4 +- tests/unit/utils.spec.ts | 14 +- worker/worker.mjs | 10 +- 25 files changed, 1049 insertions(+), 991 deletions(-) delete mode 100644 .eslintrc.cjs create mode 100644 eslint.config.js diff --git a/.eslintrc.cjs b/.eslintrc.cjs deleted file mode 100644 index c3128a8..0000000 --- a/.eslintrc.cjs +++ /dev/null @@ -1,83 +0,0 @@ -/** - * This is intended to be a basic starting point for linting in your app. - * It relies on recommended configs out of the box for simplicity, but you can - * and should modify this configuration to best suit your team's needs. - */ - -/** @type {import('eslint').Linter.Config} */ -module.exports = { - root: true, - parserOptions: { - ecmaVersion: "latest", - sourceType: "module", - ecmaFeatures: { - jsx: true, - }, - }, - env: { - browser: true, - commonjs: true, - es6: true, - }, - - // Base config - extends: ["eslint:recommended"], - - overrides: [ - // React - { - files: ["**/*.{js,jsx,ts,tsx}"], - plugins: ["react", "jsx-a11y"], - extends: [ - "plugin:react/recommended", - "plugin:react/jsx-runtime", - "plugin:react-hooks/recommended", - "plugin:jsx-a11y/recommended", - ], - settings: { - react: { - version: "detect", - }, - formComponents: ["Form"], - linkComponents: [ - { name: "Link", linkAttribute: "to" }, - { name: "NavLink", linkAttribute: "to" }, - ], - "import/resolver": { - typescript: {}, - }, - }, - }, - - // Typescript - { - files: ["**/*.{ts,tsx}"], - plugins: ["@typescript-eslint", "import"], - parser: "@typescript-eslint/parser", - settings: { - "import/internal-regex": "^~/", - "import/resolver": { - node: { - extensions: [".ts", ".tsx"], - }, - typescript: { - alwaysTryTypes: true, - }, - }, - }, - extends: [ - "plugin:@typescript-eslint/recommended", - "plugin:import/recommended", - "plugin:import/typescript", - ], - }, - - // Node - { - files: [".eslintrc.cjs"], - env: { - node: true, - }, - }, - ], -}; diff --git a/app/entry.server.tsx b/app/entry.server.tsx index 42d6e52..dd9b93f 100644 --- a/app/entry.server.tsx +++ b/app/entry.server.tsx @@ -6,8 +6,11 @@ import {PassThrough} from 'node:stream' -import type {AppLoadContext, EntryContext} from '@remix-run/node' -import {createReadableStreamFromReadable} from '@remix-run/node' +import { + type AppLoadContext, + type EntryContext, + createReadableStreamFromReadable +} from '@remix-run/node' import {RemixServer} from '@remix-run/react' import {isbot} from 'isbot' import {renderToPipeableStream} from 'react-dom/server' diff --git a/app/lib/components/button.tsx b/app/lib/components/button.tsx index b6dea64..620bef9 100644 --- a/app/lib/components/button.tsx +++ b/app/lib/components/button.tsx @@ -22,7 +22,6 @@ export const AButton = ( ) => { const className = `${ButtonClasses} inline-block ${props.className}` - // eslint-disable-next-line jsx-a11y/anchor-has-content return } diff --git a/app/lib/components/input.tsx b/app/lib/components/input.tsx index e8b568a..12cdd1c 100644 --- a/app/lib/components/input.tsx +++ b/app/lib/components/input.tsx @@ -1,5 +1,3 @@ -/* eslint-disable react/prop-types */ - import {omit} from '@arcath/utils' export const inputClasses = @@ -43,7 +41,6 @@ export const Label = ( ) => { const className = `mt-2 ${props.className}` - // eslint-disable-next-line jsx-a11y/label-has-associated-control return