-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
switch from babel-eslint to hermes-eslint for flow code
Reviewed By: motiz88 Differential Revision: D37181192 fbshipit-source-id: 1f59e01f306792e67a4977435c5c77e0000d960a
- Loading branch information
1 parent
506fbde
commit 3281299
Showing
4 changed files
with
555 additions
and
148 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
/** | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
* | ||
* @format | ||
*/ | ||
|
||
'use strict'; | ||
|
||
module.exports = { | ||
extends: ['fbjs'], | ||
parser: 'hermes-eslint', | ||
rules: { | ||
// Consistency with internal config | ||
'no-class-assign': 'off', | ||
|
||
// This is very noisy, so disable | ||
'consistent-return': 'off', | ||
|
||
// Flow declares trip up the no-redeclare rule | ||
'no-redeclare': 'off', | ||
|
||
// Prettier and ESLint may disagree on the following rules | ||
indent: 'off', | ||
'array-bracket-spacing': 'off', | ||
'comma-dangle': 'off', | ||
'max-len': 'off', | ||
'space-before-function-paren': 'off', | ||
'flowtype/object-type-delimiter': 'off', | ||
'babel/flow-object-type': 'off', | ||
|
||
// Tests do not need to follow relay naming rules | ||
'relay/graphql-naming': 'off', | ||
|
||
// TODO T31139228: remove or re-enable these once eslint-plugin-flowtype | ||
// is compatible with babel-eslint >= 8 | ||
'no-undef': 'off', | ||
'no-unused-vars': 'off', | ||
|
||
// This has a different name internally | ||
'no-label-var': 'off', | ||
|
||
// Relay uses console statements for debugging and compile feedback | ||
'no-console': [ | ||
'warn', | ||
{ | ||
allow: [ | ||
'warn', | ||
'error', | ||
'debug', | ||
'time', | ||
'timeEnd', | ||
'timeStamp', | ||
'groupCollapsed', | ||
'groupEnd', | ||
], | ||
}, | ||
], | ||
|
||
// Duplicating some errors that are enforced internally | ||
'prefer-const': 'error', | ||
'no-trailing-spaces': 'error', | ||
|
||
// These rules are not required with hermes-eslint | ||
'ft-flow/define-flow-type': 0, | ||
'ft-flow/use-flow-type': 0, | ||
'flowtype/define-flow-type': 0, | ||
'flowtype/use-flow-type': 0, | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.