Enable eslint import checks and fixed the reported errors (#878)

Summary:
Pull Request resolved: https://github.com/facebook/flipper/pull/878

1) Enabled eslint error reporting for unresolved imports and fixed all the errors
2) Enabled eslint for typings (d.ts) and fixed all the errors

Reviewed By: passy

Differential Revision: D20335151

fbshipit-source-id: 7b142281a406b32df0f02a5cd0d7d05eba941acd
This commit is contained in:
Anton Nikolaev
2020-03-14 14:26:07 -07:00
committed by Facebook GitHub Bot
parent 85c13bb1f3
commit beb5c85e69
25 changed files with 1201 additions and 174 deletions

View File

@@ -25,7 +25,13 @@ module.exports = {
parser: 'babel-eslint',
root: true,
extends: 'fbjs',
plugins: [...fbjs.plugins, 'header', 'prettier', '@typescript-eslint'],
plugins: [
...fbjs.plugins,
'header',
'prettier',
'@typescript-eslint',
'import',
],
rules: {
// disable rules from eslint-config-fbjs
'react/react-in-jsx-scope': 0, // not needed with our metro implementation
@@ -53,6 +59,16 @@ module.exports = {
'header/header': [2, 'block', {pattern}],
'prettier/prettier': [2, prettierConfig],
'flowtype/object-type-delimiter': [0],
// import
'import/no-unresolved': [2, {commonjs: true, amd: true}],
},
settings: {
'import/resolver': {
typescript: {
extensions: ['.js', '.jsx', '.ts', '.tsx'],
},
},
},
overrides: [
{