mirror of
https://github.com/AdguardTeam/AdGuardHome.git
synced 2025-12-20 01:11:03 +08:00
added typecheck on build, fixed eslint
Some checks failed
build / test (macOS-latest) (push) Has been cancelled
build / test (ubuntu-latest) (push) Has been cancelled
build / test (windows-latest) (push) Has been cancelled
build / build-release (push) Has been cancelled
build / notify (push) Has been cancelled
lint / go-lint (push) Has been cancelled
lint / eslint (push) Has been cancelled
lint / notify (push) Has been cancelled
Some checks failed
build / test (macOS-latest) (push) Has been cancelled
build / test (ubuntu-latest) (push) Has been cancelled
build / test (windows-latest) (push) Has been cancelled
build / build-release (push) Has been cancelled
build / notify (push) Has been cancelled
lint / go-lint (push) Has been cancelled
lint / eslint (push) Has been cancelled
lint / notify (push) Has been cancelled
This commit is contained in:
1
Makefile
1
Makefile
@@ -106,6 +106,7 @@ build-release: $(BUILD_RELEASE_DEPS_$(FRONTEND_PREBUILT))
|
||||
|
||||
js-build: ; $(NPM) $(NPM_FLAGS) run build-prod
|
||||
js-deps: ; $(NPM) $(NPM_INSTALL_FLAGS) ci
|
||||
js-typecheck: ; $(NPM) $(NPM_FLAGS) run typecheck
|
||||
js-lint: ; $(NPM) $(NPM_FLAGS) run lint
|
||||
js-test: ; $(NPM) $(NPM_FLAGS) run test
|
||||
js-test-e2e: ; $(NPM) $(NPM_FLAGS) run test:e2e
|
||||
|
||||
@@ -54,7 +54,7 @@
|
||||
|
||||
set -e -f -u -x
|
||||
|
||||
make VERBOSE=1 js-deps js-lint js-test
|
||||
make VERBOSE=1 js-deps js-typecheck js-lint js-test
|
||||
'final-tasks':
|
||||
- 'clean'
|
||||
'requirements':
|
||||
|
||||
22
client/.eslintrc.json
vendored
22
client/.eslintrc.json
vendored
@@ -1,5 +1,7 @@
|
||||
{
|
||||
"plugins": ["prettier"],
|
||||
"plugins": [
|
||||
"prettier"
|
||||
],
|
||||
"extends": [
|
||||
"airbnb-base",
|
||||
"prettier",
|
||||
@@ -21,12 +23,23 @@
|
||||
},
|
||||
"import/resolver": {
|
||||
"node": {
|
||||
"extensions": [".js", ".jsx", ".ts", ".tsx"]
|
||||
"extensions": [
|
||||
".js",
|
||||
".jsx",
|
||||
".ts",
|
||||
".tsx"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"rules": {
|
||||
"@typescript-eslint/no-explicit-any": "off",
|
||||
"@typescript-eslint/no-unused-vars": [
|
||||
"error",
|
||||
{
|
||||
"argsIgnorePattern": "^_"
|
||||
}
|
||||
],
|
||||
"import/extensions": [
|
||||
"error",
|
||||
"ignorePackages",
|
||||
@@ -43,7 +56,10 @@
|
||||
"no-console": [
|
||||
"warn",
|
||||
{
|
||||
"allow": ["warn", "error"]
|
||||
"allow": [
|
||||
"warn",
|
||||
"error"
|
||||
]
|
||||
}
|
||||
],
|
||||
"import/no-extraneous-dependencies": [
|
||||
|
||||
5
client/package.json
vendored
5
client/package.json
vendored
@@ -7,9 +7,8 @@
|
||||
"build-prod": "cross-env BUILD_ENV=prod webpack --config webpack.prod.js",
|
||||
"watch": "cross-env BUILD_ENV=dev webpack --config webpack.dev.js --watch",
|
||||
"watch:hot": "cross-env BUILD_ENV=dev webpack-dev-server --config webpack.dev.js",
|
||||
"lint": "echo 'Lint temporarily disabled'",
|
||||
"lint-new": "eslint './src/**/*.(ts|tsx)'",
|
||||
"lint:fix": "eslint './src/**/*.(ts|tsx)' --fix",
|
||||
"lint": "eslint --ext .ts,.tsx src",
|
||||
"lint:fix": "eslint --ext .ts,.tsx src --fix",
|
||||
"test": "vitest --run",
|
||||
"test:watch": "vitest --watch",
|
||||
"test:e2e": "npx playwright test tests/e2e",
|
||||
|
||||
@@ -29,7 +29,7 @@ import { BUTTON_PREFIX } from './Cells/helpers';
|
||||
import AnonymizerNotification from './AnonymizerNotification';
|
||||
import { RootState } from '../../initialState';
|
||||
|
||||
const processContent = (data: any, buttonType: string) =>
|
||||
const processContent = (data: any, _buttonType: string) =>
|
||||
Object.entries(data).map(([key, value]) => {
|
||||
if (!value) {
|
||||
return null;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import React from 'react';
|
||||
import { Trans, withTranslation } from 'react-i18next';
|
||||
|
||||
import Guide from '../ui/Guide';
|
||||
import { Guide } from '../ui/Guide';
|
||||
|
||||
import Card from '../ui/Card';
|
||||
|
||||
@@ -14,10 +14,7 @@ interface SetupGuideProps {
|
||||
t: (id: string) => string;
|
||||
}
|
||||
|
||||
const SetupGuide = ({
|
||||
t,
|
||||
dashboard: { dnsAddresses },
|
||||
}: SetupGuideProps) => (
|
||||
const SetupGuide = ({ t, dashboard: { dnsAddresses } }: SetupGuideProps) => (
|
||||
<div className="guide">
|
||||
<PageTitle title={t('setup_guide')} />
|
||||
|
||||
|
||||
@@ -346,7 +346,7 @@ interface GuideProps {
|
||||
dnsAddresses?: unknown[];
|
||||
}
|
||||
|
||||
const Guide = ({ dnsAddresses }: GuideProps) => {
|
||||
export const Guide = ({ dnsAddresses }: GuideProps) => {
|
||||
const { t } = useTranslation();
|
||||
|
||||
const serverName = useSelector((state: RootState) => state.encryption?.server_name);
|
||||
@@ -381,5 +381,3 @@ const Guide = ({ dnsAddresses }: GuideProps) => {
|
||||
Guide.defaultProps = {
|
||||
dnsAddresses: [],
|
||||
};
|
||||
|
||||
export default Guide;
|
||||
|
||||
@@ -1 +1 @@
|
||||
export { default } from './Guide';
|
||||
export * from './Guide';
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { connect } from 'react-redux';
|
||||
|
||||
import { toggleProtection, getClients } from '../actions';
|
||||
import { getStats, getStatsConfig, setStatsConfig } from '../actions/stats';
|
||||
import { getStats, getStatsConfig } from '../actions/stats';
|
||||
import { getAccessList } from '../actions/access';
|
||||
|
||||
import Dashboard from '../components/Dashboard';
|
||||
@@ -19,7 +19,7 @@ type DispatchProps = {
|
||||
getStats: (...args: unknown[]) => unknown;
|
||||
getStatsConfig: (...args: unknown[]) => unknown;
|
||||
getAccessList: () => (dispatch: any) => void;
|
||||
}
|
||||
};
|
||||
|
||||
const mapDispatchToProps: DispatchProps = {
|
||||
toggleProtection,
|
||||
|
||||
@@ -2,7 +2,7 @@ import React from 'react';
|
||||
|
||||
import { Trans } from 'react-i18next';
|
||||
|
||||
import Guide from '../../components/ui/Guide';
|
||||
import { Guide } from '../../components/ui/Guide';
|
||||
|
||||
import Controls from './Controls';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user