Skip to content

Commit

Permalink
lints
Browse files Browse the repository at this point in the history
  • Loading branch information
Eugeny committed Oct 26, 2024
1 parent a903fdb commit c3ccede
Show file tree
Hide file tree
Showing 44 changed files with 1,496 additions and 1,343 deletions.
165 changes: 0 additions & 165 deletions warpgate-web/.eslintrc.yaml

This file was deleted.

178 changes: 178 additions & 0 deletions warpgate-web/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,178 @@
// eslint.config.cjs

import globals from "globals";
import eslintPluginSvelte from 'eslint-plugin-svelte';
import js from '@eslint/js';
import svelteParser from 'svelte-eslint-parser';
import tsEslint from 'typescript-eslint';
import tsParser from '@typescript-eslint/parser';
import stylistic from '@stylistic/eslint-plugin'

export default [
js.configs.recommended,
...tsEslint.configs.strict,
...eslintPluginSvelte.configs['flat/recommended'],
{
ignores: ["**/svelte.config.js", "**/vite.config.ts", "src/*/lib/api-client/**/*"],
},
{
plugins: {
'@stylistic': stylistic,
},
languageOptions: {
parser: svelteParser,
parserOptions: {
projectService: true,
tsconfigRootDir: import.meta.dirname,
parser: tsParser,
extraFileExtensions: [".svelte"],
},
globals: {
...globals.browser,
},
},
rules: {
"@stylistic/semi": ["error", "never"],
"@stylistic/indent": ["error", 4],

"@typescript-eslint/explicit-member-accessibility": ["error", {
accessibility: "no-public",

overrides: {
parameterProperties: "explicit",
},
}],

"@typescript-eslint/no-require-imports": "off",
"@typescript-eslint/no-parameter-properties": "off",
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-magic-numbers": "off",
"@typescript-eslint/member-delimiter-style": "off",
"@typescript-eslint/promise-function-async": "off",
"@typescript-eslint/require-array-sort-compare": "off",
"@typescript-eslint/no-floating-promises": "off",
"@typescript-eslint/prefer-readonly": "off",
"@typescript-eslint/require-await": "off",
"@typescript-eslint/strict-boolean-expressions": "off",
"@typescript-eslint/explicit-module-boundary-types": "error",

// "@typescript-eslint/no-misused-promises": ["error", {
// checksVoidReturn: false,
// }],

"@typescript-eslint/typedef": "off",
"@typescript-eslint/consistent-type-imports": "off",
"@typescript-eslint/sort-type-union-intersection-members": "off",

"@typescript-eslint/no-use-before-define": ["error", {
classes: false,
functions: false,
}],

"no-duplicate-imports": "error",
"array-bracket-spacing": ["error", "never"],
"block-scoped-var": "error",
"brace-style": "off",

"@stylistic/brace-style": ["error", "1tbs", {
allowSingleLine: true,
}],

"computed-property-spacing": ["error", "never"],
curly: "error",
"eol-last": "error",
eqeqeq: ["error", "smart"],
"max-depth": [1, 5],
"max-statements": [1, 80],
"no-multiple-empty-lines": "error",
"no-mixed-spaces-and-tabs": "error",
"no-trailing-spaces": "error",

"@typescript-eslint/no-unused-vars": ["error", {
vars: "all",
args: "after-used",
argsIgnorePattern: "^_",
}],

"no-undef": "error",
"no-var": "error",
"object-curly-spacing": "off",
"@stylistic/object-curly-spacing": ["error", "always"],

"quote-props": ["warn", "as-needed", {
keywords: true,
numbers: true,
}],

quotes: "off",

"@stylistic/quotes": ["error", "single", {
allowTemplateLiterals: true,
}],

"@typescript-eslint/no-confusing-void-expression": ["error", {
ignoreArrowShorthand: true,
}],

"@typescript-eslint/no-non-null-assertion": "off",

// "@typescript-eslint/no-unnecessary-condition": ["error", {
// allowConstantLoopConditions: true,
// }],

"@typescript-eslint/restrict-template-expressions": "off",
"@typescript-eslint/prefer-readonly-parameter-types": "off",
"@typescript-eslint/no-unsafe-member-access": "off",
"@typescript-eslint/no-unsafe-call": "off",
"@typescript-eslint/no-unsafe-return": "off",
"@typescript-eslint/no-unsafe-assignment": "off",
"@typescript-eslint/naming-convention": "off",

"@stylistic/lines-between-class-members": ["error", "always", {
exceptAfterSingleLine: true,
}],

"@typescript-eslint/dot-notation": "off",
"@typescript-eslint/no-implicit-any-catch": "off",
"@typescript-eslint/member-ordering": "off",
"@typescript-eslint/no-var-requires": "off",
"@typescript-eslint/no-unsafe-argument": "off",
"@typescript-eslint/restrict-plus-operands": "off",
"@typescript-eslint/space-infix-ops": "off",

"@typescript-eslint/no-type-alias": ["error", {
allowAliases: "in-unions-and-intersections",
allowLiterals: "always",
allowCallbacks: "always",
}],

"@stylistic/comma-dangle": ["error", {
arrays: "always-multiline",
objects: "always-multiline",
imports: "always-multiline",
exports: "always-multiline",
functions: "only-multiline",
}],

"@typescript-eslint/use-unknown-in-catch-callback-variable": "off",
},
},
{
files: ['**/*.svelte'],
languageOptions: {
parser: svelteParser,
parserOptions: {
projectService: true,
tsconfigRootDir: import.meta.dirname,
parser: tsParser,
},
},
rules: {
'svelte/no-target-blank': 'error',
'svelte/no-at-debug-tags': 'error',
'svelte/no-reactive-functions': 'error',
'svelte/no-reactive-literals': 'error',
},
},
];
22 changes: 12 additions & 10 deletions warpgate-web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,27 +25,28 @@
"@otplib/plugin-base32-enc-dec": "^12.0.1",
"@otplib/plugin-crypto-js": "^12.0.1",
"@otplib/preset-browser": "^12.0.1",
"@sveltejs/vite-plugin-svelte": "^3.1.2",
"@sveltejs/vite-plugin-svelte": "^4.0.0",
"@sveltestrap/sveltestrap": "^6.2.7",
"@tsconfig/svelte": "^5.0.0",
"@types/qrcode": "^1.5.0",
"@types/ua-parser-js": "^0.7.36",
"@typescript-eslint/eslint-plugin": "^7.17.0",
"@typescript-eslint/parser": "^7.18.0",
"@xterm/addon-serialize": "^0.13",
"@xterm/xterm": "^5.5",
"bootstrap": "^5.3.3",
"copy-text-to-clipboard": "^3.0.1",
"date-fns": "^4.1.0",
"eslint": "^8",
"eslint": "^9.13.0",
"eslint-config-standard": "^17.1.0",
"eslint-import-resolver-typescript": "^3.6.3",
"eslint-plugin-import": "^2.31.0",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^7.1.0",
"eslint-plugin-svelte": "^2.46.0",
"format-duration": "^3.0.2",
"otpauth": "^9.3.4",
"qrcode": "^1.5.4",
"sass": "^1.80.4",
"svelte": "^4.2.19",
"sass": "~1.78",
"svelte": "^5.1.3",
"svelte-check": "^4.0.5",
"svelte-fa": "^4.0.3",
"svelte-intersection-observer": "^1.0.0",
Expand All @@ -58,9 +59,10 @@
"ua-parser-js": "^1.0.39",
"vite": "^5.4.10",
"vite-plugin-checker": "^0.8.0",
"vite-tsconfig-paths": "^4.3.2",
"@xterm/xterm": "^5.5",
"@xterm/addon-serialize": "^0.13",
"otpauth": "^9.3.4"
"vite-tsconfig-paths": "^4.3.2"
},
"dependencies": {
"@stylistic/eslint-plugin": "^2.9.0",
"typescript-eslint": "^8.11.0"
}
}
Loading

0 comments on commit c3ccede

Please sign in to comment.