-
Notifications
You must be signed in to change notification settings - Fork 787
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Introduce prettier-eslint and upgrade eslint related packages (#…
…882) * chore: Update linting configuration Move to prettier-eslint in lint-staged. Upgrade eslint, babel-eslint dependencies. Rename .eslintrc -> .eslintrc.js * chore: Reformat files Reformat files using updated eslint, babel-eslint, prettier-eslint * chore: update lock hash * style: Format by prettier * chore: Upgrade to eslint@5 and related dependencies * style: Clean all eslint errors * style: Revert as [email protected] * Revert "chore: Reformat files" This reverts commit c314b18. * style: Pick useful changes * style: Lint by bash@4
- Loading branch information
1 parent
a2aa221
commit 6427433
Showing
15 changed files
with
1,378 additions
and
639 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,181 @@ | ||
module.exports = { | ||
extends: 'eslint-config-airbnb', | ||
plugins: ['jsx-a11y', 'import', 'react', 'react-native', 'flowtype'], | ||
parser: 'babel-eslint', | ||
env: { | ||
browser: true, | ||
node: true, | ||
es6: true, | ||
}, | ||
parserOptions: { | ||
ecmaFeatures: { | ||
jsx: true, | ||
}, | ||
}, | ||
globals: { | ||
__DEV__: true, | ||
}, | ||
settings: { | ||
'import/resolver': { | ||
'babel-module': { | ||
root: ['./src'], | ||
alias: { | ||
api: 'api', | ||
auth: 'auth', | ||
components: 'components', | ||
config: 'config', | ||
issue: 'issue', | ||
locale: 'locale', | ||
notifications: 'notifications', | ||
organization: 'organization', | ||
repository: 'repository', | ||
search: 'search', | ||
testData: './__tests__/data', | ||
user: 'user', | ||
utils: 'utils', | ||
}, | ||
}, | ||
}, | ||
}, | ||
rules: { | ||
'global-require': 'off', | ||
'import/prefer-default-export': 'off', | ||
'jsx-a11y/anchor-has-content': 'off', | ||
'jsx-a11y/no-noninteractive-element-interactions': 'off', | ||
'jsx-a11y/no-static-element-interactions': 'off', | ||
'arrow-body-style': 'off', | ||
'arrow-parens': ['error', 'as-needed'], | ||
'comma-dangle': ['error', 'always-multiline'], | ||
indent: 'off', | ||
'padding-line-between-statements': [ | ||
2, | ||
{ blankLine: 'always', prev: '*', next: 'return' }, | ||
{ blankLine: 'always', prev: ['var', 'let', 'const'], next: '*' }, | ||
{ | ||
blankLine: 'any', | ||
prev: ['var', 'let', 'const'], | ||
next: ['var', 'let', 'const'], | ||
}, | ||
], | ||
'newline-per-chained-call': 'off', | ||
'no-confusing-arrow': 'off', | ||
'no-else-return': [ | ||
'error', | ||
{ | ||
allowElseIf: true, | ||
}, | ||
], | ||
'no-mixed-operators': [ | ||
'error', | ||
{ | ||
groups: [ | ||
['&', '|', '^', '~', '<<', '>>', '>>>'], | ||
['==', '!=', '===', '!==', '>', '>=', '<', '<='], | ||
['&&', '||'], | ||
['in', 'instanceof'], | ||
], | ||
allowSamePrecedence: true, | ||
}, | ||
], | ||
'no-underscore-dangle': 'off', | ||
'max-len': 'off', | ||
'no-plusplus': [ | ||
'error', | ||
{ | ||
allowForLoopAfterthoughts: true, | ||
}, | ||
], | ||
'space-before-function-paren': [ | ||
'error', | ||
{ | ||
anonymous: 'never', | ||
named: 'never', | ||
asyncArrow: 'always', | ||
}, | ||
], | ||
'wrap-iife': [ | ||
'error', | ||
'inside', | ||
{ | ||
functionPrototypeMethods: false, | ||
}, | ||
], | ||
'flowtype/define-flow-type': 1, | ||
'react/jsx-wrap-multilines': 'off', | ||
'react/jsx-closing-bracket-location': 'off', | ||
'react/jsx-curly-spacing': [ | ||
'error', | ||
'never', | ||
{ | ||
allowMultiline: true, | ||
}, | ||
], | ||
'react/jsx-filename-extension': [ | ||
'error', | ||
{ | ||
extensions: ['.js', '.jsx'], | ||
}, | ||
], | ||
'react/jsx-indent': 'off', | ||
'react/jsx-indent-props': 'off', | ||
'react/jsx-no-bind': 'error', | ||
'react/no-multi-comp': 'off', | ||
'react/prefer-stateless-function': 'off', | ||
'react/sort-comp': [ | ||
'error', | ||
{ | ||
order: [ | ||
'static-methods', | ||
'lifecycle', | ||
'/^on.+$/', | ||
'/^(get|set)(?!(InitialState$|DefaultProps$|ChildContext$)).+$/', | ||
'everything-else', | ||
'/^render.+$/', | ||
'render', | ||
], | ||
groups: { | ||
lifecycle: [ | ||
'displayName', | ||
'props', | ||
'propTypes', | ||
'contextTypes', | ||
'childContextTypes', | ||
'mixins', | ||
'statics', | ||
'defaultProps', | ||
'state', | ||
'constructor', | ||
'getDefaultProps', | ||
'getInitialState', | ||
'getChildContext', | ||
'componentWillMount', | ||
'componentDidMount', | ||
'componentWillReceiveProps', | ||
'shouldComponentUpdate', | ||
'componentWillUpdate', | ||
'componentDidUpdate', | ||
'componentWillUnmount', | ||
], | ||
}, | ||
}, | ||
], | ||
// disable temporarily in order to not modify current codes | ||
'function-paren-newline': 'off', | ||
'implicit-arrow-linebreak': 'off', | ||
'lines-between-class-members': 'off', | ||
'object-curly-newline': 'off', | ||
'operator-linebreak': 'off', | ||
'prefer-destructuring': 'off', | ||
'import/named': 'off', | ||
'import/no-cycle': 'off', | ||
'jsx-a11y/anchor-is-valid': 'off', | ||
'no-restricted-globals': 'off', | ||
'react/default-props-match-prop-types': 'off', | ||
'react/destructuring-assignment': 'off', | ||
'react/jsx-one-expression-per-line': 'off', | ||
'react/no-access-state-in-setstate': 'off', | ||
'react/no-this-in-sfc': 'off', | ||
'react/no-unused-state': 'off', | ||
'react/require-default-props': 'off', | ||
}, | ||
}; |
Oops, something went wrong.