Skip to content
This repository has been archived by the owner on Feb 18, 2024. It is now read-only.

Use airbnb preset defaults for eslint-plugin-babel overrides #881

Closed
edmorley opened this issue May 18, 2018 · 1 comment
Closed

Use airbnb preset defaults for eslint-plugin-babel overrides #881

edmorley opened this issue May 18, 2018 · 1 comment
Assignees
Milestone

Comments

@edmorley
Copy link
Member

The @neutrinojs/airbnb and @neutrinojs/airbnb-base presets both enable some of eslint-plugin-babel's custom rules, and switch off the corresponding default rule.

However when they enable the replacement babel/* rule, it's done with hardcoded rule options that match the eslint defaults, which in some cases doesn't match when the airbnb guide was using.

Instead, I think we should be transferring the airbnb settings across, using something like so:

const { rules: airbnbBaseStyleRules } = require('eslint-config-airbnb-base/rules/style');

  // ...
      rules: {
        'new-cap': 'off',
        'babel/new-cap': airbnbBaseStyleRules['new-cap'],
@edmorley edmorley added this to the v9 milestone Jun 1, 2018
@edmorley
Copy link
Member Author

edmorley commented Jun 8, 2018

The same also applies to @neutrinojs/standardjs.
I'll open a PR to fix all three.

@edmorley edmorley self-assigned this Jun 8, 2018
edmorley added a commit that referenced this issue Jun 8, 2018
Previously the `babel/*` rules provided by `eslint-plugin-babel` were
being set to ESLint defaults, rather than inheriting what the `airbnb`,
`airbnb-base` or `standardjs` presets had set for the original rule
that they were replacing.

In addition, all missing `eslint-plugin-babel` rules have been added:
https://github.com/babel/eslint-plugin-babel#rules

Fixes #881.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

No branches or pull requests

1 participant