mirror of
https://github.com/Stremio/stremio-web.git
synced 2026-04-28 18:53:04 +00:00
Merge pull request #703 from Stremio/chore/update-eslint
chore: update eslint
This commit is contained in:
commit
2b83e86fe4
68 changed files with 2092 additions and 674 deletions
99
.eslintrc
99
.eslintrc
|
|
@ -1,99 +0,0 @@
|
||||||
{
|
|
||||||
"extends": [
|
|
||||||
"eslint:recommended",
|
|
||||||
"plugin:react/recommended"
|
|
||||||
],
|
|
||||||
"settings": {
|
|
||||||
"react": {
|
|
||||||
"version": "detect"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"globals": {
|
|
||||||
"YT": "readonly",
|
|
||||||
"FB": "readonly",
|
|
||||||
"cast": "readonly",
|
|
||||||
"chrome": "readonly"
|
|
||||||
},
|
|
||||||
"env": {
|
|
||||||
"node": true,
|
|
||||||
"commonjs": true,
|
|
||||||
"browser": true,
|
|
||||||
"es6": true
|
|
||||||
},
|
|
||||||
"parserOptions": {
|
|
||||||
"ecmaVersion": 11,
|
|
||||||
"ecmaFeatures": {
|
|
||||||
"jsx": true
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"ignorePatterns": [
|
|
||||||
"/*",
|
|
||||||
"!/src"
|
|
||||||
],
|
|
||||||
"rules": {
|
|
||||||
"arrow-parens": "error",
|
|
||||||
"arrow-spacing": "error",
|
|
||||||
"block-spacing": "error",
|
|
||||||
"comma-spacing": "error",
|
|
||||||
"eol-last": "error",
|
|
||||||
"eqeqeq": "error",
|
|
||||||
"func-call-spacing": "error",
|
|
||||||
"indent": [
|
|
||||||
"error",
|
|
||||||
4,
|
|
||||||
{
|
|
||||||
"SwitchCase": 1
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"no-console": [
|
|
||||||
"error",
|
|
||||||
{
|
|
||||||
"allow": [
|
|
||||||
"warn",
|
|
||||||
"error"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"no-extra-semi": "error",
|
|
||||||
"no-eq-null": "error",
|
|
||||||
"no-multi-spaces": "error",
|
|
||||||
"no-multiple-empty-lines": [
|
|
||||||
"error",
|
|
||||||
{
|
|
||||||
"max": 1
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"no-prototype-builtins": "off",
|
|
||||||
"no-template-curly-in-string": "error",
|
|
||||||
"no-trailing-spaces": "error",
|
|
||||||
"no-useless-concat": "error",
|
|
||||||
"no-unreachable": "error",
|
|
||||||
"no-unused-vars": [
|
|
||||||
"error",
|
|
||||||
{
|
|
||||||
"varsIgnorePattern": "_"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"prefer-const": "error",
|
|
||||||
"quotes": [
|
|
||||||
"error",
|
|
||||||
"single"
|
|
||||||
],
|
|
||||||
"quote-props": [
|
|
||||||
"error",
|
|
||||||
"as-needed",
|
|
||||||
{
|
|
||||||
"unnecessary": false
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"semi": "error",
|
|
||||||
"semi-spacing": "error",
|
|
||||||
"space-before-blocks": "error",
|
|
||||||
"valid-typeof": [
|
|
||||||
"error",
|
|
||||||
{
|
|
||||||
"requireStringLiterals": true
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
100
eslint.config.mjs
Normal file
100
eslint.config.mjs
Normal file
|
|
@ -0,0 +1,100 @@
|
||||||
|
import globals from 'globals';
|
||||||
|
import pluginJs from '@eslint/js';
|
||||||
|
import tseslint from 'typescript-eslint';
|
||||||
|
import pluginReact from 'eslint-plugin-react';
|
||||||
|
import stylistic from '@stylistic/eslint-plugin'
|
||||||
|
|
||||||
|
export default [
|
||||||
|
pluginJs.configs.recommended,
|
||||||
|
...tseslint.configs.recommended,
|
||||||
|
...tseslint.configs.stylistic,
|
||||||
|
pluginReact.configs.flat.recommended,
|
||||||
|
{
|
||||||
|
plugins: {
|
||||||
|
'@stylistic': stylistic
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
files: ['**/*.{js,mjs,cjs,ts,jsx,tsx}']
|
||||||
|
},
|
||||||
|
{
|
||||||
|
files: ['**/*.js'],
|
||||||
|
languageOptions: {
|
||||||
|
sourceType: 'commonjs',
|
||||||
|
ecmaVersion: 'latest',
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
languageOptions: {
|
||||||
|
globals: {
|
||||||
|
...globals.browser,
|
||||||
|
...globals.node,
|
||||||
|
YT: 'readonly',
|
||||||
|
FB: 'readonly',
|
||||||
|
cast: 'readonly',
|
||||||
|
chrome: 'readonly',
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
settings: {
|
||||||
|
react: {
|
||||||
|
version: 'detect',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
rules: {
|
||||||
|
'no-redeclare': 'off',
|
||||||
|
'eol-last': 'error',
|
||||||
|
'eqeqeq': 'error',
|
||||||
|
'no-console': ['error', {
|
||||||
|
allow: [
|
||||||
|
'warn',
|
||||||
|
'error'
|
||||||
|
]
|
||||||
|
}],
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
rules: {
|
||||||
|
'@typescript-eslint/no-redeclare': 'off',
|
||||||
|
'@typescript-eslint/no-require-imports': 'off',
|
||||||
|
'@typescript-eslint/no-explicit-any': 'off',
|
||||||
|
'@typescript-eslint/no-empty-object-type': 'off',
|
||||||
|
'@typescript-eslint/no-unused-expressions': 'off',
|
||||||
|
'@typescript-eslint/consistent-type-definitions': 'off',
|
||||||
|
'@typescript-eslint/no-unused-vars': [
|
||||||
|
'error',
|
||||||
|
{
|
||||||
|
'varsIgnorePattern': '_',
|
||||||
|
'caughtErrorsIgnorePattern': '_',
|
||||||
|
}
|
||||||
|
],
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
rules: {
|
||||||
|
'@stylistic/arrow-parens': 'error',
|
||||||
|
'@stylistic/arrow-spacing': 'error',
|
||||||
|
'@stylistic/block-spacing': 'error',
|
||||||
|
'@stylistic/comma-spacing': 'error',
|
||||||
|
'@stylistic/semi-spacing': 'error',
|
||||||
|
'@stylistic/space-before-blocks': 'error',
|
||||||
|
'@stylistic/no-trailing-spaces': 'error',
|
||||||
|
'@stylistic/func-call-spacing': 'error',
|
||||||
|
'@stylistic/eol-last': 'error',
|
||||||
|
'@stylistic/no-multi-spaces': 'error',
|
||||||
|
'@stylistic/no-multiple-empty-lines': ['error', {
|
||||||
|
max: 1
|
||||||
|
}],
|
||||||
|
'@stylistic/indent': ['error', 4],
|
||||||
|
'@stylistic/quotes': ['error', 'single'],
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
rules: {
|
||||||
|
'react/display-name': 'off',
|
||||||
|
}
|
||||||
|
}
|
||||||
|
];
|
||||||
2418
package-lock.json
generated
2418
package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
|
@ -50,6 +50,9 @@
|
||||||
"@babel/plugin-proposal-object-rest-spread": "7.16.0",
|
"@babel/plugin-proposal-object-rest-spread": "7.16.0",
|
||||||
"@babel/preset-env": "7.16.0",
|
"@babel/preset-env": "7.16.0",
|
||||||
"@babel/preset-react": "7.16.0",
|
"@babel/preset-react": "7.16.0",
|
||||||
|
"@eslint/js": "^9.12.0",
|
||||||
|
"@stylistic/eslint-plugin": "^2.9.0",
|
||||||
|
"@stylistic/eslint-plugin-jsx": "^2.9.0",
|
||||||
"@types/hat": "^0.0.4",
|
"@types/hat": "^0.0.4",
|
||||||
"@types/react": "^18.2.9",
|
"@types/react": "^18.2.9",
|
||||||
"babel-loader": "8.2.3",
|
"babel-loader": "8.2.3",
|
||||||
|
|
@ -58,8 +61,9 @@
|
||||||
"css-loader": "6.5.0",
|
"css-loader": "6.5.0",
|
||||||
"cssnano": "5.0.8",
|
"cssnano": "5.0.8",
|
||||||
"cssnano-preset-advanced": "5.1.4",
|
"cssnano-preset-advanced": "5.1.4",
|
||||||
"eslint": "7.32.0",
|
"eslint": "^9.12.0",
|
||||||
"eslint-plugin-react": "7.26.1",
|
"eslint-plugin-react": "^7.37.1",
|
||||||
|
"globals": "^15.10.0",
|
||||||
"html-webpack-plugin": "5.5.0",
|
"html-webpack-plugin": "5.5.0",
|
||||||
"jest": "27.3.1",
|
"jest": "27.3.1",
|
||||||
"less": "4.1.2",
|
"less": "4.1.2",
|
||||||
|
|
@ -70,6 +74,7 @@
|
||||||
"terser-webpack-plugin": "5.2.4",
|
"terser-webpack-plugin": "5.2.4",
|
||||||
"ts-loader": "^9.5.1",
|
"ts-loader": "^9.5.1",
|
||||||
"typescript": "^5.4.2",
|
"typescript": "^5.4.2",
|
||||||
|
"typescript-eslint": "^8.8.0",
|
||||||
"webpack": "5.61.0",
|
"webpack": "5.61.0",
|
||||||
"webpack-cli": "4.9.1",
|
"webpack-cli": "4.9.1",
|
||||||
"webpack-dev-server": "^4.7.4",
|
"webpack-dev-server": "^4.7.4",
|
||||||
|
|
|
||||||
|
|
@ -37,6 +37,7 @@ const useCoreSuspender = () => {
|
||||||
return React.useContext(CoreSuspenderContext);
|
return React.useContext(CoreSuspenderContext);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
||||||
const withCoreSuspender = (Component, Fallback = () => { }) => {
|
const withCoreSuspender = (Component, Fallback = () => { }) => {
|
||||||
return function withCoreSuspender(props) {
|
return function withCoreSuspender(props) {
|
||||||
const { core } = useServices();
|
const { core } = useServices();
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,8 @@ const DelayedRenderer = ({ children, delay }) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
DelayedRenderer.propTypes = {
|
DelayedRenderer.propTypes = {
|
||||||
children: PropTypes.node
|
children: PropTypes.node,
|
||||||
|
delay: PropTypes.number,
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports = DelayedRenderer;
|
module.exports = DelayedRenderer;
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ const Dropdown = ({ level, setLevel, options, onSelect, selectedOption, menuOpen
|
||||||
<Icon name={'caret-left'} className={styles['back-button-icon']} />
|
<Icon name={'caret-left'} className={styles['back-button-icon']} />
|
||||||
{t('BACK')}
|
{t('BACK')}
|
||||||
</Button>
|
</Button>
|
||||||
: null
|
: null
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
options
|
options
|
||||||
|
|
@ -46,7 +46,6 @@ const Dropdown = ({ level, setLevel, options, onSelect, selectedOption, menuOpen
|
||||||
/>
|
/>
|
||||||
))
|
))
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,7 @@ const MultiselectMenu = ({ className, title, options, selectedOption, onSelect }
|
||||||
menuOpen={menuOpen}
|
menuOpen={menuOpen}
|
||||||
selectedOption={selectedOption}
|
selectedOption={selectedOption}
|
||||||
/>
|
/>
|
||||||
: null
|
: null
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,7 @@
|
||||||
// Copyright (C) 2017-2023 Smart code 203358507
|
// Copyright (C) 2017-2023 Smart code 203358507
|
||||||
|
|
||||||
|
/* eslint-disable @typescript-eslint/no-empty-function */
|
||||||
|
|
||||||
const React = require('react');
|
const React = require('react');
|
||||||
|
|
||||||
const ToastContext = React.createContext({
|
const ToastContext = React.createContext({
|
||||||
|
|
|
||||||
2
src/modules.d.ts
vendored
2
src/modules.d.ts
vendored
|
|
@ -1,5 +1,5 @@
|
||||||
declare module '*.less' {
|
declare module '*.less' {
|
||||||
const resource: { [key: string]: string };
|
const resource: Record<string, string>;
|
||||||
export = resource;
|
export = resource;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@ function DragAndDrop({ core }) {
|
||||||
args: Array.from(new Uint8Array(torrent))
|
args: Array.from(new Uint8Array(torrent))
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} catch (error) {
|
} catch (_error) {
|
||||||
events.emit('error', {
|
events.emit('error', {
|
||||||
message: 'Failed to process file',
|
message: 'Failed to process file',
|
||||||
file: {
|
file: {
|
||||||
|
|
|
||||||
|
|
@ -45,6 +45,7 @@ function ShellTransport() {
|
||||||
|
|
||||||
this.props = {};
|
this.props = {};
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
||||||
const shell = this;
|
const shell = this;
|
||||||
initialize()
|
initialize()
|
||||||
.then(() => {
|
.then(() => {
|
||||||
|
|
|
||||||
2
src/types/global.d.ts
vendored
2
src/types/global.d.ts
vendored
|
|
@ -1,3 +1,5 @@
|
||||||
|
/* eslint-disable no-var */
|
||||||
|
|
||||||
interface QtTransport {
|
interface QtTransport {
|
||||||
send: (message: string) => void,
|
send: (message: string) => void,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue