Skip to content

Inherit eslint-config-airbnb-base, but restrict use of import #1315

@kachkaev

Description

@kachkaev

Hi guys,

Sorry for polluting the issues, but I think that my question is something that others are likely to search for here too.

After the recent release of node 7.6 with async/await supported even without --harmony, I decided to drop babel from my node app, but keep linting rules from airbnb-base. Because bare node still does not support import * from syntax, I wanted to inherit the esling config, but introduce a rule that would report occurrences of import/export as errors, while keeping require & module.exports acceptable. Sadly, after two hours I'm still when I have started, i.e. both import and require are considered acceptable by eslint.

Could anyone suggest what one should put in their eslintConfig in addition to extends: "eslint-config-airbnb-base" to achieve a proper alignment with what node 7 can do on its own?

One important thing to change that I have discovered by now is this:

  parserOptions: {
    ecmaFeatures: {
      experimentalObjectRestSpread: false,
    },
  },

Cheers!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions