Skip to content

Commit

Permalink
remove airbnb rules conflicting with prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
shaharmor committed Jan 10, 2021
1 parent 7376198 commit bf790c7
Showing 1 changed file with 0 additions and 62 deletions.
62 changes: 0 additions & 62 deletions airbnb-compatibility.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
const { rules: baseBestPracticesRules } = require('eslint-config-airbnb-base/rules/best-practices');
const { rules: baseErrorsRules } = require('eslint-config-airbnb-base/rules/errors');
const { rules: baseES6Rules } = require('eslint-config-airbnb-base/rules/es6');
const { rules: baseStyleRules } = require('eslint-config-airbnb-base/rules/style');
const { rules: baseVariablesRules } = require('eslint-config-airbnb-base/rules/variables');

module.exports = {
// replace Airbnb 'brace-style' rule with '@typescript-eslint' version
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/brace-style.md
'brace-style': 'off',
'@typescript-eslint/brace-style': baseStyleRules['brace-style'],

// replace Airbnb 'camelcase' rule with '@typescript-eslint/naming-convention'
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/naming-convention.md
camelcase: 'off',
Expand All @@ -33,42 +27,11 @@ module.exports = {
},
],

// replace Airbnb 'comma-dangle' rule with '@typescript-eslint' version
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/comma-dangle.md
// the TypeScript version also adds 3 new options, all of which should be set to the same value as the base config
'comma-dangle': 'off',
'@typescript-eslint/comma-dangle': [baseStyleRules['comma-dangle'][0], {
...baseStyleRules['comma-dangle'][1],
enums: baseStyleRules['comma-dangle'][1].arrays,
generics: baseStyleRules['comma-dangle'][1].arrays,
tuples: baseStyleRules['comma-dangle'][1].arrays,
}],

// replace Airbnb 'comma-spacing' rule with '@typescript-eslint' version
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/comma-spacing.md
'comma-spacing': 'off',
'@typescript-eslint/comma-spacing': baseStyleRules['comma-spacing'],

// replace Airbnb 'dot-notation' rule with '@typescript-eslint' version
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/dot-notation.md
'dot-notation': 'off',
'@typescript-eslint/dot-notation': baseBestPracticesRules['dot-notation'],

// replace Airbnb 'func-call-spacing' rule with '@typescript-eslint' version
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/func-call-spacing.md
'func-call-spacing': 'off',
'@typescript-eslint/func-call-spacing': baseStyleRules['func-call-spacing'],

// replace Airbnb 'indent' rule with '@typescript-eslint' version
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/indent.md
indent: 'off',
'@typescript-eslint/indent': baseStyleRules.indent,

// replace Airbnb 'keyword-spacing' rule with '@typescript-eslint' version
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/keyword-spacing.md
'keyword-spacing': 'off',
'@typescript-eslint/keyword-spacing': baseStyleRules['keyword-spacing'],

// replace Airbnb 'lines-between-class-members' rule with '@typescript-eslint' version
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/lines-between-class-members.md
'lines-between-class-members': 'off',
Expand All @@ -89,16 +52,6 @@ module.exports = {
'no-empty-function': 'off',
'@typescript-eslint/no-empty-function': baseBestPracticesRules['no-empty-function'],

// replace Airbnb 'no-extra-parens' rule with '@typescript-eslint' version
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-extra-parens.md
'no-extra-parens': 'off',
'@typescript-eslint/no-extra-parens': baseErrorsRules['no-extra-parens'],

// replace Airbnb 'no-extra-semi' rule with '@typescript-eslint' version
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-extra-semi.md
'no-extra-semi': 'off',
'@typescript-eslint/no-extra-semi': baseErrorsRules['no-extra-semi'],

// replace Airbnb 'no-implied-eval' and 'no-new-func' rules with '@typescript-eslint' version
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-implied-eval.md
'no-implied-eval': 'off',
Expand Down Expand Up @@ -149,19 +102,4 @@ module.exports = {
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-useless-constructor.md
'no-useless-constructor': 'off',
'@typescript-eslint/no-useless-constructor': baseES6Rules['no-useless-constructor'],

// replace Airbnb 'quotes' rule with '@typescript-eslint' version
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/quotes.md
quotes: 'off',
'@typescript-eslint/quotes': baseStyleRules.quotes,

// replace Airbnb 'semi' rule with '@typescript-eslint' version
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/semi.md
semi: 'off',
'@typescript-eslint/semi': baseStyleRules.semi,

// replace Airbnb 'space-before-function-paren' rule with '@typescript-eslint' version
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/space-before-function-paren.md
'space-before-function-paren': 'off',
'@typescript-eslint/space-before-function-paren': baseStyleRules['space-before-function-paren'],
}

0 comments on commit bf790c7

Please sign in to comment.