0

Package devDependencies:

"babel-cli": "^6.26.0",
"babel-eslint": "^10.0.1",
"babel-preset-flow": "^6.23.0",
"eslint": "^5.9.0",
"eslint-config-standard": "^12.0.0",
"eslint-plugin-flowtype": "^3.2.0",
"eslint-plugin-import": "^2.14.0",
"eslint-plugin-node": "^8.0.0",
"eslint-plugin-promise": "^4.0.1",
"eslint-plugin-standard": "^4.0.0",
"nodemon": "^1.18.7"

.eslitrc file:

module.exports = {
  "extends": [
    "standard",
    "plugin:flowtype/recommended",
  ],
  "parser": "babel-eslint",
  "plugins": [
    "flowtype"
  ]
};

.babelrc file:

{
  "presets": ["flow"]
}

Sample js file from the project:

/* @flow */

module.exports = function (app, db) {
  test: string // The problem occurs here
  // More code below ...
}

The problem is linter gives messages in reference to "test: string":

[eslint] Unexpected labeled statement. [no-labels]

[eslint] Expected an assignment or function call and instead saw an expression. [no-unused-expressions]

[eslint] 'string' is not defined. [no-undef]

I noticed that both extensions work fine separately. The problem occurs when I'm trying to use them both together like in .eslintrc file above.

Community
  • 1
  • 1
Marek
  • 27
  • 5

0 Answers0