-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.cjs
57 lines (57 loc) · 2.28 KB
/
.eslintrc.cjs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
module.exports = {
parser: '@babel/eslint-parser',
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
requireConfigFile: 'false',
babelOptions: { configFile: './.babelrc' },
},
env: {
es2021: true,
node: true,
},
plugins: ['flowtype', 'unicorn', 'import', 'fp'],
extends: [
'eslint:recommended',
'plugin:import/errors',
'plugin:node/recommended',
'plugin:import/warnings',
'plugin:flowtype/recommended',
'plugin:unicorn/recommended',
],
// AirBnb is great, but very strict. Feel free to add anything.
rules: {
'arrow-parens': 0, // Does not work with Flow generic types.
'import/extensions': ['error', 'ignorePackages'],
'import/first': 0, // We sort by atom/sort lines natural order.
'import/prefer-default-export': 0, // Actions can have just one action.
'sort-imports': 'off',
// 'import/order': ['error', { alphabetize: { order: 'asc', caseInsensitive: true } }],
indent: 0, // Prettier.
'function-paren-newline': 0, // Prettier.
'object-curly-newline': 0, //Prettier.
'no-confusing-arrow': 0, // This rule is confusing.
'no-mixed-operators': 0, // Prettier.
'space-before-function-paren': 0, // Prettier.
'no-nested-ternary': 0, // Buggy for functional components.
'no-param-reassign': 0, // We love param reassignment. Naming is hard.
'no-shadow': 0, // Shadowing is a nice language feature. Naming is hard.
'no-underscore-dangle': 0, // Control freaky.
// misc (CjK)
'no-unused-vars': ['error', { argsIgnorePattern: '^_', ignoreRestSiblings: true }],
'comma-dangle': ['error', 'only-multiline'],
'max-len': ['error', 150, { ignoreComments: true, ignoreUrls: true }],
'no-return-assign': ['error', 'except-parens'],
'one-var': 0,
'unicorn/filename-case': 0,
'unicorn/prevent-abbreviations': 0,
'unicorn/no-array-reduce': 0,
'unicorn/no-array-for-each': 0,
// This rule gives false-positives with e.g. Rx#map second parameter and we mostly don't use Array#map et.al.
// directly anyways
'unicorn/no-array-method-this-argument': 0,
// Currently breaks at runtime when using Babel; seems to require "type": "module" in package.json but then we'd
// need to get rid of 'require' et.al.
'unicorn/prefer-node-protocol': 0,
},
}