chore(style): modify eslint rules (#1011)

* chore(style): use strict rules

* chore: modify position

* chore(style): warn about `console.log` and `==`

* fix: fix `console.log` error

* Update CropperDiv.js

* Update HomePage.js

Co-authored-by: Yang Luo <hsluoyz@qq.com>
This commit is contained in:
q1anx1
2022-08-13 00:04:18 +08:00
committed by GitHub
parent 6676cc8ff3
commit a741c5179a
5 changed files with 14 additions and 9 deletions

View File

@ -55,6 +55,7 @@ export function register(config) {
// Add some additional logging to localhost, pointing developers to the
// service worker/PWA documentation.
navigator.serviceWorker.ready.then(() => {
// eslint-disable-next-line no-console
console.log(
"This web app is being served cache-first by a service " +
"worker. To learn more, visit https://bit.ly/CRA-PWA"
@ -83,6 +84,7 @@ function registerValidSW(swUrl, config) {
// At this point, the updated precached content has been fetched,
// but the previous service worker will still serve the older
// content until all client tabs are closed.
// eslint-disable-next-line no-console
console.log(
"New content is available and will be used when all " +
"tabs for this page are closed. See https://bit.ly/CRA-PWA."
@ -96,6 +98,7 @@ function registerValidSW(swUrl, config) {
// At this point, everything has been precached.
// It's the perfect time to display a
// "Content is cached for offline use." message.
// eslint-disable-next-line no-console
console.log("Content is cached for offline use.");
// Execute callback
@ -108,6 +111,7 @@ function registerValidSW(swUrl, config) {
};
})
.catch(error => {
// eslint-disable-next-line no-console
console.error("Error during service worker registration:", error);
});
}
@ -136,6 +140,7 @@ function checkValidServiceWorker(swUrl, config) {
}
})
.catch(() => {
// eslint-disable-next-line no-console
console.log(
"No internet connection found. App is running in offline mode."
);
@ -149,6 +154,7 @@ export function unregister() {
registration.unregister();
})
.catch(error => {
// eslint-disable-next-line no-console
console.error(error.message);
});
}