2017-04-17 16:37:37 +02:00
|
|
|
const error = 2;
|
|
|
|
const warn = 1;
|
|
|
|
const ignore = 0;
|
|
|
|
|
2017-04-14 09:26:27 +02:00
|
|
|
module.exports = {
|
2017-05-26 14:10:52 +02:00
|
|
|
root: true,
|
2017-06-06 13:18:33 +02:00
|
|
|
extends: ['eslint-config-airbnb', 'plugin:jest/recommended', 'prettier'],
|
2017-06-06 17:40:40 +02:00
|
|
|
plugins: ['prettier', 'jest', 'react', 'json'],
|
2017-04-14 10:13:31 +02:00
|
|
|
parser: 'babel-eslint',
|
|
|
|
parserOptions: {
|
|
|
|
sourceType: 'module',
|
2017-04-02 00:22:33 +02:00
|
|
|
},
|
2017-04-14 10:13:31 +02:00
|
|
|
env: {
|
|
|
|
es6: true,
|
|
|
|
node: true,
|
2017-04-17 16:37:37 +02:00
|
|
|
'jest/globals': true,
|
2017-04-02 00:22:33 +02:00
|
|
|
},
|
2017-10-04 00:20:18 +03:00
|
|
|
settings: {
|
|
|
|
'import/core-modules': ['enzyme'],
|
|
|
|
},
|
2017-04-14 10:13:31 +02:00
|
|
|
rules: {
|
2017-04-28 17:25:45 +02:00
|
|
|
strict: [error, 'never'],
|
2017-06-06 13:18:33 +02:00
|
|
|
'prettier/prettier': [
|
|
|
|
warn,
|
|
|
|
{
|
|
|
|
printWidth: 100,
|
|
|
|
tabWidth: 2,
|
|
|
|
bracketSpacing: true,
|
|
|
|
trailingComma: 'es5',
|
|
|
|
singleQuote: true,
|
|
|
|
},
|
|
|
|
],
|
2017-08-03 20:49:30 +03:00
|
|
|
quotes: [warn, 'single', { avoidEscape: true }],
|
2017-04-17 16:37:49 +02:00
|
|
|
'class-methods-use-this': ignore,
|
2017-05-31 08:29:09 +02:00
|
|
|
'arrow-parens': [warn, 'as-needed'],
|
2017-04-17 16:37:37 +02:00
|
|
|
'space-before-function-paren': ignore,
|
2017-10-02 01:40:46 +03:00
|
|
|
'import/no-unresolved': error,
|
2017-06-06 13:18:33 +02:00
|
|
|
'import/extensions': [
|
2017-10-02 01:40:46 +03:00
|
|
|
error,
|
2017-06-06 13:18:33 +02:00
|
|
|
{
|
|
|
|
js: 'never',
|
|
|
|
json: 'always',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
'import/no-extraneous-dependencies': [
|
2017-08-18 04:35:25 +03:00
|
|
|
error,
|
2017-06-06 13:18:33 +02:00
|
|
|
{
|
|
|
|
devDependencies: [
|
2017-08-18 04:35:25 +03:00
|
|
|
'examples/**',
|
|
|
|
'**/example/**',
|
|
|
|
'*.js',
|
2017-06-06 13:18:33 +02:00
|
|
|
'**/*.test.js',
|
|
|
|
'**/scripts/*.js',
|
2017-11-18 14:20:34 +03:00
|
|
|
'**/stories/**/*.js',
|
|
|
|
'**/__tests__/**/*.js',
|
2017-06-06 13:18:33 +02:00
|
|
|
],
|
|
|
|
peerDependencies: true,
|
|
|
|
},
|
|
|
|
],
|
2017-04-17 16:37:37 +02:00
|
|
|
'import/prefer-default-export': ignore,
|
2017-06-05 00:58:23 +02:00
|
|
|
'react/jsx-wrap-multilines': ignore,
|
2017-07-08 22:57:21 +02:00
|
|
|
'react/jsx-indent': ignore,
|
2017-06-11 11:57:03 +02:00
|
|
|
'react/jsx-indent-props': ignore,
|
|
|
|
'react/jsx-closing-bracket-location': ignore,
|
2017-04-17 16:37:37 +02:00
|
|
|
'react/jsx-uses-react': error,
|
|
|
|
'react/jsx-uses-vars': error,
|
|
|
|
'react/react-in-jsx-scope': error,
|
2017-06-06 13:18:33 +02:00
|
|
|
'react/jsx-filename-extension': [
|
|
|
|
warn,
|
|
|
|
{
|
|
|
|
extensions: ['.js', '.jsx'],
|
|
|
|
},
|
|
|
|
],
|
2017-05-09 10:15:00 +02:00
|
|
|
'jsx-a11y/accessible-emoji': ignore,
|
2017-07-25 11:20:08 +02:00
|
|
|
'jsx-a11y/href-no-hash': ignore,
|
|
|
|
'jsx-a11y/label-has-for': ignore,
|
2017-11-09 03:12:06 +03:00
|
|
|
'jsx-a11y/click-events-have-key-events': error,
|
2017-09-03 02:22:32 -07:00
|
|
|
'jsx-a11y/anchor-is-valid': [warn, { aspects: ['invalidHref'] }],
|
2017-04-28 17:25:45 +02:00
|
|
|
'react/no-unescaped-entities': ignore,
|
2017-04-14 09:26:27 +02:00
|
|
|
},
|
2017-06-06 13:18:33 +02:00
|
|
|
};
|