Skip to content

Commit

Permalink
Merge pull request verdaccio#2187 from verdaccio/ui-eslint
Browse files Browse the repository at this point in the history
chore: update babel settings ui
  • Loading branch information
juanpicado authored Apr 15, 2021
2 parents e6a5ce9 + 9b12c14 commit 9f73472
Show file tree
Hide file tree
Showing 10 changed files with 201 additions and 194 deletions.
33 changes: 33 additions & 0 deletions packages/plugins/ui-theme/.babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"extends": "../../../.babelrc",
"presets": [
[
"@babel/preset-env",
{
"targets": ["last 5 versions"],
"bugfixes": true,
"modules": "auto",
"debug": false
}
],
"@babel/preset-react"
],
"plugins": ["react-hot-loader/babel", "emotion"],
"env": {
"test": {
"presets": [
[
"@babel/preset-env",
{
"bugfixes": true,
"debug": false
}
],
"@babel/preset-react",
"@babel/typescript"
],
"plugins": ["@babel/transform-runtime", "dynamic-import-node"]
}
},
"ignore": ["**/*.d.ts"]
}
16 changes: 0 additions & 16 deletions packages/plugins/ui-theme/.eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -26,22 +26,6 @@
},
"newlines-between": "always"
}],
"babel/no-invalid-this": 0,
"no-invalid-this": 0,
"no-console": ["error", { "allow": ["warn", "error"] }],
"@typescript-eslint/no-var-requires": 0,
"@typescript-eslint/array-type": "warn",
"@typescript-eslint/indent": 0,
"@typescript-eslint/explicit-member-accessibility": ["warn",
{
"accessibility": "explicit",
"overrides": {
"constructors": "off"
}
}
],
"@typescript-eslint/explicit-function-return-type": 0,
"@typescript-eslint/no-unused-vars": ["error"],
"react/display-name": 0,
"react/no-deprecated": 1,
"react/jsx-no-target-blank": 1,
Expand Down
49 changes: 0 additions & 49 deletions packages/plugins/ui-theme/babel.config.js

This file was deleted.

6 changes: 3 additions & 3 deletions packages/plugins/ui-theme/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,13 @@
"url-loader": "^4.1.1",
"validator": "13.1.1",
"wait-on": "5.2.0",
"webpack": "5.23.0",
"webpack": "5.33.2",
"webpack-bundle-analyzer": "3.8.0",
"webpack-bundle-size-analyzer": "3.1.0",
"webpack-manifest-plugin": "^3.0.0",
"webpack-cli": "^4.5.0",
"webpack-dev-server": "^3.11.0",
"webpack-merge": "^5.6.1",
"webpack-dev-server": "^3.11.2",
"webpack-merge": "^5.7.3",
"whatwg-fetch": "^3.4.1",
"xss": "1.0.8"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ const LoginDialog: React.FC<Props> = ({ onClose, open = false }) => {

return response;
} catch (e) {
// eslint-disable-next-line no-console
console.error('login error', e.message);
const error = {
type: 'error',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ const useLocalStorage = <V>(key: string, initialValue: V) => {
return item ? JSON.parse(item) : initialValue;
} catch (error) {
// If error also return initialValue
// eslint-disable-next-line no-console
console.error('An error occurred getting a sessionStorage key', error);
return initialValue;
}
Expand All @@ -28,6 +29,7 @@ const useLocalStorage = <V>(key: string, initialValue: V) => {
// Save to local storage
window.localStorage.setItem(key, JSON.stringify(valueToStore));
} catch (error) {
// eslint-disable-next-line no-console
console.error('An error occurred writing to sessionStorage', error);
}
};
Expand Down
1 change: 1 addition & 0 deletions packages/plugins/ui-theme/src/pages/home/Home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ const Home: React.FC<Props> = ({ isUserLoggedIn }) => {
setPackages(packages as never[]);
} catch (error) {
// FIXME: add dialog
// eslint-disable-next-line no-console
console.error({
title: 'Warning',
message: `Unable to load package list: ${error.message}`,
Expand Down
1 change: 1 addition & 0 deletions packages/plugins/ui-theme/src/providers/API/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ class API {
if (response[0]) {
resolve(response[1]);
} else {
// eslint-disable-next-line no-console
console.error(response);
reject(new Error('something went wrong'));
}
Expand Down
1 change: 1 addition & 0 deletions packages/plugins/ui-theme/src/utils/login.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export function isTokenExpire(token: string | null): boolean {
try {
exp = JSON.parse(Base64.decode(payload)).exp;
} catch (error) {
// eslint-disable-next-line no-console
console.error('Invalid token:', error, token);
return true;
}
Expand Down
Loading

0 comments on commit 9f73472

Please sign in to comment.