Parsing Error The Keyword import is Reserved (SublimeLinter-contrib-eslint)
Add this to the root of your .eslintrc.json (formerly .eslintrc) “parser”: “babel-eslint” and make sure to run: npm install babel-eslint –save-dev
Add this to the root of your .eslintrc.json (formerly .eslintrc) “parser”: “babel-eslint” and make sure to run: npm install babel-eslint –save-dev
Exporting an arrow function directly doesn’t give the component a displayName, but if you export a regular function the function name will be used as displayName. export default function MyComponent() { return ( <Switch> <Route path=”/login” exact component={LoginApp}/> <Route path=”/faq” exact component={FAQ}/> <Route component={NotFound} /> </Switch> ); } You can also put the function in … Read more
(Described steps and screenshots are from IntelliJ IDEA 2017.2) You can add a keyboard shortcut to action ‘Fix ESLint Problem’. Ensure plugin ‘JavaScript Support’ is installed and enabled. First got to Preferences | Language & Frameworks | JavaScript | Code Quality Tools | ESLint and enable it. You will need to define your ‘Node interpreter’, … Read more
I don’t see any v-slot in the code you provided so I can show you only my usecase. With Eslint error: <template v-slot:item.actions=”{ item }”> Without error: <template v-slot:[`item.actions`]=”{ item }”>
I think you need to install eslint-config-prettier see here
Yes, create-react-app comes with eslint config. How do I enable and extend it correctly? You can check how to extend it here. { “eslintConfig”: { “extends”: [“react-app”, “shared-config”], “rules”: { “additional-rule”: “warn” }, “overrides”: [ { “files”: [“**/*.ts?(x)”], “rules”: { “additional-typescript-only-rule”: “warn” } } ] } } How do I enable it? You need to … Read more
({ latitude, longitude } = props.userLocation.coords); Destructuring needs to be either after a let, const or var declaration or it needs to be in an expression context to distinguish it from a block statement.
I think the use of “plugin:@typescript-eslint/eslint-recommended” introduces bunch of unwanted rules. One is probably better off using “@typescript-eslint/no-unused-vars” ESLint rule instead. { “parser”: “@typescript-eslint/parser”, “plugins”: [ “@typescript-eslint”, ], “extends”: [ “eslint:recommended”, “plugin:@typescript-eslint/recommended”, ], “rules”: { “no-unused-vars”: “off”, “@typescript-eslint/no-unused-vars”: [“error”] } } Reference – https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-unused-vars.md
if you have only one file you want to disable prop-type validation you can use: /* eslint react/prop-types: 0 */ in cases where you have multiple files you can add to your .eslintrc file in your root directory a rule to disable prop-type validation: { “plugins”: [ “react” ], “rules”: { “react/prop-types”: 0 } } … Read more
First, install the following module npm install –save-dev eslint-plugin-react. Then, in your .eslintrc.json, under extends, include the following plugin: ‘extends’: [ ‘plugin:react/recommended’ ] Source