score:13

Accepted answer

as @mark-willian told me, i added some lines in my .eslintrc and it works:

{
    "env": {
        "browser": true,
        "es6": true,
        "node": true
    },
    "extends": "airbnb",
    "parser": "babel-eslint",
    "rules": {
        "indent": [2, "tab", { "switchcase": 1, "variabledeclarator": 1 }],
        "no-tabs": 0,
        "react/prop-types": 0,
        "react/jsx-indent": [2, "tab"],
        "react/jsx-indent-props": [2, "tab"],
    }
}

thank you for all of your answers.

score:0

try replace every tab to spaces.

it is also a good idea to enable the eslint autofix feature with this eslint-loader option in your webpack configuration.

score:0

you can add this comment on page which you get no-tabs error.

/* eslint-disable */

score:2

the airbnb rules want you to use spaces instead of tabs for formatting your code. good editors (sublime is one!) will let you use tabs but translate them to spaces when saving your code.

you need to change the config of your sublime; go to preferences-settings and customize the following settings:

"tab_size": 2,
"translate_tabs_to_spaces": true

sublime will convert your existing code - click on the text in the status bar at the bottom right that says tabs or spaces.

you can selectively turn off eslint rules if (for example) one of airbnb's rules doesn't match your coding style guide.


Related Query

More Query from same tag