ljharb on master
[eslint config] [base] [patch] … [eslint config] [patch] extend … Merge pull request #1996 from r… (compare)
ljharb on master
[editorial] [react] fix typo [eslint config] [*] [deps] upda… (compare)
Hi, I rannpm i -g eslint-plugin-import eslint-plugin-jsx-a11y eslint-plugin-react eslint-plugin-react-hooks
but am getting this error when I try to use eslint on my file (in terminal):
Oops! Something went wrong! :(
ESLint: 6.8.0.
ESLint couldn't find the config "airbnb" to extend from. Please check that the name of the config is correct.
Would appreciate any help. Thanks!
if I replace this line of code
.then((text) => { throw new Error('Failed!') })
.catch(err => console.log(err))
.then(() => console.log('Does that execute?'));
with this
.then((text) => { console.log(text) ) })
.then(() => console.log('Does that execute?'));
Timer completed
and second Does this execute
let myFirstPromise = new Promise((resolve, reject) => {
// We call resolve(...) when what we were doing asynchronously was successful, and reject(...) when it failed.
// In this example, we use setTimeout(...) to simulate async code.
// In reality, you will probably be using something like XHR or an HTML5 API.
setTimeout( function() {
resolve("Success!") // Yay! Everything went well!
}, 250)
})
myFirstPromise.then((successMessage) => {
// successMessage is whatever we passed in the resolve(...) function above.
// It doesn't have to be a string, but if it is only a succeed message, it probably will be.
console.log("Yay! " + successMessage)
});
Yay! Success
Success
function trackUserHandler() {
navigator.geolocation.getCurrentPosition(
(position) => {
setTimeout(() => {
console.log('Position ', position);
}, 2000);
},
(error) => console.log(error)
);
/**
* This line will run before we print
* current position or throw an error
*/
setTimeout(() => {
console.log('Timer done');
}, 1000);
console.log('Getting position');
}
button.addEventListener('click', trackUserHandler);
Getting position
will be executed immediately