Skip to content

Additional Notes

Aditya Mukherjee edited this page May 6, 2018 · 8 revisions

ESLint Configuration

ESLint is not enabled by default. To enable it, you will need to add a config file to your root folder. A useful version should have the following in it:

module.exports = {
  extends: "airbnb-base",                           // a good set of base rules to extend
  plugins: ["react"],                               // react specific rules
    ...
    "import/extensions": "never",                   // to not need extensions
    "import/no-extraneous-dependencies": "never",   // to allow local modules
  },
  settings: {
    "import/resolver": {
      webpack: true,                                // use webpack's resolve list
    }
  },
  parserOptions: {
    sourceType: "module",                           // allow 'import' & 'export'
    ecmaFeatures: {
      jsx: true
    }
  },
  ...
};

The above needs the following extra dependencies:

eslint
eslint-config-airbnb-base
eslint-import-resolver-webpack
eslint-plugin-import
eslint-plugin-react

Stylelint Configuration

To enable Stylelint, you'll need to add a config file.

You will also need the following modules:

stylelint

Babel Configuration

You will need at least the following in your .babelrc to let babel-loader build React correctly:

{
  "presets": ["env", "react"]
}

The above needs the following dependencies:

babel-preset-env
babel-preset-react

Other Configurations

ESLint
Stylelint Babel

Clone this wiki locally