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