Skip to content

Commit

Permalink
fix: add new configs
Browse files Browse the repository at this point in the history
  • Loading branch information
HoodieRocks committed May 14, 2024
1 parent b59b72e commit b690542
Show file tree
Hide file tree
Showing 2 changed files with 121 additions and 0 deletions.
27 changes: 27 additions & 0 deletions eslint-ignores-as-js.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
export default [
"/.svelte-kit/*",
".DS_Store",
"node_modules",
"/build",
"/.vscode",
"/package",
"/static",
"/tests",
"/test-results",
"/lighthouse",
"/.github",
".env",
".env.*",
"!.env.example",
"pnpm-lock.yaml",
"package-lock.json",
"bun.lockb",
"yarn.lock",
"svelte.config.js",
"unlighthouse.config.ts",
"vite.config.js",
"playwright.config.ts",
"postcss.config.cjs",
"tailwind.config.cjs",
"/.vscode"
];
94 changes: 94 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
// export default {
// root: true,
// parser: "@typescript-eslint/parser",
// extends: [
// "plugin:@typescript-eslint/recommended",
// "plugin:svelte/recommended",
// "plugin:unicorn/recommended"
// ],
// plugins: ["@typescript-eslint"],
// ignorePatterns: ["*.cjs", "node_modules"],
// overrides: [
// {
// files: ["*.svelte"],
// parser: "svelte-eslint-parser",
// parserOptions: {
// parser: "@typescript-eslint/parser"
// }
// },
// { files: ["*.ts", "*.svelte"], rules: { "no-undef": "off" } }
// ],
// settings: {
// "svelte3/typescript": import("typescript")
// },
// parserOptions: {
// project: "tsconfig.json",
// sourceType: "module",
// ecmaVersion: 2020,
// extraFileExtensions: [".svelte"]
// },
// rules: {
// // "@typescript-eslint/no-floating-promises": "error",
// "@typescript-eslint/await-thenable": "error",
// // "@typescript-eslint/indent": ["off"] // You can enable this rule if you want
// "unicorn/filename-case": ["warn"], // You can disable this rule if you want
// "unicorn/no-document-cookie": "error",
// "unicorn/prefer-top-level-await": ["off"] // You can enable this rule if you want
// },
// env: {
// browser: true,
// es2020: true,
// es6: true,
// node: true
// }
// };

import tsEslintPlugin from "@typescript-eslint/eslint-plugin";
import tsEslintParser from "@typescript-eslint/parser";
import svelteEslintPlugin from "eslint-plugin-svelte";
import unicornPlugin from "eslint-plugin-unicorn";
import typescript from "typescript";
import eslintIgnoresAsJs from "./eslint-ignores-as-js.js";

export default [
{
plugins: {
"@typescript-eslint": tsEslintPlugin,
unicorn: unicornPlugin,
svelte: svelteEslintPlugin
},

languageOptions: {
parser: "svelte-eslint-parser",
parserOptions: {
parser: tsEslintParser
}
},
ignores: eslintIgnoresAsJs,
settings: {
"svelte3/typescript": typescript
},
rules: {
// "@typescript-eslint/no-floating-promises": "error",
// "@typescript-eslint/indent": ["off"] // You can enable this rule if you want
"unicorn/no-document-cookie": "error",
"unicorn/prefer-top-level-await": ["off"] // You can enable this rule if you want
},
languageOptions: {
globals: {}
}
},
{
files: ["*.svelte"],
parser: "svelte-eslint-parser",
ignores: eslintIgnoresAsJs,
parserOptions: {
parser: "@typescript-eslint/parser"
}
},
{
files: ["*.ts", "*.svelte"],
ignores: eslintIgnoresAsJs,
rules: { "no-undef": "off" }
}
];

0 comments on commit b690542

Please sign in to comment.