Category : eslint

I get eslint error and how to I fix it? const filter = state.playListSetData.filter(item => { // 若兩相符合,抓播放設定底下的其他資料 if (item.uuid === payload[i].playerList[j].uuid) { return item; } }); error Expected to return a value at the end of arrow function array-callback-return error Expected to return a value at the end of arrow function consistent-return for (let ..

Read more

I’m setting up ESLint and Prettier for my Next.js Project. I have followed one of the articles this one. Here is my package.json file (partial) so far: "lint-staged": { "*.{js,jsx}": [ "eslint ‘*/**/*.{js,jsx}’ –fix" ] } Although I have copied and pasted but couldn’t able to understand that *.{js,jsx} & */**/*.{js,jsx} what actually these patterns ..

Read more

Given this code: export default class { bar () { event.foo() arguments.foo() foo.foo() } } When you run the no-undef eslint rule, you get this back: test_controller.js 5:5 error ‘foo’ is not defined no-undef foo isn’t defined, so that error makes sense. arguments is implicit (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/arguments) so the lack of error makes sense. But where ..

Read more