Skip to content

Commit

Permalink
Merge pull request #57 from Opetushallitus/OK-673-henkilo-pistesyotto
Browse files Browse the repository at this point in the history
OK-673: Henkilö-näkymän pistesyöttö
  • Loading branch information
pretseli authored Dec 20, 2024
2 parents ab1b0a7 + 15c57ea commit 5cb8c61
Show file tree
Hide file tree
Showing 75 changed files with 3,421 additions and 1,906 deletions.
31 changes: 0 additions & 31 deletions .eslintrc.json

This file was deleted.

10 changes: 2 additions & 8 deletions .lintstagedrc.mjs
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
import path from 'path';

const eslintCommand = (filenames) =>
`next lint --fix --no-ignore --max-warnings=0 ${filenames
.map((f) => `--file ${path.relative(process.cwd(), f)}`)
.join(' ')}`;

const eslintCommand = 'eslint --fix --no-ignore --max-warnings=0';
const prettierCommand = 'prettier --write -u';

const config = {
'**/*.{js,mjs,cjs,jsx,ts,tsx}': [eslintCommand, prettierCommand],
'!**/*.{js,mjs,cjs,jsx,ts,tsx}': [prettierCommand],
'!**/*.{js,mjs,cjs,jsx,ts,tsx}': prettierCommand,
};

export default config;
3 changes: 2 additions & 1 deletion .npmrc
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
audit=false
fund=false
fund=false
legacy-peer-deps=true
51 changes: 51 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
// @ts-check
import path from 'node:path';
import { fileURLToPath } from 'node:url';
import js from '@eslint/js';
import { FlatCompat } from '@eslint/eslintrc';
import ts from 'typescript-eslint';
import playwright from 'eslint-plugin-playwright';
import eslintConfigPrettier from 'eslint-config-prettier';

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

const config = ts.config(
{ ignores: ['.next/*', '.open-next/*', 'cdk/*', './.lintstagedrc.mjs'] },
...compat.extends('next/core-web-vitals', 'next/typescript'),
eslintConfigPrettier,
{
languageOptions: {
parserOptions: {
projectService: true,
tsconfigRootDir: import.meta.dirname,
},
},
rules: {
'no-restricted-imports': [
'error',
{
patterns: ['@mui/*/*/*', '../../*'],
},
],
},
},
{
...playwright.configs['flat/recommended'],
files: ['tests/e2e/**/*.ts'],
rules: {
...playwright.configs['flat/recommended'].rules,
'@typescript-eslint/no-floating-promises': 'error',
'playwright/expect-expect': 'off',
'playwright/no-conditional-in-test': 'off',
'playwright/no-conditional-expect': 'off',
},
},
);

export default config;
Loading

0 comments on commit 5cb8c61

Please sign in to comment.