Files
transmission-mirror/web/eslint.config.js
Yat Ho d31e77a494 chore: update transmission-web package (#7003)
* chore: update minor versions

* chore: bump to `style-loader@4`

major version change

* refactor: combine `#mainwin-toolbar:nth-last-child(2)` rule

* refactor: cleanup scss definitions

Notes: `.single-file` is no longer used in code

* chore: bump `esbuild-sass-plugin@3` `esbuild@0.25`

* chore: uninstall unused `stylelint-config-standard`

In fact, it was never used since added to `package.json`.

* chore: bump `stylelint@16` `stylelint-config-sass-guidelines@12`

* chore: bump `eslint@9` `eslint-plugin-sonarjs@1` `eslint-plugin-unicorn@61`

* chore: enable prettier for whole `transmission-web` package

* chore: bump `@primer/stylelint-config@13`

* chore: update minor versions

* build: remove lint config files from CMake dependency

* chore: bump minor versions

* chore: bump `eslint-plugin-sonarjs@3`

* ci: use `actions/setup-node@v4` to install Node.js

So that there's no risk of the OS package manager's Node.js version being too low.

Except in Alpine, which does not work with `actions/setup-node@v4`. Ref: https://github.com/actions/setup-node/issues/387

* chore: replace `lodash.isEqual` with `fast-deep-equal`

* chore: bump minor versions

* chore: re-generate package-lock.json

* chore: fix lint errors
2025-10-25 12:09:36 -05:00

140 lines
4.4 KiB
JavaScript

import js from '@eslint/js';
import sonarjs from 'eslint-plugin-sonarjs';
import eslintPluginUnicorn from 'eslint-plugin-unicorn';
import globals from 'globals';
export default [
js.configs.recommended,
sonarjs.configs.recommended,
eslintPluginUnicorn.configs['flat/recommended'],
{
ignores: ['public_html/'],
},
{
files: ['*.js', '*.mjs'],
languageOptions: {
globals: { ...globals.node },
},
},
{
files: ['src/*.js'],
languageOptions: {
globals: { ...globals.browser, ...globals.es2015 },
},
},
{
rules: {
'accessor-pairs': 'error',
'array-callback-return': 'error',
'arrow-spacing': 'error',
'block-scoped-var': 'error',
'class-methods-use-this': 'error',
'consistent-return': 'error',
curly: 'error',
'default-case': 'error',
'default-case-last': 'error',
'default-param-last': 'error',
eqeqeq: 'error',
'grouped-accessor-pairs': 'error',
'guard-for-in': 'error',
'init-declarations': 'error',
'no-array-constructor': 'error',
'no-caller': 'error',
'no-confusing-arrow': 'error',
'no-constructor-return': 'error',
'no-delete-var': 'error',
'no-dupe-class-members': 'error',
'no-duplicate-imports': 'error',
'no-else-return': 'error',
'no-empty-function': 'error',
'no-eq-null': 'error',
'no-eval': 'error',
'no-extend-native': 'error',
'no-extra-bind': 'error',
'no-extra-label': 'error',
'no-floating-decimal': 'error',
'no-implicit-coercion': 'error',
'no-implicit-globals': 'error',
'no-implied-eval': 'error',
'no-invalid-this': 'error',
'no-iterator': 'error',
'no-label-var': 'error',
'no-labels': 'error',
'no-lone-blocks': 'error',
'no-loop-func': 'error',
'no-loss-of-precision': 'error',
'no-multi-str': 'error',
'no-nested-ternary': 'error',
'no-new': 'error',
'no-new-func': 'error',
'no-new-wrappers': 'error',
'no-octal': 'error',
'no-octal-escape': 'error',
'no-promise-executor-return': 'error',
'no-proto': 'error',
'no-redeclare': 'error',
'no-restricted-exports': 'error',
'no-restricted-globals': 'error',
'no-restricted-imports': 'error',
'no-restricted-properties': 'error',
'no-return-assign': 'error',
'no-script-url': 'error',
'no-self-compare': 'error',
'no-sequences': 'error',
'no-shadow': 'error',
'no-template-curly-in-string': 'error',
'no-this-before-super': 'error',
'no-throw-literal': 'error',
'no-undef-init': 'error',
'no-undefined': 'error',
'no-unmodified-loop-condition': 'error',
'no-unreachable-loop': 'error',
'no-unused-expressions': 'error',
'no-unused-labels': 'error',
'no-unused-vars': 'error',
'no-use-before-define': 'error',
'no-useless-backreference': 'error',
'no-useless-call': 'error',
'no-useless-catch': 'error',
'no-useless-computed-key': 'error',
'no-useless-concat': 'error',
'no-useless-constructor': 'error',
'no-useless-escape': 'error',
'no-useless-rename': 'error',
'no-useless-return': 'error',
'no-var': 'error',
'no-void': 'error',
'no-with': 'error',
'object-shorthand': 'error',
'prefer-arrow-callback': 'error',
'prefer-const': 'error',
'prefer-destructuring': 'error',
'prefer-exponentiation-operator': 'error',
'prefer-numeric-literals': 'error',
'prefer-object-spread': 'error',
'prefer-promise-reject-errors': 'error',
'prefer-regex-literals': 'error',
'prefer-rest-params': 'error',
'prefer-spread': 'error',
'prefer-template': 'error',
radix: 'error',
'require-atomic-updates': 'error',
'require-await': 'error',
semi: 'error',
'sonarjs/cognitive-complexity': 'off',
'sonarjs/no-duplicate-string': 'off',
'sonarjs/todo-tag': 'off',
'sort-keys': 'error',
strict: 'error',
'unicorn/consistent-function-scoping': 'off',
'unicorn/no-array-reduce': 'off',
'unicorn/no-fn-reference-in-iterator': 'off',
'unicorn/no-null': 'off',
'unicorn/no-reduce': 'off',
'unicorn/no-unused-properties': 'off',
'unicorn/prevent-abbreviations': 'off',
'unicorn/switch-case-braces': 'off',
},
},
];