Why is eslint throwing this error? The Javascript runs without issue inside of React Native. The code was taken from the react-navigation example at : https://reactnavigation.org/docs/intro/ Javascript: eslint error: .eslintrc.js file: Answer The syntax is not yet standardised, but a stage-2 proposal for inclusion in Javascript (see “Class Fields” on https://github.com/tc39/proposals). Try adding the following option above “extends” in your
Tag: eslint
How to configure ESLint so that it disallows default exports
I’ve been searching the web and StackOverflow for this for quite some time with no success. What I’m trying to do have ESLint mark the following as errors: with default being the key here. So far the best I’ve got is a reference to eslint-plugin-import plugin and some of its rules that can make me closer to the target, namely
eslint: error Parsing error: The keyword ‘const’ is reserved
I am getting this error from ESLint: from this code: I’ve tried removing node_modules and reinstalling all npm packages (as suggested here), but to no avail. Answer ESLint defaults to ES5 syntax-checking. You’ll want to override to the latest well-supported version of JavaScript. Try adding a .eslintrc.json file to your project. Inside it: Hopefully this helps. EDIT: I also found
ESLint with React gives `no-unused-vars` errors
I’ve setup eslint & eslint-plugin-react. When I run ESLint, the linter returns no-unused-vars errors for each React component. I’m assuming it’s not recognizing that I’m using JSX or React syntax. Any ideas? Example: app.js Linter Errors: Here is my .eslintrc.json file: Answer First, install the following module npm install –save-dev eslint-plugin-react. Then, in your .eslintrc.json, under extends, include the following
Inline eslint comment in JSX
I’m getting an error (eslint): Line 199 exceeds maximum line length of 120. (max-len) Why doesn’t this inline comment work? Answer eslint-disable-line and eslint-disable-next-line are only in inline comments. There is currently an open issue for this in eslint So you would have to write it as the following:
ESLint ES6 Redux global-required Unexpected require();
I have this problem with ESLint and can’t soulve on my own, those stores are separated for each enviroement as you can see on the screenshot, how could I fix that to make ESLint happy and I to learn a new thing? Answer It’s because you’re requiring in branched code: http://eslint.org/docs/rules/global-require. If you don’t want to change your code, just
Eslint – Maximum call stack size exceeded
Working in a React / Webpack project I started to have problems with the eslint library. The eslint package is downloaded using npm and it’s used to validate the project using a webpack preLoader. It used to work fine until recently when I tried to git clone the same project to an other folder. After installing the dependencies “npm install”
Alternative to nested ternary operator in JS [closed]
Closed. This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 7 months ago. Improve this question I personally love ternary operators, and in my humble opinion, they make complicated expressions very easy to digest. Take this one: