senkulabs / breeze-lite

Unofficial Laravel Breeze for Laravel + Inertia + Svelte until Laravel Breeze release the official for Inertia + Svelte. Until then, enjoy!
https://breeze-lite.senku.stream
3 stars 2 forks source link

Eslint #12

Closed edjw closed 15 hours ago

edjw commented 2 days ago

I saw some comments about not being sure what to do with eslint. I am also not sure what to do here.

In case it helps for research…

New Svelte projects from Svelte's new sv CLI come with these eslint configs for JS or TS projects. I'm not sure if they need to be edited for the stubs in this project or not though sorry

Javascript projects eslint.config.js

import prettier from 'eslint-config-prettier';
import js from '@eslint/js';
import svelte from 'eslint-plugin-svelte';
import globals from 'globals';

/** @type {import('eslint').Linter.Config[]} */
export default [
    js.configs.recommended,
    ...svelte.configs['flat/recommended'],
    prettier,
    ...svelte.configs['flat/prettier'],
    {
        languageOptions: {
            globals: {
                ...globals.browser,
                ...globals.node
            }
        }
    },
    {
        ignores: ['build/', '.svelte-kit/', 'dist/']
    }
];

Typescript projects eslint.config.js

import prettier from "eslint-config-prettier";
import js from '@eslint/js';
import svelte from 'eslint-plugin-svelte';
import globals from 'globals';
import ts from 'typescript-eslint';

export default ts.config(
  js.configs.recommended,
  ...ts.configs.recommended,
  ...svelte.configs["flat/recommended"],
  prettier,
  ...svelte.configs['flat/prettier'],
  {
    languageOptions: {
      globals: {
        ...globals.browser,
        ...globals.node
      }
    }
  },
  {
    files: ["**/*.svelte"],

    languageOptions: {
      parserOptions: {
        parser: ts.parser
      }
    }
  },
  {
    ignores: ["build/", ".svelte-kit/", "dist/"]
  }
);
kresnasatya commented 2 days ago

Thanks a lot Ed.

kresnasatya commented 15 hours ago

Hi Ed, I have shipped the new version of Breeze Lite (https://github.com/senkulabs/breeze-lite/releases/tag/v1.5.0) based on this discussion. I will close this issue and feel free to open the new issue for another discussion. Thanks a lot.