Skip to content

Commit

Permalink
Updates
Browse files Browse the repository at this point in the history
  • Loading branch information
samwisekind committed Oct 28, 2024
1 parent c40d640 commit b328521
Show file tree
Hide file tree
Showing 10 changed files with 143 additions and 64 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ The following environment variables should be provided when running the server (
| `NODE_SMTP_USERNAME` | SMTP username for sending emails. |
| `NODE_SMTP_PASSWORD` | SMTP password for sending emails. |
| `NODE_SIGHTING_EMAIL` | Email address to send sightings to. |
| `LOGTAIL_SOURCE_TOKEN` | Token for Better Stack Logs. |

## Development

Expand Down
44 changes: 30 additions & 14 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -1,12 +1,31 @@
import globals from 'globals';
import pluginJs from '@eslint/js';
import tseslint from 'typescript-eslint';
import pluginJS from '@eslint/js';
import pluginTS from 'typescript-eslint';
import pluginReact from 'eslint-plugin-react';
import pluginReactHooks from 'eslint-plugin-react-hooks';
import pluginNext from '@next/eslint-plugin-next';
import pluginJest from 'eslint-plugin-jest';

const recommendedConfigs = [
pluginJs.configs.recommended,
...tseslint.configs.recommended,
pluginJS.configs.recommended,
...pluginTS.configs.recommended,
pluginReact.configs.flat.recommended,
pluginJest.configs['flat/recommended'],

// Custom config until packages support flat configs
{
files: ['src/**/*.{js,ts,jsx,tsx}'],
plugins: {
'react-hooks': pluginReactHooks,
'@next/next': pluginNext,
},
rules: {
'react/react-in-jsx-scope': 'off',
'react/prop-types': 'off',
...pluginReactHooks.configs.recommended.rules,
...pluginNext.configs.recommended.rules,
},
},
];

const customConfigs = [
Expand All @@ -15,8 +34,8 @@ const customConfigs = [
},
{
ignores: [
".next/",
"coverage/",
'.next/',
'coverage/',
],
},
{
Expand All @@ -27,14 +46,11 @@ const customConfigs = [
},
},
{
languageOptions: { globals: {...globals.browser, ...globals.node} },
},
{
rules: {
'@typescript-eslint/no-unsafe-function-type': 'off',
'@typescript-eslint/no-require-imports': 'off',
'react/prop-types': 'off',
'react/react-in-jsx-scope': 'off',
languageOptions: {
globals: {
...globals.browser,
...globals.node,
},
},
},
];
Expand Down
2 changes: 2 additions & 0 deletions jest.setup.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/* eslint-disable @typescript-eslint/no-require-imports */

process.env.NODE_CONTENTFUL_SPACE_ID = 'mocked-contentful-space-id';
process.env.NODE_CONTENTFUL_ENVIRONMENT = 'mocked-contentful-environment';
process.env.NODE_CONTENTFUL_DELIVERY_API_TOKEN = 'mocked-contentful-delivery-api-token';
Expand Down
10 changes: 4 additions & 6 deletions next.config.js → next.config.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
/** @type {import('next').NextConfig} */
import type { NextConfig } from 'next';

const { withLogtail } = require('@logtail/next');
import redirects from './redirects.json';

const redirects = require('./redirects.json');

const nextConfig = {
const nextConfig: NextConfig = {
reactStrictMode: true,
poweredByHeader: false,
experimental: {
Expand Down Expand Up @@ -50,4 +48,4 @@ const nextConfig = {
},
};

module.exports = withLogtail(nextConfig);
module.exports = nextConfig;
117 changes: 93 additions & 24 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,18 @@
"@contentful/live-preview": "^4.5.13",
"@contentful/rich-text-plain-text-renderer": "^16.2.10",
"@contentful/rich-text-react-renderer": "^15.22.11",
"@logtail/next": "^0.1.5",
"contentful": "^11.2.0",
"dayjs": "^1.11.13",
"joi": "^17.13.3",
"next": "^15.0.1",
"next-seo": "^6.6.0",
"nodemailer": "^6.9.15",
"react": "^18.3.1",
"react-markdown": "^9.0.1",
"sharp": "^0.33.5"
"react-markdown": "^9.0.1"
},
"devDependencies": {
"@eslint/js": "^9.13.0",
"@next/eslint-plugin-next": "^15.0.1",
"@testing-library/jest-dom": "^6.6.2",
"@testing-library/react": "^16.0.1",
"@types/jest": "^29.5.14",
Expand All @@ -38,7 +37,9 @@
"@types/react": "^18.3.12",
"babel-jest": "^29.7.0",
"eslint": "^9.13.0",
"eslint-plugin-jest": "^28.8.3",
"eslint-plugin-react": "^7.37.2",
"eslint-plugin-react-hooks": "^5.0.0",
"globals": "^15.11.0",
"identity-obj-proxy": "^3.0.0",
"jest": "^29.7.0",
Expand Down
4 changes: 2 additions & 2 deletions src/components/Filters/Filters.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import styles from './Filters.module.scss';

interface UseSearchProps {
callback: Function,
callback: Function, // eslint-disable-line @typescript-eslint/no-unsafe-function-type
label?: string,
defaultValue?: string,
}
Expand Down Expand Up @@ -29,7 +29,7 @@ interface DropdownProps {
text: string,
value: string,
}>,
callback: Function,
callback: Function, // eslint-disable-line @typescript-eslint/no-unsafe-function-type
}

const UseDropdown = ({
Expand Down
Loading

0 comments on commit b328521

Please sign in to comment.