-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: add better eslint config and change event schema text (#81)
Co-authored-by: Anton Lilleby <[email protected]>
- Loading branch information
Showing
20 changed files
with
929 additions
and
941 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,82 @@ | ||
import eslintPluginSvelte from "eslint-plugin-svelte"; | ||
// @ts-check | ||
import svelte from "eslint-plugin-svelte"; | ||
import svelteParser from "svelte-eslint-parser"; | ||
import typeScriptEslint from "typescript-eslint"; | ||
import ts from "typescript-eslint"; | ||
import globals from "globals"; | ||
|
||
export default [ | ||
...eslintPluginSvelte.configs["flat/recommended"], | ||
...typeScriptEslint.configs.strictTypeChecked, | ||
...eslintPluginSvelte.configs["flat/prettier"], | ||
/** @type {import('typescript-eslint').Config} */ | ||
export default ts.config( | ||
...ts.configs.recommendedTypeChecked, | ||
...svelte.configs["flat/recommended"], | ||
...svelte.configs["flat/prettier"], | ||
{ | ||
languageOptions: { | ||
parser: typeScriptEslint.parser, | ||
ecmaVersion: "latest", | ||
sourceType: "module", | ||
globals: { ...globals.node, ...globals.browser }, | ||
parserOptions: { | ||
project: "./tsconfig.json", | ||
extraFileExtensions: [".svelte"], | ||
ecmaVersion: 2020, | ||
sourceType: "module", | ||
project: true, | ||
parser: ts.parser, | ||
extraFileExtensions: [".svelte"], | ||
tsconfigRootDir: import.meta.dirname, | ||
}, | ||
}, | ||
}, | ||
{ | ||
files: ["**/*.svelte"], | ||
files: ["**/*.svelte", "*.svelte"], | ||
languageOptions: { | ||
ecmaVersion: "latest", | ||
sourceType: "module", | ||
globals: { ...globals.browser }, | ||
parser: svelteParser, | ||
parserOptions: { | ||
parser: typeScriptEslint.parser, | ||
parser: ts.parser, | ||
extraFileExtensions: [".svelte"], | ||
}, | ||
}, | ||
rules: { | ||
"import/no-named-as-default": "off", | ||
"import/no-named-as-default-member": "off", | ||
"svelte/no-target-blank": "error", | ||
"svelte/no-at-debug-tags": "error", | ||
"svelte/no-reactive-functions": "error", | ||
"svelte/no-reactive-literals": "error", | ||
}, | ||
}, | ||
{ | ||
rules: { | ||
semi: ["warn", "always"], | ||
"no-nested-ternary": "error", | ||
"linebreak-style": ["error", "unix"], | ||
"no-cond-assign": ["error", "always"], | ||
// TODO: Fix ts linting | ||
"@typescript-eslint/no-unsafe-assignment": "off", | ||
"@typescript-eslint/no-unsafe-member-access": "off", | ||
"@typescript-eslint/no-unsafe-call": "off", | ||
"@typescript-eslint/no-unsafe-return": "off", | ||
"@typescript-eslint/no-unsafe-argument": "off", | ||
}, | ||
}, | ||
{ | ||
files: ["**/*.config.*"], | ||
extends: [ts.configs.disableTypeChecked], | ||
}, | ||
{ | ||
ignores: [ | ||
".DS_Store", | ||
"node_modules", | ||
"build", | ||
".svelte-kit", | ||
"package", | ||
"coverage", | ||
"**/dist", | ||
"**/build", | ||
"**/package", | ||
"**/.svelte-kit", | ||
"**/node_modules", | ||
".env", | ||
".env.*", | ||
"!*.cjs", | ||
".DS_Store", | ||
"!.env.example", | ||
"pnpm-lock.yaml", | ||
"package-lock.json", | ||
"yarn.lock", | ||
"**/database.model.ts", | ||
], | ||
}, | ||
]; | ||
} | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.