Why does this invoke the comma rule in eslint?

This looks correct to me, but why does eslint show a rule violation, is there no comma-dangle at the end of the last credentials property?

  dispatch({ type: LOGIN_USER, payload: credentials }); 

.eslintrc

 { "extends": "airbnb", "globals": { "__DEV__": true }, "rules": { "react/jsx-quotes": 0, "jsx-quotes": [2, "prefer-double"] } } 
+5
source share
1 answer

According to the configuration of airbnb rule is set as follows: comma-dangle: [2, "always-multiline"] .

Accordingly, the expected code

  dispatch({ type: LOGIN_USER, payload: credentials, }); 

Expected at the end.

Additional policy information: http://eslint.org/docs/rules/comma-dangle

+5
source

Source: https://habr.com/ru/post/1234615/


All Articles