A control must be associated with a text label

That message actually comes from the control-has-associated-label rule. The rule is triggered by the role=”button” attribute. That turns your <i /> into a control, so it needs a text label for accessibility reasons (so screen readers know what to read out, for example). To comply with the rule, you can either give the “button” textual … Read more

Eslint glob (**) is not considering all directories recursively

The problem is likely missing quotes around the glob path. Change this (not working): “lint”: “eslint ./src/**/*.js” To this (working): “lint”: “eslint ‘./src/**/*.js'” The ESLint docs say this: Please note that when passing a glob as a parameter, it is expanded by your shell. The results of the expansion can vary depending on your shell, … Read more

“Import in body of module; reorder to top import/first” Across Many Files

you will get this error if you declare variable in between your imports, import React from ‘react’; import axios from ‘axios’; const URL = process.env.REACT_APP_API_BASE; import demoXLXSFile from ‘../../assets/others/Demo.xlsx’; import ‘./student.list.styles.scss’; declare variables after importing everything, import React from ‘react’; import axios from ‘axios’; import demoXLXSFile from ‘../../assets/others/Demo.xlsx’; import ‘./student.list.styles.scss’; const URL = process.env.REACT_APP_API_BASE;

ESLint warning ES6 consistent-return rule

http://eslint.org/docs/rules/consistent-return says: This rule requires return statements to either always or never specify values. When your if-condition is not met, the arrow function will terminate without encountering a return statement, which violates this rule. Your second version violates this rule because your second return does not specify a value, contrary to the first return. The … Read more

Different eslint rules based on file extension

This was added. Example from the docs: { “rules”: { “quotes”: [ 2, “double” ] }, “overrides”: [ { “files”: [ “bin/*.js”, “lib/*.js” ], “excludedFiles”: “*.test.js”, “rules”: { “quotes”: [ 2, “single” ] } } ] } Effecitively you can supply globs and a set of rules that override the default rules for files that … Read more

Eslint does not recognize private field declaration using nodejs 12

2021 Update: You do not need babel for this anymore! You can simply update eslint to v8.0.0 and above. See eslint release notes: https://eslint.org/blog/2021/10/eslint-v8.0.0-released#highlights Make sure this is in your .eslintrc file or similar: { “parserOptions”: { “ecmaVersion”: 13 } } You can also just use latest instead of specifically version 13.

Using forwardRef with proptypes and eslint

You are almost done with your third attempt. But you don’t have to use twice forwardRef, the first use with the Button declaration is enough. The display name rule is not an error (neither at JavaScript nor React level), but rather an intentional prop in order to show the “real” name of the component, used … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)