feat: typed database with kysely, updated config

This commit is contained in:
Samuel 2024-12-11 16:41:37 +01:00
parent d06e6d913e
commit 0e6f5a24bd
24 changed files with 1656 additions and 434 deletions

View file

@ -8,65 +8,69 @@ import simpleImportSort from "eslint-plugin-simple-import-sort";
import solid from "eslint-plugin-solid/configs/typescript";
import tseslint from "typescript-eslint";
export default tseslint.config([
eslint.configs.recommended,
// tseslint.configs.recommendedTypeChecked,
// tseslint.configs.strictTypeChecked,
// tseslint.configs.stylisticTypeChecked,
eslintPluginPrettierRecommended,
eslintConfigPrettier,
export default tseslint.config(
{
...solid,
languageOptions: {
parser: tsparser,
// Specifies the ESLint parser
parserOptions: {
ecmaVersion: 2024,
// Allows for the parsing of modern ECMAScript features
sourceType: "module",
// Allows for the use of imports
ecmaFeatures: {
jsx: true, // Allows for the parsing of JSX
ignores: ["dist/**/*.ts", "dist/**", "**/*.mjs", "eslint.config.js", "**/*.js"],
},
[
eslint.configs.recommended,
tseslint.configs.strictTypeChecked,
tseslint.configs.stylisticTypeChecked,
eslintPluginPrettierRecommended,
eslintConfigPrettier,
{
...solid,
languageOptions: {
parser: tsparser,
// Specifies the ESLint parser
parserOptions: {
ecmaVersion: 2024,
// Allows for the parsing of modern ECMAScript features
sourceType: "module",
// Allows for the use of imports
ecmaFeatures: {
jsx: true, // Allows for the parsing of JSX
},
project: "./tsconfig.json",
projectService: true,
tsconfigRootDir: import.meta.dirname,
},
project: "./tsconfig.json",
projectService: true,
tsconfigRootDir: import.meta.dirname,
},
plugins: {
"simple-import-sort": simpleImportSort,
},
rules: {
// Place to specify ESLint rules. Can be used to overwrite rules specified from the extended configs
// e.g. "@typescript-eslint/explicit-function-return-type": "off",
"simple-import-sort/imports": [
"error",
{
groups: [
// solidjs
["^solid-(js|start)", "^@solidjs/"],
["^@?\\w"],
// components imports
["^~/components/?"],
// other /src imports
["^~/"],
// Parent imports. Put `..` last.
["^\\.\\.(?!/?$)", "^\\.\\./?$"],
// Other relative imports. Put same-folder imports and `.` last.
["^\\./(?=.*/)(?!/?$)", "^\\.(?!/?$)", "^\\./?$"],
// types imports
["^~/types$"],
// Side effect imports.
["^\\u0000"],
// Style imports.
["^.+\\.?(s?css)$"],
],
},
],
"simple-import-sort/exports": "error",
// "@typescript-eslint/consistent-type-imports": "error",
// "@typescript-eslint/consistent-type-exports": "error",
},
},
plugins: {
"simple-import-sort": simpleImportSort,
},
rules: {
// Place to specify ESLint rules. Can be used to overwrite rules specified from the extended configs
// e.g. "@typescript-eslint/explicit-function-return-type": "off",
"simple-import-sort/imports": [
"error",
{
groups: [
// solidjs
["^solid-(js|start)", "^@solidjs/"],
["^@?\\w"],
// components imports
["^~/components/?"],
// other /src imports
["^~/"],
// Parent imports. Put `..` last.
["^\\.\\.(?!/?$)", "^\\.\\./?$"],
// Other relative imports. Put same-folder imports and `.` last.
["^\\./(?=.*/)(?!/?$)", "^\\.(?!/?$)", "^\\./?$"],
// types imports
["^~/types$"],
// Side effect imports.
["^\\u0000"],
// Style imports.
["^.+\\.?(s?css)$"],
],
},
],
"simple-import-sort/exports": "error",
// "@typescript-eslint/consistent-type-imports": "error",
// "@typescript-eslint/consistent-type-exports": "error",
},
},
]);
],
);