Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 67 additions & 3 deletions .eslintrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,13 @@ env:
reportUnusedDisableDirectives: true
plugins:
- flowtype
- import

rules:
##############################################################################
# `eslint-plugin-flowtype` rule list based on `v4.6.x`
# https://github.com/gajus/eslint-plugin-flowtype#eslint-plugin-flowtype
##############################################################################

flowtype/array-style-complex-type: error
flowtype/array-style-simple-type: error
Expand Down Expand Up @@ -55,9 +58,66 @@ rules:
flowtype/space-before-type-colon: off
flowtype/union-intersection-spacing: off

##################################################
##############################################################################
# `eslint-plugin-import` rule list based on `v2.20.x`
# https://github.com/benmosher/eslint-plugin-import
##############################################################################

# Static analysis
# https://github.com/benmosher/eslint-plugin-import#static-analysis
import/no-unresolved: error
import/named: error
import/default: error
import/namespace: error
import/no-restricted-paths: off
import/no-absolute-path: error
import/no-dynamic-require: error
import/no-internal-modules: off
import/no-webpack-loader-syntax: error
import/no-self-import: error
import/no-cycle: off # TODO
import/no-useless-path-segments: off # TODO
import/no-relative-parent-imports: off

# Helpful warnings
# https://github.com/benmosher/eslint-plugin-import#helpful-warnings
import/export: error
import/no-named-as-default: error
import/no-named-as-default-member: error
import/no-deprecated: error
import/no-extraneous-dependencies: error
import/no-mutable-exports: error
import/no-unused-modules: error

# Module systems
# https://github.com/benmosher/eslint-plugin-import#module-systems
import/unambiguous: error
import/no-commonjs: error
import/no-amd: error
import/no-nodejs-modules: error

# Style guide
# https://github.com/benmosher/eslint-plugin-import#style-guide
import/first: off # TODO
import/exports-last: off
import/no-duplicates: error
import/no-namespace: error
import/extensions: [error, never] # TODO: switch to ignorePackages
import/order: off # TODO
import/newline-after-import: error
import/prefer-default-export: off
import/max-dependencies: off
import/no-unassigned-import: error
import/no-named-default: error
import/no-default-export: off
import/no-named-export: off
import/no-anonymous-default-export: error
import/group-exports: off
import/dynamic-import-chunkname: off

##############################################################################
# ESLint builtin rules list based on `v6.8.x`
##################################################
##############################################################################

# Possible Errors
# https://eslint.org/docs/rules/#possible-errors
Expand Down Expand Up @@ -361,13 +421,17 @@ rules:
yield-star-spacing: off

overrides:
- files: '**/__tests__/**'
- files: '**/__*__/**'
rules:
import/no-nodejs-modules: off
no-restricted-syntax: off
- files: 'resources/**'
parserOptions:
sourceType: script
rules:
import/no-dynamic-require: off
import/no-nodejs-modules: off
import/no-commonjs: off
no-await-in-loop: off
no-restricted-syntax: off
no-console: off
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
"dtslint": "2.0.5",
"eslint": "6.8.0",
"eslint-plugin-flowtype": "4.6.0",
"eslint-plugin-import": "2.20.0",
"flow-bin": "0.116.0",
"mocha": "7.0.0",
"nyc": "15.0.0",
Expand Down
Loading