Files
lnreader-plugins/eslint.config.js
T
Marcin Majewski b2caf26da3 Move to Zustand and add Filters to web_test (#1077)
* Moved to zustand and started refactored filters

- Move from redux to zustand
- Refactor Filters typings and add some helper types
- Add Filters button and Picker/Switch filter options
- Fixed Syosetu typings

* Add rule consistent-type-definitions

- Add consistent-type-definitions eslint rule to force consistent use of types instead of interfaces
- Run eslint to auto-change every interface to types

https://dev.to/atheodosiou/types-vs-interfaces-in-typescript-making-the-right-choice-48a4
https://www.youtube.com/watch?v=zM9UPcIyyhQ

* Add other filters and refactor

- Move Dialog to FiltersDialog
- CheckboxFilter, TextFilter, XCheckboxFilter added
- Added TripleCheckbox and TripleSwitch as tri-state checkbox/switch items using Mui stylings

* TriStateCheckbox/Switch refactor

- Change name of TripleSwitch and TripleCheckbox to TriState
- Change slightly TriStateSwitch and StyledSwitch styles
- Add option to change into TriStateSwitches via `localStorage` value `useSwitches`

* Refactor code and fix issues

* fix: prettier

---------

Co-authored-by: nyagami <hoangquan05112002@gmail.com>
2024-08-18 22:31:41 +07:00

171 lines
3.3 KiB
JavaScript

// @ts-check
import eslint from '@eslint/js';
import prettierConfig from 'eslint-config-prettier';
import tseslint from 'typescript-eslint';
import globals from 'globals';
const globalsHermes = [
//hermes@0.72
'AggregateError',
'Array',
'ArrayBuffer',
'BigInt',
'BigInt64Array',
'BigUint64Array',
'Boolean',
'DataView',
'Date',
'DebuggerInternal',
'Error',
'EvalError',
'Float32Array',
'Float64Array',
'Function',
'HermesInternal',
'Infinity',
'Int16Array',
'Int32Array',
'Int8Array',
'JSON',
'Map',
'Math',
'NaN',
'Number',
'Object',
'Promise',
'Proxy',
'QuitError',
'RangeError',
'ReferenceError',
'Reflect',
'RegExp',
'Set',
'String',
'Symbol',
'SyntaxError',
'TimeoutError',
'TypeError',
'URIError',
'Uint16Array',
'Uint32Array',
'Uint8Array',
'Uint8ClampedArray',
'WeakMap',
'WeakSet',
'__defineGetter__',
'__defineSetter__',
'__lookupGetter__',
'__lookupSetter__',
'__proto__',
'clearTimeout',
'constructor',
'createHeapSnapshot',
'decodeURI',
'decodeURIComponent',
'encodeURI',
'encodeURIComponent',
'escape',
'gc',
'globalThis',
'hasOwnProperty',
'isFinite',
'isNaN',
'isPrototypeOf',
'loadSegment',
'parseFloat',
'parseInt',
'print',
'propertyIsEnumerable',
'setImmediate',
'setTimeout',
'toLocaleString',
'toString',
'undefined',
'unescape',
'valueOf',
//react-native
'AbortController',
'Blob',
'ErrorUtils',
'Event',
'EventTarget',
'File',
'FileReader',
'FormData',
'Headers',
'Intl',
'URL',
'URLSearchParams',
'WebSocket',
'XMLHttpRequest',
'__DEV__',
'__dirname',
'__fbBatchedBridgeConfig',
'alert',
'cancelAnimationFrame',
'cancelIdleCallback',
'clearImmediate',
'clearInterval',
'console',
'document',
'exports',
'fetch',
'global',
'module',
'navigator',
'process',
'queueMicrotask',
'requestAnimationFrame',
'requestIdleCallback',
'require',
'setInterval',
'window',
].map(key => ({ [key]: 'readonly' }));
export default tseslint.config(
eslint.configs.recommended,
...tseslint.configs.recommended,
...tseslint.configs.stylistic,
prettierConfig,
{
ignores: ['.js', 'docs', 'proxy_server.js'],
},
{
files: ['./src/plugins/*/*.ts', './scripts/multisrc/*/template.ts'],
rules: {
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': 'warn',
'@typescript-eslint/no-explicit-any': 'warn',
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/consistent-type-definitions': ['error', 'type'],
'no-case-declarations': 'warn',
'no-undef': 'error',
},
languageOptions: {
ecmaVersion: 5,
sourceType: 'module',
globals: Object.assign({}, ...globalsHermes),
},
},
{
files: ['**/*.{ts,tsx,mts,cts,js}'],
ignores: ['./src/plugins/*/*.ts', './scripts/multisrc/*/template.ts'],
rules: {
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': 'warn',
'@typescript-eslint/no-namespace': 'off',
'@typescript-eslint/consistent-type-definitions': ['error', 'type'],
'@typescript-eslint/no-explicit-any': 'warn',
'@typescript-eslint/ban-ts-comment': 'off',
'no-undef': 'error',
},
languageOptions: {
globals: {
...globals.serviceworker,
...globals.browser,
},
},
},
);