Browse Source

feat(eslint): use new eslint-config-jitsi

It contains all the rules we use, minus the react-native specific ones, which we
are keeping here.
master
Saúl Ibarra Corretgé 6 years ago
parent
commit
89eacd6982
4 changed files with 21 additions and 147 deletions
  1. 2
    2
      package-lock.json
  2. 1
    1
      package.json
  3. 12
    0
      react/.eslintrc-react-native.js
  4. 6
    144
      react/.eslintrc.js

+ 2
- 2
package-lock.json View File

@@ -6376,8 +6376,8 @@
6376 6376
       }
6377 6377
     },
6378 6378
     "eslint-config-jitsi": {
6379
-      "version": "github:jitsi/eslint-config-jitsi#64b9f255ae804eb91bd62a3c6fbeb8104944587a",
6380
-      "from": "github:jitsi/eslint-config-jitsi#v0.1",
6379
+      "version": "github:jitsi/eslint-config-jitsi#3d193df6476a73f827582e137a67a8612130a455",
6380
+      "from": "github:jitsi/eslint-config-jitsi#v0.1.0",
6381 6381
       "dev": true
6382 6382
     },
6383 6383
     "eslint-import-resolver-node": {

+ 1
- 1
package.json View File

@@ -86,7 +86,7 @@
86 86
     "clean-css": "3.4.25",
87 87
     "css-loader": "0.28.7",
88 88
     "eslint": "4.12.1",
89
-    "eslint-config-jitsi": "github:jitsi/eslint-config-jitsi#v0.1",
89
+    "eslint-config-jitsi": "github:jitsi/eslint-config-jitsi#v0.1.0",
90 90
     "eslint-plugin-flowtype": "2.39.1",
91 91
     "eslint-plugin-import": "2.8.0",
92 92
     "eslint-plugin-jsdoc": "3.2.0",

+ 12
- 0
react/.eslintrc-react-native.js View File

@@ -0,0 +1,12 @@
1
+module.exports = {
2
+    'plugins': [
3
+        'react-native'
4
+    ],
5
+    'rules': {
6
+        'react-native/no-color-literals': 2,
7
+        'react-native/no-inline-styles': 2,
8
+        'react-native/no-unused-styles': 2,
9
+        'react-native/split-platform-components': 2
10
+    }
11
+};
12
+

+ 6
- 144
react/.eslintrc.js View File

@@ -1,146 +1,8 @@
1 1
 module.exports = {
2
-    'extends': '../.eslintrc.js',
3
-    'parserOptions': {
4
-        'ecmaFeatures': {
5
-            'jsx': true
6
-        }
7
-    },
8
-    'plugins': [
9
-        'jsdoc',
10
-        'react',
11
-        'react-native'
12
-    ],
13
-    'rules': {
14
-        // Possible Errors group
15
-
16
-        // Currently, we are using both valid-jsdoc and 'jsdoc' plugin. In the
17
-        // future we might stick to one as soon as it has all the features.
18
-        'valid-jsdoc': [
19
-            'error',
20
-            {
21
-                'matchDescription': '.+',
22
-                'prefer': {
23
-                    'arg': 'param',
24
-                    'argument': 'param',
25
-                    'return': 'returns'
26
-                },
27
-                'preferType': {
28
-                    'array': 'Array',
29
-                    'Boolean': 'boolean',
30
-                    'function': 'Function',
31
-                    'Number': 'number',
32
-                    'object': 'Object',
33
-                    'String': 'string'
34
-                },
35
-                'requireParamDescription': true,
36
-                'requireReturn': true,
37
-                'requireReturnDescription': false,
38
-                'requireReturnType': true
39
-            }
40
-        ],
41
-
42
-        // Best Practices group
43
-        'jsx-quotes': [ 'error', 'prefer-single' ],
44
-
45
-        // ES6 group rules
46
-
47
-        // JsDoc plugin rules group. The following rules are in addition to
48
-        // valid-jsdoc rule.
49
-        'jsdoc/check-param-names': 0,
50
-        'jsdoc/check-tag-names': 2,
51
-        'jsdoc/check-types': 0,
52
-        'jsdoc/newline-after-description': 2,
53
-
54
-        // XXX Because the following plugin is not very smart about words which
55
-        // legitimately begin with uppercase characters mid-sentence, set it to
56
-        // warn only.
57
-        'jsdoc/require-description-complete-sentence': 1,
58
-        'jsdoc/require-hyphen-before-param-description': 2,
59
-
60
-        // The following 5 rules are covered by valid-jsdoc, so disable them.
61
-        'jsdoc/require-param': 0,
62
-        'jsdoc/require-param-description': 0,
63
-        'jsdoc/require-param-type': 0,
64
-        'jsdoc/require-returns-description': 0,
65
-        'jsdoc/require-returns-type': 0,
66
-
67
-        // React plugin rules group
68
-        'react/display-name': 0,
69
-        'react/forbid-prop-types': 0,
70
-        'react/no-danger': 2,
71
-        'react/no-deprecated': 2,
72
-        'react/no-did-mount-set-state': 2,
73
-        'react/no-did-update-set-state': 2,
74
-        'react/no-direct-mutation-state': 2,
75
-        'react/no-find-dom-node': 2,
76
-        'react/no-is-mounted': 2,
77
-        'react/no-multi-comp': 2,
78
-        'react/no-render-return-value': 2,
79
-        'react/no-set-state': 0,
80
-        'react/no-string-refs': 2,
81
-        'react/no-unknown-property': 2,
82
-        'react/prefer-es6-class': 2,
83
-        'react/prefer-stateless-function': 0,
84
-        'react/prop-types': 2,
85
-        'react/react-in-jsx-scope': 2,
86
-        'react/require-extension': 0,
87
-        'react/require-optimization': 0,
88
-        'react/require-render-return': 2,
89
-        'react/self-closing-comp': 2,
90
-        'react/sort-comp': 0,
91
-        'react/sort-prop-types': 2,
92
-
93
-        // React plugin JSX-specific rule group
94
-        'react/jsx-boolean-value': [ 'error', 'always' ],
95
-        'react/jsx-closing-bracket-location': [
96
-            'error',
97
-            'after-props'
98
-        ],
99
-        'react/jsx-curly-spacing': [
100
-            'error',
101
-            'always',
102
-            {
103
-                'spacing': {
104
-                    'objectLiterals': 'never'
105
-                }
106
-            }
107
-        ],
108
-        'react/jsx-equals-spacing': [ 'error', 'always' ],
109
-        'react/jsx-filename-extension': 0,
110
-        'react/jsx-first-prop-new-line': [ 'error', 'multiline' ],
111
-        'react/jsx-handler-names': [
112
-            'error',
113
-            {
114
-                'eventHandlerPrefix': '_on',
115
-                'eventHandlerPropPrefix': 'on'
116
-            }
117
-        ],
118
-        'react/jsx-indent': 2,
119
-        'react/jsx-indent-props': 2,
120
-        'react/jsx-key': 2,
121
-        'react/jsx-max-props-per-line': 2,
122
-        'react/jsx-no-bind': 2,
123
-        'react/jsx-no-comment-textnodes': 2,
124
-        'react/jsx-no-duplicate-props': 2,
125
-        'react/jsx-no-literals': 0,
126
-        'react/jsx-no-target-blank': 2,
127
-        'react/jsx-no-undef': 2,
128
-        'react/jsx-pascal-case': 2,
129
-        'react/jsx-sort-props': 2,
130
-        'react/jsx-tag-spacing': [
131
-            'error',
132
-            {
133
-                'beforeSelfClosing': 'always'
134
-            }
135
-        ],
136
-        'react/jsx-uses-react': 2,
137
-        'react/jsx-uses-vars': 2,
138
-        'react/jsx-wrap-multilines': 2,
139
-
140
-        // React Native plugin rules group
141
-        'react-native/no-color-literals': 2,
142
-        'react-native/no-inline-styles': 2,
143
-        'react-native/no-unused-styles': 2,
144
-        'react-native/split-platform-components': 2
145
-    }
2
+    'extends': [
3
+        '../.eslintrc.js',
4
+        'eslint-config-jitsi/jsdoc',
5
+        'eslint-config-jitsi/react',
6
+        '.eslintrc-react-native.js'
7
+    ]
146 8
 };

Loading…
Cancel
Save