Skip to content

Commit

Permalink
Merge pull request #60 from samuliasmala/antti/update-packages
Browse files Browse the repository at this point in the history
Valmis, mergetään!
  • Loading branch information
anttiasmala authored Feb 28, 2025
2 parents aa2a283 + 1561e4f commit 3243c34
Show file tree
Hide file tree
Showing 9 changed files with 1,426 additions and 1,556 deletions.
75 changes: 0 additions & 75 deletions .eslintrc.json

This file was deleted.

7 changes: 1 addition & 6 deletions .github/workflows/pull-request-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,4 @@ jobs:
run: npm ci

- name: Run linters
uses: wearerequired/lint-action@v2
with:
eslint: true
eslint_extensions: js,ts,tsx
tsc: true
tsc_args: '--noemit'
run: npm run lint
27 changes: 20 additions & 7 deletions INFO.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,24 @@
package.json

PACKAGES NOT UPDATED, NOT WORKING AT THE MOMENT 19.09.2024

Minor Backwards-compatible features
❯ ◯ typescript 5.4.5 → 5.6.2
Seuraavia paketteja ei ole päivitetty

Major Potentially breaking API changes
@types/node 20.12.4 → 22.5.5
@typescript-eslint/eslint-plugin 7.5.0 → 8.6.0
◯ eslint 8.57.0 → 9.10.0
❯ ◯ @prisma/client 5.20.0 → 6.2.1
@types/node 20.12.4 → 22.10.6
◯ prisma 5.20.0 → 6.2.1

`@prisma/client`iä ja `prisma`a ei ole päivitetty, koska `lucia-auth`in peer-dependency ei tue vielä Prisma v6:sta. Kyseisestä asiasta on tehty PR https://github.com/lucia-auth/lucia/pull/1760 jos tuota ei ole korjattu helmikuuhun mennessä, korjataan itse tai keksitään jokin muu ratkaisu

`@types/node`a ei ole päivitetty, koska pitänee seurata package.json:in node-versiota

#########################################################################

**Testaa näitä päivittämisen yhteydessä**

- [] poista oma testaustietokanta ja lisää tietokanta uudelleen `npm run prisma db push`

- [] kokeile ESLint ettei heitä virheitä

- [] testaa sivu että normaalikäyttö toimii (rekistöröinti, kirjautuminen, lahjan (lisääminen, poistaminen, muokkaaminen), palaute)

- [] API-endpointtien testaaminen
2 changes: 1 addition & 1 deletion TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

# Jokin sivu (esimerkiksi asetuksiin), joka näyttää kaikki aktiiviset (miksei epäaktiiviset) Sessionit. Myöskin Sessionin poistomahdollisuus voitaisiin lisätä

# Enter-näppäimellä EditModalin ja DeleteModalin hyväksyminen
# Enter-näppäimellä EditModalin (DONE) ja DeleteModalin hyväksyminen

# Kun lisää uuden lahjan / kun lahjoja haetaan, järjestetään ne uusin -> vanhin. Myöhemmin voidaan lisätä käyttäjälle mahdollisuus valita miten lahjat haluaa järjestää (vaikka vanhin -> uusin, aakkosjärjestys, ymsyms)

Expand Down
2 changes: 2 additions & 0 deletions api.rest
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ Content-Type: application/json


# GIFT REQUESTS
###

@giftUUID = cba86307-8f50-4038-bc79-c05cef4fafc1

Expand Down Expand Up @@ -72,6 +73,7 @@ DELETE {{baseUrl}}/gifts/{{giftUUID}}

# USER REQUESTS

###
@userUUID = 26ab195c-5f56-4831-bedd-07725e8012ff

###
Expand Down
105 changes: 105 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
import { fixupConfigRules } from '@eslint/compat';
import path from 'node:path';
import { fileURLToPath } from 'node:url';
import { FlatCompat } from '@eslint/eslintrc';
import { configs as tsConfigs } from 'typescript-eslint';

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const compat = new FlatCompat({
baseDirectory: __dirname,
recommendedConfig: tsConfigs.recommendedTypeChecked,
allConfig: tsConfigs.all,
});

const eslintConfig = [
...fixupConfigRules([
...compat.config({
root: true,
extends: [
'plugin:n/recommended',
'plugin:import/recommended',
'next/core-web-vitals',
'plugin:prettier/recommended',
],

// espree (default parser) set here to prevent following error: Cannot serialize key "parse" in parser: Function values are not supported.
parser: 'espree',
// parserOptions added so import.meta.url can be used. Reference: https://github.com/eslint/eslint/discussions/16037#discussioncomment-2998062
parserOptions: {
sourceType: 'module',
ecmaVersion: 'latest',
},

rules: {
// No React component definitions allowed inside components
'react/no-unstable-nested-components': 'warn',

// Additional import rules
'import/no-dynamic-require': 'error',
'import/no-absolute-path': 'error',
'import/no-useless-path-segments': 'warn',
'import/newline-after-import': 'warn',

// Use warn instead of error for prettier issues and some other rules
'prettier/prettier': 'warn',
'prefer-const': 'warn',
'no-unused-vars': 'warn',
'no-debugger': 'warn',
'no-console': 'off',
},

overrides: [
{
files: ['**/*.ts?(x)'],
parser: '@typescript-eslint/parser',
parserOptions: {
project: './tsconfig.json',
sourceType: 'module',
ecmaFeatures: {
jsx: true,
},
},
plugins: ['@tanstack/query'],
extends: [
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/recommended-requiring-type-checking',
'plugin:import/typescript',
'plugin:@tanstack/eslint-plugin-query/recommended',
],

rules: {
// 'tsc' already handles this (https://github.com/typescript-eslint/typescript-eslint/issues/291)
'no-dupe-class-members': 'off',
// 'tsc' already handles this (https://github.com/typescript-eslint/typescript-eslint/issues/477)
'no-undef': 'off',

// Handled by import/typescript
// n/no-missing-import is used here instead of node/no-missing-import because seems like eslint-plugin-node is not updated frequently
// node/no-missing-import: https://github.com/mysticatea/eslint-plugin-node | n/no-missing-import: https://github.com/eslint-community/eslint-plugin-n
'n/no-missing-import': 'off',

// Disable some rules which are difficult for beginners
'@typescript-eslint/no-unsafe-assignment': 'warn',
'@typescript-eslint/no-unsafe-member-access': 'warn',
'@typescript-eslint/no-unsafe-argument': 'warn',
'@typescript-eslint/no-explicit-any': 'warn',
'@typescript-eslint/no-unsafe-return': 'warn',
'@typescript-eslint/no-unsafe-call': 'warn',

// Use warn instead of error for some rules
'prefer-const': 'warn',
'@typescript-eslint/restrict-plus-operands': 'warn',
'@typescript-eslint/no-unused-vars': 'warn',
'@typescript-eslint/require-await': 'warn',
},
},
],
}),
{
// .next folder added to ignores. This is otherwise being ESLinted
ignores: ['**/.next/'],
},
]),
];
export default eslintConfig;
Loading

0 comments on commit 3243c34

Please sign in to comment.