fix: upgrade eslint
This commit is contained in:
parent
edddfc9d9c
commit
734113d187
|
|
@ -1,2 +0,0 @@
|
||||||
src/setupTests.ts
|
|
||||||
src/registerServiceWorker.ts
|
|
||||||
|
|
@ -1,91 +0,0 @@
|
||||||
---
|
|
||||||
extends:
|
|
||||||
- eslint:recommended
|
|
||||||
- plugin:@typescript-eslint/eslint-recommended
|
|
||||||
- plugin:@typescript-eslint/recommended
|
|
||||||
- plugin:@typescript-eslint/recommended-requiring-type-checking
|
|
||||||
- plugin:react/recommended
|
|
||||||
- plugin:import/errors
|
|
||||||
- plugin:import/typescript
|
|
||||||
- plugin:jest/recommended
|
|
||||||
- prettier
|
|
||||||
env:
|
|
||||||
browser: true
|
|
||||||
es6: true
|
|
||||||
node: true
|
|
||||||
parser: "@typescript-eslint/parser"
|
|
||||||
parserOptions:
|
|
||||||
project: tsconfig.json
|
|
||||||
sourceType: module
|
|
||||||
plugins:
|
|
||||||
- "@typescript-eslint"
|
|
||||||
- react
|
|
||||||
- import
|
|
||||||
- unicorn
|
|
||||||
settings:
|
|
||||||
react:
|
|
||||||
version: detect
|
|
||||||
rules:
|
|
||||||
consistent-return: error
|
|
||||||
default-case: error
|
|
||||||
default-param-last: error
|
|
||||||
no-loop-func: off
|
|
||||||
arrow-body-style: [error, as-needed]
|
|
||||||
|
|
||||||
import/no-useless-path-segments: error
|
|
||||||
import/group-exports: off
|
|
||||||
import/extensions: [error, never]
|
|
||||||
import/no-duplicates: error
|
|
||||||
import/first: error
|
|
||||||
import/no-unused-modules: error
|
|
||||||
|
|
||||||
unicorn/no-abusive-eslint-disable: off
|
|
||||||
unicorn/no-array-instanceof: error
|
|
||||||
unicorn/no-unreadable-array-destructuring: error
|
|
||||||
unicorn/no-zero-fractions: error
|
|
||||||
|
|
||||||
react/jsx-key: error
|
|
||||||
react/jsx-pascal-case: error
|
|
||||||
react/destructuring-assignment: off
|
|
||||||
react/function-component-definition: off
|
|
||||||
react/no-array-index-key: error
|
|
||||||
react/no-deprecated: off
|
|
||||||
react/no-string-refs: error
|
|
||||||
react/no-this-in-sfc: error
|
|
||||||
react/no-typos: error
|
|
||||||
react/no-unknown-property: error
|
|
||||||
react/prefer-stateless-function: off
|
|
||||||
react/prop-types: off
|
|
||||||
|
|
||||||
jest/expect-expect: off
|
|
||||||
jest/no-jasmine-globals: off
|
|
||||||
"@typescript-eslint/require-await": off
|
|
||||||
"@typescript-eslint/restrict-template-expressions": off
|
|
||||||
|
|
||||||
"@typescript-eslint/array-type": [error, {default: array-simple}]
|
|
||||||
"@typescript-eslint/await-thenable": error
|
|
||||||
"@typescript-eslint/no-unused-vars": error
|
|
||||||
"@typescript-eslint/no-use-before-define": off
|
|
||||||
"@typescript-eslint/no-unsafe-call": off
|
|
||||||
"@typescript-eslint/consistent-type-assertions": [error, {assertionStyle: as}]
|
|
||||||
|
|
||||||
"@typescript-eslint/no-extra-non-null-assertion": error
|
|
||||||
"@typescript-eslint/no-inferrable-types": error
|
|
||||||
"@typescript-eslint/no-this-alias": error
|
|
||||||
"@typescript-eslint/no-throw-literal": error
|
|
||||||
"@typescript-eslint/no-non-null-assertion": off
|
|
||||||
"@typescript-eslint/prefer-nullish-coalescing": error
|
|
||||||
"@typescript-eslint/prefer-optional-chain": error
|
|
||||||
"@typescript-eslint/prefer-readonly": off
|
|
||||||
"@typescript-eslint/unbound-method": error
|
|
||||||
"@typescript-eslint/no-empty-function": off
|
|
||||||
"@typescript-eslint/explicit-module-boundary-types": off
|
|
||||||
"@typescript-eslint/ban-ts-comment": off
|
|
||||||
"@typescript-eslint/no-floating-promises": off
|
|
||||||
"@typescript-eslint/no-unsafe-member-access": off
|
|
||||||
"@typescript-eslint/no-unsafe-return": off
|
|
||||||
"@typescript-eslint/no-unsafe-assignment": off
|
|
||||||
"@typescript-eslint/restrict-plus-operands": off
|
|
||||||
"@typescript-eslint/no-misused-promises": off
|
|
||||||
|
|
||||||
"@typescript-eslint/no-explicit-any": error
|
|
||||||
|
|
@ -0,0 +1,6 @@
|
||||||
|
// @ts-check
|
||||||
|
|
||||||
|
import eslint from '@eslint/js';
|
||||||
|
import tseslint from 'typescript-eslint';
|
||||||
|
|
||||||
|
export default tseslint.config(eslint.configs.recommended, tseslint.configs.recommended);
|
||||||
|
|
@ -41,6 +41,7 @@
|
||||||
"testformat": "prettier \"src/**/*.{ts,tsx}\" --list-different"
|
"testformat": "prettier \"src/**/*.{ts,tsx}\" --list-different"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
"@eslint/js": "^9.32.0",
|
||||||
"@types/codemirror": "5.60.0",
|
"@types/codemirror": "5.60.0",
|
||||||
"@types/detect-browser": "^4.0.0",
|
"@types/detect-browser": "^4.0.0",
|
||||||
"@types/get-port": "^4.0.0",
|
"@types/get-port": "^4.0.0",
|
||||||
|
|
@ -53,25 +54,16 @@
|
||||||
"@types/react-router-dom": "^5.1.7",
|
"@types/react-router-dom": "^5.1.7",
|
||||||
"@types/remove-markdown": "^0.3.0",
|
"@types/remove-markdown": "^0.3.0",
|
||||||
"@types/rimraf": "^3.0.0",
|
"@types/rimraf": "^3.0.0",
|
||||||
"@typescript-eslint/eslint-plugin": "^4.1.0",
|
"eslint": "^9.32.0",
|
||||||
"@typescript-eslint/parser": "^4.1.0",
|
|
||||||
"eslint-config-prettier": "^6.11.0",
|
|
||||||
"eslint-plugin-import": "^2.22.0",
|
|
||||||
"eslint-plugin-jest": "^24.0.0",
|
|
||||||
"eslint-plugin-prefer-arrow": "^1.2.2",
|
|
||||||
"eslint-plugin-react": "^7.20.6",
|
|
||||||
"eslint-plugin-unicorn": "^21.0.0",
|
|
||||||
"get-port": "^5.1.1",
|
"get-port": "^5.1.1",
|
||||||
"prettier": "^2.3.1",
|
"prettier": "^2.3.1",
|
||||||
"puppeteer": "^17.1.3",
|
"puppeteer": "^17.1.3",
|
||||||
"rimraf": "^3.0.2",
|
"rimraf": "^3.0.2",
|
||||||
"tree-kill": "^1.2.0",
|
"tree-kill": "^1.2.0",
|
||||||
"typescript": "^5.9.2",
|
"typescript": "^5.9.2",
|
||||||
|
"typescript-eslint": "^8.38.0",
|
||||||
"wait-on": "^5.3.0"
|
"wait-on": "^5.3.0"
|
||||||
},
|
},
|
||||||
"eslintConfig": {
|
|
||||||
"extends": "react-app"
|
|
||||||
},
|
|
||||||
"browserslist": {
|
"browserslist": {
|
||||||
"production": [
|
"production": [
|
||||||
">0.2%",
|
">0.2%",
|
||||||
|
|
|
||||||
|
|
@ -73,7 +73,6 @@ export class CurrentUser {
|
||||||
url: config.get('url') + 'client',
|
url: config.get('url') + 'client',
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
data: {name},
|
data: {name},
|
||||||
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
||||||
headers: {Authorization: 'Basic ' + btoa(username + ':' + password)},
|
headers: {Authorization: 'Basic ' + btoa(username + ':' + password)},
|
||||||
})
|
})
|
||||||
.then((resp: AxiosResponse<IClient>) => {
|
.then((resp: AxiosResponse<IClient>) => {
|
||||||
|
|
@ -97,10 +96,8 @@ export class CurrentUser {
|
||||||
return Promise.reject();
|
return Promise.reject();
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return axios
|
||||||
axios
|
|
||||||
.create()
|
.create()
|
||||||
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
||||||
.get(config.get('url') + 'current/user', {headers: {'X-Gotify-Key': this.token()}})
|
.get(config.get('url') + 'current/user', {headers: {'X-Gotify-Key': this.token()}})
|
||||||
.then((passThrough) => {
|
.then((passThrough) => {
|
||||||
this.user = passThrough.data;
|
this.user = passThrough.data;
|
||||||
|
|
@ -130,8 +127,7 @@ export class CurrentUser {
|
||||||
this.logout();
|
this.logout();
|
||||||
}
|
}
|
||||||
return Promise.reject(error);
|
return Promise.reject(error);
|
||||||
})
|
});
|
||||||
);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
public logout = async () => {
|
public logout = async () => {
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,6 @@ export interface IConfig {
|
||||||
version: IVersion;
|
version: IVersion;
|
||||||
}
|
}
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
||||||
declare global {
|
declare global {
|
||||||
interface Window {
|
interface Window {
|
||||||
config?: Partial<IConfig>;
|
config?: Partial<IConfig>;
|
||||||
|
|
|
||||||
|
|
@ -25,8 +25,7 @@ export type Stores<T extends AllStores> = Pick<StoreMapping, T>;
|
||||||
|
|
||||||
export const inject =
|
export const inject =
|
||||||
<I extends AllStores>(...stores: I[]) =>
|
<I extends AllStores>(...stores: I[]) =>
|
||||||
// eslint-disable-next-line @typescript-eslint/ban-types
|
<P extends object>(
|
||||||
<P extends {}>(
|
|
||||||
node: React.ComponentType<P>
|
node: React.ComponentType<P>
|
||||||
): React.ComponentType<Pick<P, Exclude<keyof P, I>>> =>
|
): React.ComponentType<Pick<P, Exclude<keyof P, I>>> =>
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
|
|
|
||||||
|
|
@ -30,6 +30,7 @@ const styles = (theme: Theme) =>
|
||||||
minHeight: '100%',
|
minHeight: '100%',
|
||||||
height: '100vh',
|
height: '100vh',
|
||||||
},
|
},
|
||||||
|
// eslint-disable-next-line
|
||||||
toolbar: theme.mixins.toolbar as any,
|
toolbar: theme.mixins.toolbar as any,
|
||||||
link: {
|
link: {
|
||||||
color: 'inherit',
|
color: 'inherit',
|
||||||
|
|
|
||||||
|
|
@ -211,7 +211,6 @@ class ConfigurerPanel extends Component<IConfigurerPanelProps, {unsavedChanges:
|
||||||
className="config-save"
|
className="config-save"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
const newConfig = this.state.unsavedChanges;
|
const newConfig = this.state.unsavedChanges;
|
||||||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
||||||
this.props.save(newConfig!).then(() => {
|
this.props.save(newConfig!).then(() => {
|
||||||
this.setState({unsavedChanges: null});
|
this.setState({unsavedChanges: null});
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -99,7 +99,6 @@ describe('Client', () => {
|
||||||
|
|
||||||
expect(await count(page, $table.rows())).toBe(2);
|
expect(await count(page, $table.rows())).toBe(2);
|
||||||
});
|
});
|
||||||
// eslint-disable-next-line
|
|
||||||
it('deletes own client', async () => {
|
it('deletes own client', async () => {
|
||||||
await page.click($table.cell(1, Col.Delete, '.delete'));
|
await page.click($table.cell(1, Col.Delete, '.delete'));
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,6 @@ beforeAll(async () => {
|
||||||
|
|
||||||
afterAll(async () => await gotify.close());
|
afterAll(async () => await gotify.close());
|
||||||
|
|
||||||
// eslint-disable-next-line
|
|
||||||
const axiosAuth = {auth: {username: 'admin', password: 'admin'}};
|
const axiosAuth = {auth: {username: 'admin', password: 'admin'}};
|
||||||
|
|
||||||
let windowsServerToken: string;
|
let windowsServerToken: string;
|
||||||
|
|
@ -36,7 +35,6 @@ const navigate = async (appName: string) => {
|
||||||
await waitForExists(page, selector.heading(), appName);
|
await waitForExists(page, selector.heading(), appName);
|
||||||
};
|
};
|
||||||
|
|
||||||
// eslint-disable-next-line
|
|
||||||
describe('Messages', () => {
|
describe('Messages', () => {
|
||||||
it('does login', async () => await auth.login(page));
|
it('does login', async () => await auth.login(page));
|
||||||
it('is on messages', async () => {
|
it('is on messages', async () => {
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ import rimraf from 'rimraf';
|
||||||
import path from 'path';
|
import path from 'path';
|
||||||
import puppeteer, {Browser, Page} from 'puppeteer';
|
import puppeteer, {Browser, Page} from 'puppeteer';
|
||||||
import fs from 'fs';
|
import fs from 'fs';
|
||||||
// @ts-ignore
|
// @ts-expect-error no types
|
||||||
import wait from 'wait-on';
|
import wait from 'wait-on';
|
||||||
import kill from 'tree-kill';
|
import kill from 'tree-kill';
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
// eslint-disable-next-line
|
||||||
import Notify = require('notifyjs');
|
import Notify = require('notifyjs');
|
||||||
export as namespace notifyjs;
|
export as namespace notifyjs;
|
||||||
export = Notify;
|
export = Notify;
|
||||||
|
|
|
||||||
1509
ui/yarn.lock
1509
ui/yarn.lock
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue