1
- // const validColors = require('./src/style/colorsPalette').colorsPalette;
2
- // const extraFixColorsMap = require('./src/style/colorsPalette').extraFixColorsMap;
3
- // const assetsDepJson = require('./eslint-rules/tests/assets_deprecation.json');
4
- // const deprecationsJson = require('./eslint-rules/tests/component_deprecation.json');
5
-
6
1
module . exports = {
2
+ extends : 'wix/react-native' ,
7
3
parser : 'babel-eslint' ,
8
- plugins : [ 'react' , 'react-native' , 'uilib' ] ,
9
- // extends: ['airbnb'],
10
4
rules : {
11
- 'arrow-body-style' : 'off' ,
12
5
'arrow-parens' : 'off' ,
13
6
// TODO: remove after migration of legacy lifecycle methods
14
- 'camelcase' : 'off' ,
15
- 'class-methods-use-this' : 'off' ,
16
- 'consistent-return' : 'off' ,
17
- 'comma-dangle' : 'off' ,
18
- 'global-require' : 'off' ,
19
- 'max-len' : [ 2 , 130 , 4 , { ignoreUrls : true } ] ,
20
- 'no-nested-ternary' : 'off' ,
21
- 'no-else-return' : 'off' ,
7
+ camelcase : 'off' ,
8
+ 'comma-dangle' : [ 'error' , 'never' ] ,
22
9
'no-mixed-operators' : [ 'off' ] ,
23
- 'no-param-reassign' : [ 'warn' ] ,
24
- 'no-plusplus' : 'off' ,
25
- 'no-return-assign' : 'off' ,
26
10
'no-trailing-spaces' : 'off' ,
27
- 'no-use-before-define' : 'off' ,
28
- 'no-unneeded-ternary' : 'off' ,
29
- 'no-mixed-operators' : 'off' ,
30
- 'no-underscore-dangle' : [ 'error' , { 'allowAfterThis' : true } ] ,
31
- 'object-curly-spacing' : 'off' ,
32
11
'operator-linebreak' : 'off' ,
33
- 'react/forbid-prop-types' : 'off' ,
34
- 'react/jsx-filename-extension' : 'off' ,
35
- 'react/jsx-space-before-closing' : 'off' ,
36
- 'react/jsx-tag-spacing' : 'off' ,
37
- // 'react/no-did-mount-set-state': 'warn',
38
- 'react/prefer-stateless-function' : 'off' ,
39
- 'react/prop-types' : [ 'error' , { ignore : [ 'children' , 'style' , 'testID' ] } ] ,
40
- 'react/require-default-props' : 'off' ,
41
- "react/sort-comp" : [ 'warn' ] ,
12
+ 'max-len' : [ 'warn' , { code : 120 } ] ,
42
13
'react/jsx-no-bind' : [
43
14
'warn' ,
44
15
{
@@ -47,27 +18,74 @@ module.exports = {
47
18
allowBind : false ,
48
19
} ,
49
20
] ,
50
- // 'import/no-extraneous-dependencies': [
51
- // 'warn',
52
- // {devDependencies: true, optionalDependencies: false, peerDependencies: true},
53
- // ],
54
- 'import/prefer-default-export' : 'off' ,
55
- // 'uilib/assets-deprecation': ['error', {deprecations: assetsDepJson, source: '../../assets', dueDate: '2 November, Friday'}],
56
- // 'uilib/component-deprecation': ['error', {deprecations: deprecationsJson, dueDate: 'Friday 21 December'}],
57
- // 'uilib/no-direct-import': ['error', {origin: 'react-native-ui-lib', destination: 'some-other-source'}],
58
- // 'uilib/no-hard-coded-color': ['error', validColors, extraFixColorsMap],
59
- // 'uilib/no-hard-coded-font': 'error'
60
- } ,
61
- env : {
62
- browser : true ,
63
- node : true ,
64
- jest : true ,
65
- } ,
66
- settings : {
67
- 'import/resolver' : {
68
- node : {
69
- extensions : [ '.js' , '.ios.js' , '.android.js' ] ,
70
- } ,
71
- } ,
21
+ 'function-paren-newline' : [ 'warn' , 'never' ] ,
22
+ 'new-cap' : [ 'off' ] , // TODO: fix this in colors.js and remove this
23
+ 'default-case' : [ 'off' ]
72
24
} ,
73
25
} ;
26
+
27
+ // OLD ESlint configuration
28
+ // const validColors = require('./src/style/colorsPalette').colorsPalette;
29
+ // const extraFixColorsMap = require('./src/style/colorsPalette').extraFixColorsMap;
30
+ // const assetsDepJson = require('./eslint-rules/tests/assets_deprecation.json');
31
+ // const deprecationsJson = require('./eslint-rules/tests/component_deprecation.json');
32
+
33
+ // module.exports = {
34
+ // parser: 'babel-eslint',
35
+ // extends: 'wix/react-native',
36
+ // // plugins: ['react', 'react-native', 'uilib'],
37
+ // // extends: ['airbnb'],
38
+ // rules: {
39
+ // 'arrow-body-style': 'off',
40
+ // 'arrow-parens': 'off',
41
+ // // TODO: remove after migration of legacy lifecycle methods
42
+ // 'camelcase': 'off',
43
+ // 'class-methods-use-this': 'off',
44
+ // 'consistent-return': 'off',
45
+ // 'comma-dangle': 'off',
46
+ // 'global-require': 'off',
47
+ // 'max-len': [2, 130, 4, {ignoreUrls: true}],
48
+ // 'no-nested-ternary': 'off',
49
+ // 'no-else-return': 'off',
50
+ // 'no-mixed-operators': ['off'],
51
+ // 'no-param-reassign': ['warn'],
52
+ // 'no-plusplus': 'off',
53
+ // 'no-return-assign': 'off',
54
+ // 'no-trailing-spaces': 'off',
55
+ // 'no-use-before-define': 'off',
56
+ // 'no-unneeded-ternary': 'off',
57
+ // 'no-mixed-operators': 'off',
58
+ // 'no-underscore-dangle': ['error', {'allowAfterThis': true}],
59
+ // 'object-curly-spacing': 'off',
60
+ // 'operator-linebreak': 'off',
61
+ // 'react/forbid-prop-types': 'off',
62
+ // 'react/jsx-filename-extension': 'off',
63
+ // 'react/jsx-space-before-closing': 'off',
64
+ // 'react/jsx-tag-spacing': 'off',
65
+ // 'react/prefer-stateless-function': 'off',
66
+ // 'react/prop-types': ['error', {ignore: ['children', 'style', 'testID']}],
67
+ // 'react/require-default-props': 'off',
68
+ // "react/sort-comp": ['warn'],
69
+ // 'react/jsx-no-bind': [
70
+ // 'warn',
71
+ // {
72
+ // ignoreRefs: true,
73
+ // allowArrowFunctions: false,
74
+ // allowBind: false,
75
+ // },
76
+ // ],
77
+ // 'import/prefer-default-export': 'off'
78
+ // },
79
+ // env: {
80
+ // browser: true,
81
+ // node: true,
82
+ // jest: true,
83
+ // },
84
+ // settings: {
85
+ // 'import/resolver': {
86
+ // node: {
87
+ // extensions: ['.js', '.ios.js', '.android.js'],
88
+ // },
89
+ // },
90
+ // },
91
+ // };
0 commit comments