Files
KomediruzeckiandGitHub 6d436a2f9e chore(lint): re-enable no-useless-assignment and remove the five dead writes (#511)
The eslint 10 bump (#510) shipped with the rule off because these did not
belong in a deps PR. The five: dead initializers in storageFactory
(getStorageMode's stored) and Pagination (visiblePages — both branches
assign), a posY advance after the last draw of the cash-flow page, and two
posY captures from the final addSectionTable of their reports. All
behavior-neutral: tsc definite-assignment still holds and the full frontend
suite passes.
2026-08-31 19:31:37 +02:00

374 lines
11 KiB
JavaScript

import pluginSecurity from 'eslint-plugin-security'
import pluginSonarjs from 'eslint-plugin-sonarjs'
import eslint from '@eslint/js'
import tsParser from '@typescript-eslint/parser'
import { defineConfig } from 'eslint/config'
import { importX } from 'eslint-plugin-import-x'
import simpleImportSort from 'eslint-plugin-simple-import-sort'
import tseslint from 'typescript-eslint'
export default defineConfig(
{
ignores: [
'.pnpm-noop',
'**/*.css.d.ts',
'**/coverage',
'**/dist',
'**/.wrangler', // wrangler dev/build scratch (miniflare bundles) — not source
'**/node_modules',
'**/.pnpm-store', // present in CI
'**/tests/*.spec.ts',
'workbox-*.js',
'sw.js',
'public/**', // static assets served verbatim (theme-init.js, manifest) — not part of the TS project
'scripts/**', // standalone Node tooling (walk-tours.mjs) — run by hand, not part of the TS project
'vite.config.ts',
'**/assets/**',
'**/*.d.ts',
'**/*.config.ts',
'**/test-results/**',
'**/playwright-report/**',
'**/*.config.js',
'.eslintrc.*',
'registerSW.js',
'chart.umd.min.js',
],
},
importX.flatConfigs.recommended,
pluginSecurity.configs.recommended,
pluginSonarjs.configs.recommended,
{
...importX.flatConfigs.typescript,
rules: {
...importX.flatConfigs.typescript.rules,
'import-x/namespace': 'off',
'import-x/no-duplicates': 'off',
'import-x/no-useless-path-segments': 'off',
'import-x/no-unresolved': 'off',
},
},
eslint.configs.recommended,
tseslint.configs.strictTypeChecked,
{
plugins: {
'simple-import-sort': simpleImportSort,
},
languageOptions: {
parser: tsParser,
parserOptions: {
projectService: true,
tsconfigRootDir: import.meta.dirname,
},
},
},
{
rules: {
'import-x/consistent-type-specifier-style': 'error',
'import-x/newline-after-import': 'error',
'import-x/no-duplicates': 'off',
'import-x/no-empty-named-blocks': 'error',
'import-x/no-named-as-default': 'off',
'import-x/no-named-as-default-member': 'off',
'import-x/namespace': 'off',
'import-x/default': 'off',
// Turned off for eslint@9.39.0
// @see https://github.com/eslint/eslint/issues/20272
'@typescript-eslint/unified-signatures': 'off',
// New in eslint@10 recommended. Solid refs are `let el: HTMLDivElement | undefined`
// assigned by the JSX compiler (`ref={el}`), which eslint cannot see — every hit in
// this codebase is that pattern, so the rule is pure noise here.
'no-unassigned-vars': 'off',
// this is caught by ts already and eslint doesn't understand @/
'import-x/no-unresolved': 'off',
'no-console': ['error', { allow: ['info', 'warn', 'error', 'table'] }],
'no-throw-literal': 'error',
'no-useless-concat': 'error',
'prefer-template': 'error',
eqeqeq: 'error',
'@typescript-eslint/no-unused-vars': [
'error',
{
argsIgnorePattern: '^_',
caughtErrorsIgnorePattern: '^_',
destructuredArrayIgnorePattern: '^_',
varsIgnorePattern: '^_',
},
],
'@typescript-eslint/consistent-type-imports': 'error',
'@typescript-eslint/strict-boolean-expressions': 'off',
'@typescript-eslint/no-dynamic-delete': 'off',
'@typescript-eslint/no-misused-promises': 'off',
'@typescript-eslint/no-floating-promises': 'off',
'@typescript-eslint/require-await': 'off',
'@typescript-eslint/no-unnecessary-condition': 'off',
// Disabled per user approval to clear 3000+ noisy typing errors from legacy codebase
'@typescript-eslint/no-unsafe-member-access': 'off',
'@typescript-eslint/no-unsafe-assignment': 'off',
'@typescript-eslint/no-unsafe-argument': 'off',
'@typescript-eslint/no-unsafe-call': 'off',
'@typescript-eslint/no-unsafe-return': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/restrict-template-expressions': 'off',
'@typescript-eslint/no-unnecessary-type-assertion': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/only-throw-error': 'off',
'@typescript-eslint/restrict-plus-operands': 'off',
'@typescript-eslint/await-thenable': 'off',
'sonarjs/null-dereference': 'off',
'sonarjs/no-nested-conditional': 'off',
'sonarjs/cognitive-complexity': 'off',
'sonarjs/argument-type': 'off',
'sonarjs/function-return-type': 'off',
'sonarjs/void-use': 'off',
'sonarjs/no-redundant-optional': 'off',
'sonarjs/no-ignored-exceptions': 'off',
'sonarjs/different-types-comparison': 'off',
'sonarjs/redundant-type-aliases': 'off',
'sonarjs/unused-import': 'off',
'sonarjs/prefer-specific-assertions': 'off',
'sonarjs/no-dead-store': 'off',
'sonarjs/no-alphabetical-sort': 'off',
'sonarjs/no-nested-template-literals': 'off',
'sonarjs/no-undefined-argument': 'off',
'sonarjs/no-redundant-assignments': 'off',
'sonarjs/no-nested-functions': 'off',
'sonarjs/no-misleading-array-reverse': 'off',
'sonarjs/no-labels': 'off',
'sonarjs/no-all-duplicated-branches': 'off',
'sonarjs/no-unused-vars': 'off',
'sonarjs/super-linear-regex': 'off',
'sonarjs/no-duplicated-branches': 'off',
'sonarjs/use-type-alias': 'off',
// Style-only sonarjs rules with high false-positive counts on this Solid
// codebase (props are readonly by convention); disabled so the frontend lint
// check can be enforced in CI rather than perpetually failing.
'sonarjs/prefer-read-only-props': 'off',
'sonarjs/prefer-regexp-exec': 'off',
// eslint-plugin-security's object-injection rule flags EVERY computed member
// access (obj[key], arr[i]) as a "sink" and can't tell a numeric index or a
// controlled lookup key from an untrusted one. All 238 hits in this codebase are
// safe reads/writes on local arrays and lookup tables — the rule produces only
// noise (no true positives), so it's disabled to keep the lint check enforceable
// in CI. The narrower regex rules (detect-unsafe-regex / detect-non-literal-regexp)
// stay ON; their few false positives carry justified inline disables instead.
'security/detect-object-injection': 'off',
'padding-line-between-statements': [
'error',
{
blankLine: 'always',
prev: '*',
next: 'function',
},
],
'simple-import-sort/imports': [
'error',
{
groups: [
[
// Side effect imports.
'^\\u0000',
// Packages.
// Things that start with a letter (or digit or underscore), or `@` followed by a letter.
'^@?\\w',
// Absolute imports and other imports such as `@/foo`.
// Anything not matched in another group.
'^',
// Relative imports.
// Anything that starts with a dot.
'^\\.',
// Type imports: first packages, then everything else
'^@?\\w.*\\u0000$',
'^.*\\u0000$',
],
],
},
],
'no-restricted-globals': [
'error',
'blur',
'captureEvents',
'chrome',
'clientInformation',
'close',
'closed',
'createImageBitmap',
'crypto',
'customElements',
'defaultStatus',
'defaultstatus',
'devicePixelRatio',
'external',
'find',
'focus',
'frameElement',
'frames',
'getComputedStyle',
'getSelection',
'indexedDB',
'innerHeight',
'innerWidth',
'isSecureContext',
'length',
'location',
'locationbar',
'matchMedia',
'menubar',
'moveBy',
'moveTo',
'name',
'navigator',
'onabort',
'onafterprint',
'onanimationend',
'onanimationiteration',
'onanimationstart',
'onappinstalled',
'onauxclick',
'onbeforeinstallprompt',
'onbeforeprint',
'onbeforeunload',
'onblur',
'oncancel',
'oncanplay',
'oncanplaythrough',
'onchange',
'onclick',
'onclose',
'oncontextmenu',
'oncuechange',
'ondblclick',
'ondevicemotion',
'ondeviceorientation',
'ondeviceorientationabsolute',
'ondrag',
'ondragend',
'ondragenter',
'ondragleave',
'ondragover',
'ondragstart',
'ondrop',
'ondurationchange',
'onemptied',
'onended',
'onerror',
'onfocus',
'ongotpointercapture',
'onhashchange',
'oninput',
'oninvalid',
'onkeydown',
'onkeypress',
'onkeyup',
'onlanguagechange',
'onload',
'onloadeddata',
'onloadedmetadata',
'onloadstart',
'onlostpointercapture',
'onmessage',
'onmessageerror',
'onmousedown',
'onmouseenter',
'onmouseleave',
'onmousemove',
'onmouseout',
'onmouseover',
'onmouseup',
'onmousewheel',
'onoffline',
'ononline',
'onpagehide',
'onpageshow',
'onpause',
'onplay',
'onplaying',
'onpointercancel',
'onpointerdown',
'onpointerenter',
'onpointerleave',
'onpointermove',
'onpointerout',
'onpointerover',
'onpointerup',
'onpopstate',
'onprogress',
'onratechange',
'onrejectionhandled',
'onreset',
'onresize',
'onscroll',
'onsearch',
'onseeked',
'onseeking',
'onselect',
'onstalled',
'onstorage',
'onsubmit',
'onsuspend',
'ontimeupdate',
'ontoggle',
'ontransitionend',
'onunhandledrejection',
'onunload',
'onvolumechange',
'onwaiting',
'onwebkitanimationend',
'onwebkitanimationiteration',
'onwebkitanimationstart',
'onwebkittransitionend',
'onwheel',
'open',
'openDatabase',
'opener',
'origin',
'outerHeight',
'outerWidth',
'pageXOffset',
'pageYOffset',
'parent',
'performance',
'personalbar',
'postMessage',
'print',
'releaseEvents',
'resizeBy',
'resizeTo',
'screen',
'screenLeft',
'screenTop',
'screenX',
'screenY',
'scroll',
'scrollBy',
'scrollTo',
'scrollX',
'scrollY',
'scrollbars',
'self',
'speechSynthesis',
'status',
'statusbar',
'stop',
'styleMedia',
'toolbar',
'top',
'visualViewport',
'webkitRequestFileSystem',
'webkitResolveLocalFileSystemURL',
'webkitStorageInfo',
],
},
}
)