Skip to content

Commit

Permalink
added typecheck on build, fixed eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
bniwredyc committed Feb 10, 2025
1 parent b3849ee commit fd12e33
Show file tree
Hide file tree
Showing 10 changed files with 31 additions and 20 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion bamboo-specs/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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':
Expand Down
22 changes: 19 additions & 3 deletions client/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{
"plugins": ["prettier"],
"plugins": [
"prettier"
],
"extends": [
"airbnb-base",
"prettier",
Expand All @@ -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",
Expand All @@ -43,7 +56,10 @@
"no-console": [
"warn",
{
"allow": ["warn", "error"]
"allow": [
"warn",
"error"
]
}
],
"import/no-extraneous-dependencies": [
Expand Down
5 changes: 2 additions & 3 deletions client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion client/src/components/Logs/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
7 changes: 2 additions & 5 deletions client/src/components/SetupGuide/index.tsx
Original file line number Diff line number Diff line change
@@ -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';

Expand All @@ -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')} />

Expand Down
4 changes: 1 addition & 3 deletions client/src/components/ui/Guide/Guide.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -381,5 +381,3 @@ const Guide = ({ dnsAddresses }: GuideProps) => {
Guide.defaultProps = {
dnsAddresses: [],
};

export default Guide;
2 changes: 1 addition & 1 deletion client/src/components/ui/Guide/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export { default } from './Guide';
export * from './Guide';
4 changes: 2 additions & 2 deletions client/src/containers/Dashboard.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -19,7 +19,7 @@ type DispatchProps = {
getStats: (...args: unknown[]) => unknown;
getStatsConfig: (...args: unknown[]) => unknown;
getAccessList: () => (dispatch: any) => void;
}
};

const mapDispatchToProps: DispatchProps = {
toggleProtection,
Expand Down
2 changes: 1 addition & 1 deletion client/src/install/Setup/Devices.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down

0 comments on commit fd12e33

Please sign in to comment.